所有类


java.awt.font
类 GlyphVector

java.lang.Object
  继承者 java.awt.font.GlyphVector
所有已实现的接口:
Cloneable

public abstract class GlyphVector
   
   
   
   
   
extends Object
implements Cloneable

GlyphVector 对象是一个字形的集合,包含在转换坐标空间中放置每个字形的几何信息,该坐标空间对应于最终要显示 GlyphVector 的设备。

GlyphVector 不尝试对它包含的字形序列进行任何解释。序列中相邻字形之间的关系只用于确定在可视坐标空间中的字形放置。

GlyphVector 的实例由 Font 创建。

在一个可以对文本的中间表示形式进行缓存的文本处理应用程序中,创建并随后缓存在呈现期间使用的 GlyphVector,这是将字符的可视化表示形式呈现给用户的最快方法。

GlyphVector 恰好与一种 Font 关联,并可以提供仅与此 Font 相关的有用数据。另外,从 GlyphVector 获得的规格通常不是几何可缩放的,因为像素化和间隔与 Font 中的网格适应算法相关。为了便于精确测量 GlyphVector 及其分量字形,在创建 GlyphVector 时必须指定缩放转换、抗锯齿模式和 fractional metrics 模式。这些特性可以从目标设备派生得到。

对于 GlyphVector 中的每个字形,您可以获得:

  • 该字形的位置
  • 与该字形关联的转换
  • GlyphVector 上下文中的字形规格。在不同的转换、具有指定呈现提示的应用程序和 GlyphVector 内字形的具体实例情况下,字形的规格可能也不相同。

改变创建 GlyphVector 所使用的数据不会改变 GlyphVector 的状态。

该类提供了调整 GlyphVector 内字形位置的方法。这些方法最适合为显示字形而正在执行调整操作的应用程序。

该类提供了转换 GlyphVector 中的各个字形的方法。这些方法主要用于特殊效果。

该类提供了一些方法,用于返回整个 GlyphVectorGlyphVector 中各个字形的可视的、逻辑的和像素的边界。

该类还提供了用于返回 GlyphVectorGlyphVector 中各个字形的 Shape 的方法。

另请参见:
Font, GlyphMetrics, TextLayout

字段摘要
static intFLAG_COMPLEX_GLYPHS
          与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 具有从字形到字符的复杂映射关系(此映射不是严格按照与排列方向匹配的升序或降序顺序将字形一一映射到字符)。
static intFLAG_HAS_POSITION_ADJUSTMENTS
          与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 调整了位置。
static intFLAG_HAS_TRANSFORMS
          与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 的每个字形都有转换。
static intFLAG_MASK
          getLayoutFlags 支持标志的掩码。
static intFLAG_RUN_RTL
          与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 具有从右到左的排列方向。
 
构造方法摘要
GlyphVector()
           
 
方法摘要
abstract  booleanequals(GlyphVector set)
          测试指定的 GlyphVector 是否恰好等于此 GlyphVector
abstract  FontgetFont()
          返回与此 GlyphVector 关联的 Font
abstract  FontRenderContextgetFontRenderContext()
          返回与此 GlyphVector 关联的 FontRenderContext
 intgetGlyphCharIndex(int glyphIndex)
          返回指定字形的字符索引。
 int[]getGlyphCharIndices(int beginGlyphIndex, int numEntries, int[] codeReturn)
          返回指定字形的字符索引。
abstract  intgetGlyphCode(int glyphIndex)
          返回指定字形的 glyphcode。
abstract  int[]getGlyphCodes(int beginGlyphIndex, int numEntries, int[] codeReturn)
          返回指定字形的 glyphcode 数组。
abstract  GlyphJustificationInfogetGlyphJustificationInfo(int glyphIndex)
          返回此 GlyphVector 中指定索引处的字形调整信息。
abstract  ShapegetGlyphLogicalBounds(int glyphIndex)
          返回此 GlyphVector 中指定字形的逻辑边界。
abstract  GlyphMetricsgetGlyphMetrics(int glyphIndex)
          返回此 GlyphVector 中指定索引处的字形规格。
abstract  ShapegetGlyphOutline(int glyphIndex)
          返回其内部区域与此 GlyphVector 中指定字形的可视表示形式对应的 Shape
 ShapegetGlyphOutline(int glyphIndex, float x, float y)
          返回一个 Shape,其内部区域与此 GlyphVector 中指定字形的可视表示形式对应,并偏移到 x、y。
 RectanglegetGlyphPixelBounds(int index, FontRenderContext renderFRC, float x, float y)
          返回当此 GlyphVectorGraphics 中以指定 FontRenderContext 在给定位置呈现时 index 处字形的像素边界。
abstract  Point2DgetGlyphPosition(int glyphIndex)
          返回与此 GlyphVector 原点对应的指定字形的位置。
abstract  float[]getGlyphPositions(int beginGlyphIndex, int numEntries, float[] positionReturn)
          返回包含指定字形位置的数组。
abstract  AffineTransformgetGlyphTransform(int glyphIndex)
          返回此 GlyphVector 中指定字形的转换。
abstract  ShapegetGlyphVisualBounds(int glyphIndex)
          返回 GlyphVector 中指定字形的可视边界。
 intgetLayoutFlags()
          返回描述该 GlyphVector 全局状态的标志。
abstract  Rectangle2DgetLogicalBounds()
          返回此 GlyphVector 的逻辑边界。
abstract  intgetNumGlyphs()
          返回此 GlyphVector 中的字形数。
abstract  ShapegetOutline()
          返回其内部区域与此 GlyphVector 的可视表示形式对应的 Shape
abstract  ShapegetOutline(float x, float y)
          返回在 x、y 处呈现时,其内部区域与此 GlyphVector 的可视表示形式对应的 Shape
 RectanglegetPixelBounds(FontRenderContext renderFRC, float x, float y)
          返回此 GlyphVector 在图形中以给定 FontRenderContext 在给定位置处呈现时的像素边界。
abstract  Rectangle2DgetVisualBounds()
          返回此 GlyphVector 的可视边界,可视边界是此 GlyphVector 轮廓的边界框。
abstract  voidperformDefaultLayout()
          为此 GlyphVector 中的每个字形分配默认位置。
abstract  voidsetGlyphPosition(int glyphIndex, Point2D newPos)
          设置此 GlyphVector 中的指定字形位置。
abstract  voidsetGlyphTransform(int glyphIndex, AffineTransform newTX)
          设置此 GlyphVector 中指定字形的转换。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

FLAG_HAS_TRANSFORMS

public static final int FLAG_HAS_TRANSFORMS
与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 的每个字形都有转换。

从以下版本开始:
1.4
另请参见:
常量字段值

FLAG_HAS_POSITION_ADJUSTMENTS

public static final int FLAG_HAS_POSITION_ADJUSTMENTS
与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 调整了位置。该标志为 true 时,字形位置与该字形累加的默认 advance 不匹配(例如,已完成字距调整)。

从以下版本开始:
1.4
另请参见:
常量字段值

FLAG_RUN_RTL

public static final int FLAG_RUN_RTL
与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 具有从右到左的排列方向。这是指字形到字符的映射关系,并不意味着该字形的可视位置一定要按此顺序,但通常如此。

从以下版本开始:
1.4
另请参见:
常量字段值

FLAG_COMPLEX_GLYPHS

public static final int FLAG_COMPLEX_GLYPHS
与 getLayoutFlags 一起使用的标志,指示此 GlyphVector 具有从字形到字符的复杂映射关系(此映射不是严格按照与排列方向匹配的升序或降序顺序将字形一一映射到字符)。

从以下版本开始:
1.4
另请参见:
常量字段值

FLAG_MASK

public static final int FLAG_MASK
getLayoutFlags 支持标志的掩码。只应测试该掩码包含的位。

从以下版本开始:
1.4
另请参见:
常量字段值
构造方法详细信息

GlyphVector

public GlyphVector()
方法详细信息

getFont

public abstract Font getFont()
返回与此 GlyphVector 关联的 Font

返回:
用于创建此 GlyphVectorFont
另请参见:
Font

getFontRenderContext

public abstract FontRenderContext getFontRenderContext()
返回与此 GlyphVector 关联的 FontRenderContext

返回:
用于创建此 GlyphVectorFontRenderContext
另请参见:
FontRenderContext, Font

performDefaultLayout

public abstract void performDefaultLayout()
为此 GlyphVector 中的每个字形分配默认位置。这会破坏此 GlyphVector 初始布局期间所生成的信息。