public class TtfFont extends Font
Represents TrueType Font (TTF).
Modifier and Type | Method and Description |
---|---|
Font |
convert(FontType fontType)
Converts the Font into another format.
|
GlyphId[] |
getAllGlyphIds()
Returns array of all glyph ids, available in the Font.
|
Font |
getCffFont()
Gets CFF Font if present.
|
IFontEncoding |
getEncoding()
Gets Font encoding.
|
FontDefinition |
getFontDefinition()
Gets Font definition.
|
String |
getFontFamily()
Gets Font family.
|
String |
getFontName()
Gets Font face name.
|
MultiLanguageString |
getFontNames()
Gets Font names.
|
int |
getFontStyle()
Gets Font style.
|
FontType |
getFontType()
Gets Font type.
|
Glyph |
getGlyphById(GlyphId id)
Returns glyph by glyph id.
|
Glyph |
getGlyphById(long id)
Returns glyph by glyph id.
|
Glyph |
getGlyphById(String glyphName)
Returns glyph by glyph name.
|
void |
getGlyphComponentsById(GlyphId id,
GlyphIdList componentsToPopulate)
Gets a glyph by glyph identifier passed and fills passed list of glyph identifiers with components
of this glyph.
|
void |
getGlyphComponentsById(long id,
GlyphIdList componentsToPopulate)
Gets a glyph by glyph index passed and fills passed list of glyph identifiers with components
of this glyph.
|
void |
getGlyphComponentsById(String glyphName,
GlyphIdList componentsToPopulate)
Gets a glyph by glyph name passed and fills passed list of glyph identifiers with components
of this glyph.
|
GlyphIdType |
getGlyphIdType()
Gets glyph id type specification.
|
GlyphId[] |
getGlyphsForText(String text)
Get glyphs representation for text.
|
IFontMetrics |
getMetrics()
Gets Font metrics.
|
int |
getNumGlyphs()
Gets number of glyphs in the Font.
|
MultiLanguageString |
getPostscriptNames()
Gets Postscript font names.
|
String |
getStyle()
Gets Font style.
|
TtfTableRepository |
getTtfTables()
Gets TTF tables.
|
boolean |
isSymbolic()
Returns true in case Font is symbolic.
|
void |
setFontFamily(String value)
Sets Font family.
|
void |
setFontName(String value)
Sets Font face name.
|
void |
setStyle(String value)
Sets Font style.
|
getFontSaver, getGlyphAccessor, open, open, open, open, save, save, saveToFormat
public TtfTableRepository getTtfTables()
Gets TTF tables.
public Font getCffFont()
Gets CFF Font if present.
public FontType getFontType()
Gets Font type. Returns FontType.TTF value.
getFontType
in interface IFont
getFontType
in class Font
public String getFontFamily()
Gets Font family.
getFontFamily
in interface IFont
getFontFamily
in class Font
public void setFontFamily(String value)
Sets Font family.
setFontFamily
in interface IFont
setFontFamily
in class Font
value
- New Font family.public String getStyle()
Gets Font style. This is a raw string value provided by Font file.
public void setStyle(String value)
Sets Font style. This is a raw string value provided by Font file.
public int getFontStyle()
Gets Font style. This is a value computed and represented in generalized type.
getFontStyle
in interface IFont
getFontStyle
in class Font
public String getFontName()
Gets Font face name.
getFontName
in interface IFont
getFontName
in class Font
public void setFontName(String value)
Sets Font face name.
setFontName
in interface IFont
setFontName
in class Font
value
- New Font face name.public MultiLanguageString getFontNames()
Gets Font names.
getFontNames
in interface IFont
getFontNames
in class Font
public MultiLanguageString getPostscriptNames()
Gets Postscript font names.
getPostscriptNames
in interface IFont
getPostscriptNames
in class Font
public int getNumGlyphs()
Gets number of glyphs in the Font.
getNumGlyphs
in interface IFont
getNumGlyphs
in class Font
public boolean isSymbolic()
Returns true in case Font is symbolic.
public IFontMetrics getMetrics()
Gets Font metrics.
getMetrics
in interface IFont
getMetrics
in class Font
public IFontEncoding getEncoding()
Gets Font encoding.
getEncoding
in interface IFont
getEncoding
in class Font
public GlyphIdType getGlyphIdType()
Gets glyph id type specification.
getGlyphIdType
in interface IGlyphAccessor
getGlyphIdType
in class Font
public FontDefinition getFontDefinition()
Gets Font definition.
getFontDefinition
in interface IFont
getFontDefinition
in class Font
public Glyph getGlyphById(GlyphId id)
Returns glyph by glyph id.
Glyph id is a unique number for a glyph, which is font type dependent.
TTF Font glyph id can be instance of (GlyphStringId
) class or (GlyphUInt32Id
) class.
Name (string) glyph addressing is supported for TTF Fonts via Post table mapping.
In case CFF Font inside, the CFF structures are used to address glyphs by name.
getGlyphById
in interface IGlyphAccessor
getGlyphById
in class Font
id
- Glyph id.public Glyph getGlyphById(String glyphName)
Returns glyph by glyph name. Name (string) glyph addressing is supported for TTF fonts via Post table mapping. In case CFF Font inside, the CFF structures are used to address glyphs by name.
glyphName
- Glyph string identifier.public Glyph getGlyphById(long id)
Returns glyph by glyph id.
id
- Glyph index.public GlyphId[] getAllGlyphIds()
Returns array of all glyph ids, available in the Font.
Glyph id is a unique number for a glyph, which is font type dependent.
TTF Font glyph id can be instance of (GlyphStringId
) class or (GlyphUInt32Id
) class.
Name (string) glyph addressing is supported for TTF Fonts via Post table mapping.
In case CFF Font inside, the CFF structures are used to address glyphs by name.
getAllGlyphIds
in interface IGlyphAccessor
getAllGlyphIds
in class Font
public void getGlyphComponentsById(GlyphId id, GlyphIdList componentsToPopulate)
Gets a glyph by glyph identifier passed and fills passed list of glyph identifiers with components
of this glyph.
Glyph id is a unique number for a glyph, which is font type dependent.
TTF Font glyph id can be instance of (GlyphStringId
) class or (GlyphUInt32Id
) class.
Name (string) glyph addressing is supported for TTF Fonts via Post table mapping.
In case CFF Font inside, the CFF structures are used to address glyphs by name.
id
- Glyph id.componentsToPopulate
- List of glyph identifiers to fill.public void getGlyphComponentsById(String glyphName, GlyphIdList componentsToPopulate)
Gets a glyph by glyph name passed and fills passed list of glyph identifiers with components of this glyph.
glyphName
- Glyph name.componentsToPopulate
- List of glyph identifiers to fill.public void getGlyphComponentsById(long id, GlyphIdList componentsToPopulate)
Gets a glyph by glyph index passed and fills passed list of glyph identifiers with components of this glyph.
id
- Glyph index.componentsToPopulate
- List of glyph identifiers to fill.public GlyphId[] getGlyphsForText(String text)
Get glyphs representation for text.
getGlyphsForText
in interface IGlyphAccessor
getGlyphsForText
in class Font
text
- Input text.