public abstract class GlyphVector extends Object implements Cloneable
GlyphVector对象是包含用于每个字型的变换后的坐标,其对应于在其上的设备空间中的位置的几何信息字形的集合GlyphVector最终显示。
GlyphVector不会尝试对其包含的字形序列的任何解释。 序列中相邻字形之间的关系仅用于确定字形在视觉坐标空间中的位置。
GlyphVector的GlyphVector由Font创建。
在可缓存文本,创建和随后的高速缓存中间表示文本处理应用程序GlyphVector渲染过程中使用的是呈现字符的视觉表示给用户的最快方法。
A GlyphVector与正好一个Font ,并且可以提供仅对于该Font有用的数据。 此外,从GlyphVector获得的GlyphVector通常不是几何可缩放的,因为像素化和间隔取决于Font中的网格拟合Font 。 为了便于精确测量GlyphVector及其组件字形,您必须在创建GlyphVector时指定缩放变换,抗混叠模式和小数度量模式。 这些特性可以从目标设备导出。
对于GlyphVector中的每个字形,您可以获取:
GlyphVector的上下文中的字形的度量。 在不同的变换,应用程序指定的渲染提示和GlyphVector中的字形的具体实例中,字形的GlyphVector 。 改变用于创建数据GlyphVector不改变的状态GlyphVector 。
提供了方法来调整GlyphVector中字形的GlyphVector 。 这些方法对于正在执行用于呈现字形的对齐操作的应用程序是最合适的。
提供了方法来转换GlyphVector内的GlyphVector字形。 这些方法主要用于特殊效果。
提供一些方法以返回两个整个的视觉,逻辑和像素范围GlyphVector的内或各个字形的GlyphVector 。
提供一些方法返回一个Shape为GlyphVector ,并为中各个字形GlyphVector 。
Font , GlyphMetrics , TextLayout
| Modifier and Type | Field and Description |
|---|---|
static int |
FLAG_COMPLEX_GLYPHS
与getLayoutFlags一起使用的标志,表示此
GlyphVector具有复杂的字形到字符映射(一个不以符合运行方向的严格升序或降序的方式将字形映射到字符一对一)。
|
static int |
FLAG_HAS_POSITION_ADJUSTMENTS
与getLayoutFlags一起使用的标志,表示此
GlyphVector具有位置调整。
|
static int |
FLAG_HAS_TRANSFORMS
与getLayoutFlags一起使用的标志,表示此
GlyphVector具有每个字形转换。
|
static int |
FLAG_MASK
来自getLayoutFlags的支持标志的掩码。
|
static int |
FLAG_RUN_RTL
与getLayoutFlags一起使用的标志,表示此
GlyphVector具有从右到左的运行方向。
|
| Constructor and Description |
|---|
GlyphVector() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
equals(GlyphVector set)
测试指定的GlyphVector
GlyphVector完全等于此
GlyphVector 。
|
abstract Font |
getFont()
返回
Font与此相关
GlyphVector 。
|
abstract FontRenderContext |
getFontRenderContext()
返回 FontRenderContext与此相关GlyphVector 。
|
int |
getGlyphCharIndex(int glyphIndex)
返回指定字形的字符索引。
|
int[] |
getGlyphCharIndices(int beginGlyphIndex, int numEntries, int[] codeReturn)
返回指定字形的字符索引。
|
abstract int |
getGlyphCode(int glyphIndex)
返回指定字形的字形代码。
|
abstract int[] |
getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn)
返回指定字形的字形数组。
|
abstract GlyphJustificationInfo |
getGlyphJustificationInfo(int glyphIndex)
将指定索引中的字形的对齐信息返回给此
GlyphVector 。
|
abstract Shape |
getGlyphLogicalBounds(int glyphIndex)
返回此
GlyphVector指定字形的逻辑边界。
|
abstract GlyphMetrics |
getGlyphMetrics(int glyphIndex)
将指定索引的字形的度量返回到此
GlyphVector 。
|
abstract Shape |
getGlyphOutline(int glyphIndex)
返回一个
Shape ,其内部对应于此GlyphVector中指定字形的视觉
GlyphVector 。
|
Shape |
getGlyphOutline(int glyphIndex, float x, float y)
返回一个
Shape ,其内部对应于此GlyphVector内的指定字形的视觉
GlyphVector ,偏移到x,y。
|
Rectangle |
getGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y)
当这个返回index字形的像素范围
GlyphVector是在渲染
Graphics给定
FontRenderContext在给定位置。
|
abstract Point2D |
getGlyphPosition(int glyphIndex)
返回指定字形相对于该
GlyphVector的原点的
GlyphVector 。
|
abstract float[] |
getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn)
返回指定字形的字形位置数组。
|
abstract AffineTransform |
getGlyphTransform(int glyphIndex)
返回此GlyphVector中指定字形的
GlyphVector 。
|
abstract Shape |
getGlyphVisualBounds(int glyphIndex)
返回中指定字形的可视边界
GlyphVector 。
|
int |
getLayoutFlags()
返回描述GlyphVector全局状态的标志。
|
abstract Rectangle2D |
getLogicalBounds()
返回此
GlyphVector的逻辑边界。
|
abstract int |
getNumGlyphs()
返回此
GlyphVector中的字形数。
|
abstract Shape |
getOutline()
返回一个
Shape ,其内部对应于此GlyphVector的视觉
GlyphVector 。
|
abstract Shape |
getOutline(float x, float y)
返回一个
Shape ,其内部对应于这个
GlyphVector在x,y渲染时的视觉表示。
|
Rectangle |
getPixelBounds(FontRenderContext renderFRC, float x, float y)
在给定位置的给定
FontRenderContext的图形中渲染时,返回此
GlyphVector的像素边界。
|
abstract Rectangle2D |
getVisualBounds()
返回这个
GlyphVector的视觉边界视觉边界是这个
GlyphVector的轮廓的边界框。
|
abstract void |
performDefaultLayout()
在此
GlyphVector为每个字形分配默认
GlyphVector 。
|
abstract void |
setGlyphPosition(int glyphIndex, Point2D newPos)
设置此
GlyphVector指定字形的位置。
|
abstract void |
setGlyphTransform(int glyphIndex, AffineTransform newTX)
设置此GlyphVector中指定字形的
GlyphVector 。
|
public static final int FLAG_HAS_TRANSFORMS
GlyphVector具有每个字形转换。
public static final int FLAG_HAS_POSITION_ADJUSTMENTS
GlyphVector具有位置调整。
当这是真的,字形位置与字形的累积默认进度不匹配(例如,如果已经完成了字距调整)。
public static final int FLAG_RUN_RTL
GlyphVector具有从右到左的运行方向。
这是指字形到字符映射,并不意味着字形的视觉位置必然按照这个顺序,尽管通常它们将是。
public static final int FLAG_COMPLEX_GLYPHS
GlyphVector具有复杂的字形到字符映射(一个不以符合运行方向的严格升序或降序的方式将字形映射到字符一对一)。
public static final int FLAG_MASK
public abstract Font getFont()
Font与此相关
GlyphVector 。
Font用于创建此
GlyphVector 。
Font
public abstract FontRenderContext getFontRenderContext()
FontRenderContext与此相关GlyphVector 。
FontRenderContext用于创建此
GlyphVector 。
FontRenderContext , Font
public abstract void performDefaultLayout()
GlyphVector为每个字形分配默认GlyphVector 。
这可能会破坏此GlyphVector初始布局过程中GlyphVector 。
public abstract int getNumGlyphs()
GlyphVector中的字形数。
GlyphVector 。
public abstract int getGlyphCode(int glyphIndex)
GlyphVector的Font对象之外,此返回值是GlyphVector 。
glyphIndex - 这个
GlyphVector中的索引对应于从其中检索字形的字形。
glyphIndex 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此字形数
GlyphVector
public abstract int[] getGlyphCodes(int beginGlyphIndex,
int numEntries,
int[] codeReturn)
Font用于创建此GlyphVector之外,此返回值的内容是GlyphVector 。
当处理字形时,该方法用于方便和性能。
如果没有传入数组,则会创建一个新数组。
beginGlyphIndex - 这个
GlyphVector的索引开始检索字形
numEntries - 要检索的字形数量
codeReturn - 接收字形并返回的数组
IllegalArgumentException - 如果
numEntries小于0
IndexOutOfBoundsException - 如果
beginGlyphIndex小于0
IndexOutOfBoundsException -如果总和
beginGlyphIndex和
numEntries比字形的这个数越大
GlyphVector
public int getGlyphCharIndex(int glyphIndex)
glyphIndex - 字形的索引
public int[] getGlyphCharIndices(int beginGlyphIndex,
int numEntries,
int[] codeReturn)
beginGlyphIndex - 第一个字形的索引
numEntries - 字形指数的数量
codeReturn - 返回字符索引的数组
public abstract Rectangle2D getLogicalBounds()
GlyphVector的逻辑边界。
当定位此GlyphVector与视觉上相邻的GlyphVector对象时,将使用此方法。
Rectangle2D ,它是此的逻辑边界GlyphVector 。
public abstract Rectangle2D getVisualBounds()
GlyphVector的视觉边界。视觉边界是这个GlyphVector的轮廓的边界框。
由于像素的光栅化和对齐,可能这个框不会包含所有受渲染影响的像素GlyphVector 。
Rectangle2D是这个
GlyphVector的边框。
public Rectangle getPixelBounds(FontRenderContext renderFRC, float x, float y)
FontRenderContext的图形中渲染时,返回此GlyphVector的像素边界。
该renderFRC不必是相同FontRenderContext如此GlyphVector ,并且可以为null。
如果为空,则FontRenderContext如此GlyphVector使用。
默认实现返回可视边界,偏移量为x,y,并舍入到下一个整数值(即返回一个包围视觉边界的整数矩形),并忽略FRC。
子类应该覆盖此方法。
renderFRC -
FontRenderContext的
Graphics 。
x - 要呈现这个
GlyphVector的x
GlyphVector 。
y - 渲染此
GlyphVector的y
GlyphVector 。
Rectangle限制将受影响的像素。
public abstract Shape getOutline()
Shape ,其内部对应于这个
GlyphVector的视觉
GlyphVector 。
Shape是这个
GlyphVector的大纲。
public abstract Shape getOutline(float x, float y)
Shape ,其内部对应于这个
GlyphVector在x,y渲染时的视觉表示。
x - 这个
GlyphVector的X
GlyphVector 。
y - 这个
GlyphVector的Y
GlyphVector 。
Shape就是这个轮廓
GlyphVector时在指定的坐标呈现。
public abstract Shape getGlyphOutline(int glyphIndex)
Shape ,其内部对应于此GlyphVector内指定字形的视觉GlyphVector 。
通过此方法返回的轮廓位于每个单个字形的原点周围。
glyphIndex - 该指数为
GlyphVector
Shape是这个
GlyphVector的指定
glyphIndex的字形的轮廓。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此字形数
GlyphVector
public Shape getGlyphOutline(int glyphIndex, float x, float y)
Shape ,其内部对应于此GlyphVector内的指定字形的视觉GlyphVector ,偏移到x,y。
通过此方法返回的轮廓位于每个单个字形的原点周围。
glyphIndex - 该指数为
GlyphVector
x - 这个GlyphVector的位置的X
GlyphVector
y - 这个GlyphVector的位置的Y
GlyphVector
Shape是当在指定的坐标处渲染时,该
GlyphVector的指定
glyphIndex的字形的轮廓。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此
GlyphVector中的字形数
public abstract Point2D getGlyphPosition(int glyphIndex)
GlyphVector的原点的GlyphVector 。
如果glyphIndex等于在这个字形数GlyphVector ,该方法返回最后一个字形后的位置。
这个位置用来定义整个GlyphVector 。
glyphIndex - 该指数为
GlyphVector
Point2D对象,它是在指定的字形位置glyphIndex 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于此
GlyphVector中的字形数
setGlyphPosition(int, java.awt.geom.Point2D)
public abstract void setGlyphPosition(int glyphIndex,
Point2D newPos)
GlyphVector指定字形的位置。
如果glyphIndex等于在这个字形数GlyphVector ,该方法设置的最后一个字形后的位置。
这个位置用来定义整个GlyphVector 。
glyphIndex - 该指数为
GlyphVector
newPos - 在
Point2D定位字形的
glyphIndex
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于此
GlyphVector中的字形数
getGlyphPosition(int)
public abstract AffineTransform getGlyphTransform(int glyphIndex)
GlyphVector 。
该变换是相对于字形位置。
如果没有应用特殊转换,可以返回null 。
空返回表示身份转换。
glyphIndex - 该指数为
GlyphVector
AffineTransform是在指定的glyphIndex的字形的glyphIndex 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此
GlyphVector中的字形数
setGlyphTransform(int, java.awt.geom.AffineTransform)
public abstract void setGlyphTransform(int glyphIndex,
AffineTransform newTX)
GlyphVector 。
该变换是相对于字形位置。
null参数表示对于newTX字形不应用特殊的变换。
该方法可用于旋转,反射,翻译和缩放字形。
添加变换可能导致显着的性能变化。
glyphIndex - 该指数为
GlyphVector
newTX -
newTX形的新变换在
glyphIndex
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此字形数
GlyphVector
getGlyphTransform(int)
public int getLayoutFlags()
FLAG_HAS_POSITION_ADJUSTMENTS ,
FLAG_HAS_TRANSFORMS ,
FLAG_RUN_RTL ,
FLAG_COMPLEX_GLYPHS ,
FLAG_MASK
public abstract float[] getGlyphPositions(int beginGlyphIndex,
int numEntries,
float[] positionReturn)
beginGlyphIndex + position/2 。
从位置1开始的奇数编号的数组条目是标有beginGlyphIndex + (position-1)/2的字形的Y beginGlyphIndex + (position-1)/2 。
如果beginGlyphIndex等于字形在这个数GlyphVector ,该方法获取位置的最后字形后,该位置用于定义整个的提前GlyphVector 。
beginGlyphIndex - 开始检索字形位置的索引
numEntries - 要检索的字形数
positionReturn - 接收字形位置然后返回的数组。
beginGlyphIndex和
numEntries的字形位置数组。
IllegalArgumentException - 如果
numEntries小于0
IndexOutOfBoundsException - 如果
beginGlyphIndex小于0
IndexOutOfBoundsException - 如果
beginGlyphIndex和
numEntries的总和大于此
GlyphVector加一个字形数
public abstract Shape getGlyphLogicalBounds(int glyphIndex)
GlyphVector指定字形的逻辑边界。
这些逻辑边界共有四个边,其中两个边在字形变换下平行于基线,而另外两个边与存在的相邻字形共享。
该方法对于指定字形的命中测试,在符号的前导或后沿定位插入符号以及用于在指定字形周围绘制高亮区域是有用的。
glyphIndex - 这个
GlyphVector的索引对应于从其中检索其逻辑边界的字形
Shape ,其在指定的字形的逻辑边界
glyphIndex 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此字形数
GlyphVector
getGlyphVisualBounds(int)
public abstract Shape getGlyphVisualBounds(int glyphIndex)
GlyphVector 。
此方法返回的边界位于每个单个字形的原点周围。
glyphIndex - 这个
GlyphVector的索引对应于从中检索其视觉边界的字形
Shape ,其在指定的字形的可视边界
glyphIndex 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此
GlyphVector中的字形数
getGlyphLogicalBounds(int)
public Rectangle getGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y)
GlyphVector是在渲染Graphics给定FontRenderContext在给定位置。
renderFRC不需要与FontRenderContext的GlyphVector ,可以为null。
如果为空,则FontRenderContext如此GlyphVector使用。
默认实现返回字形的视觉边界,偏移量为x,y,并舍入到下一个整数值,并忽略FRC。
子类应该覆盖此方法。
index - 字形的索引。
renderFRC -
FontRenderContext的
Graphics 。
x - 提供这个
GlyphVector的X位置。
y - 提供这个
GlyphVector的Y位置。
Rectangle限制将受影响的像素。
public abstract GlyphMetrics getGlyphMetrics(int glyphIndex)
GlyphVector 。
glyphIndex - 这个
GlyphVector中的索引对应于从其中检索其度量的字形
GlyphMetrics对象,其表示在指定的glyphIndex到该GlyphVector中的字形的度量。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此
GlyphVector中的字形数
public abstract GlyphJustificationInfo getGlyphJustificationInfo(int glyphIndex)
GlyphVector 。
glyphIndex - 这个
GlyphVector中的索引对应于从中检索其对齐属性的字形
GlyphJustificationInfo对象,表示在指定的字形调整属性glyphIndex到此GlyphVector 。
IndexOutOfBoundsException - 如果
glyphIndex小于0或大于或等于此
GlyphVector中的字形数
public abstract boolean equals(GlyphVector set)
GlyphVector完全等于此
GlyphVector 。
set - 指定的
GlyphVector进行测试
true如果指定的GlyphVector等于这个GlyphVector ;
false否则。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.