Constructor

The TGGlyphRun constructor creates a glyph run from a font descriptor, the number of glyphs, a list of glyph codes, offset values, an origin, and indicate how the glyph run is attached to the origin (horizontal or vertical).

      TGGlyphRun( const TFont& font, 
                  unsigned long numberOfGlyphs, 
                  const GlyphCode glyphs[],
                  const GCoordinate xOffsets[], 
                  const GCoordinate yOffsets[] = NIL,
                  const TGPoint& origin = TGPoint::kOrigin,
                  TGGlyphRun::EAttachment attachment = TGGlyphRun::kHorizontal )

Font styles

The
font style is defined by an instance of TFont. TFont is a font class that provides style set information that represents the locale, typeface, font style, and point size. If TFont describes a font that is not available, the system font is used instead.

The locale is information such as formatting, country identifier, collating rules for a native language, and styling information that is specific to a particular region.

Glyph codes

The glyph code is an array of numbers (or codes) that are indices into the font to select the appropriate glyphs for that font. Along with the array of glyph codes, the TGlyphRun constructor takes an unsigned long numberOfGlyphs parameter that represents the number of glyphs in the text string.

Origin

The origin represents the point in x-y coordinates where the glyph run starts.

Offset

The individual glyphs are positioned by an x and y array of GCoordinate values that represent the locations of each glyph offset from the point of origin.

Attachment

The x offset represents the baseline axis. As shown in Figure 32, each glyph is positioned at its offset location so that the glyph sits correctly on the baseline regardless of how far above or below the line it goes.


The y offset represents perpendicular offsets for superscripting or subscripting individual glyphs as shown in Figure 33.


A glyph run can be attached to the origin horizontally or vertically (TGlyphRun::kHorizontal or TGGlyphRun::kVertical). When text is attached horizontally, the baseline corresponds to the x-axis.

The value kHorizontal is the default attachment. If you want vertical text like that shown in Figure 34, use kVertical to make the baseline run in the direction of the y-axis. In this case, the individual glyphs are attached to the baseline from a point at the bottom of each character.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker