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.
|
Font |
convert(FontType fontType,
Collection<Integer> limitingCharacterSet)
Converts the Font into another format with limiting character set
Note: TTF Font type is now supported only.
|
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, saveToFormatpublic 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 IFontgetFontType in class Fontpublic String getFontFamily()
Gets Font family.
getFontFamily in interface IFontgetFontFamily in class Fontpublic void setFontFamily(String value)
Sets Font family.
setFontFamily in interface IFontsetFontFamily in class Fontvalue - 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 IFontgetFontStyle in class Fontpublic String getFontName()
Gets Font face name.
getFontName in interface IFontgetFontName in class Fontpublic void setFontName(String value)
Sets Font face name.
setFontName in interface IFontsetFontName in class Fontvalue - New Font face name.public MultiLanguageString getFontNames()
Gets Font names.
getFontNames in interface IFontgetFontNames in class Fontpublic MultiLanguageString getPostscriptNames()
Gets Postscript font names.
getPostscriptNames in interface IFontgetPostscriptNames in class Fontpublic int getNumGlyphs()
Gets number of glyphs in the Font.
getNumGlyphs in interface IFontgetNumGlyphs in class Fontpublic boolean isSymbolic()
Returns true in case Font is symbolic.
public IFontMetrics getMetrics()
Gets Font metrics.
getMetrics in interface IFontgetMetrics in class Fontpublic IFontEncoding getEncoding()
Gets Font encoding.
getEncoding in interface IFontgetEncoding in class Fontpublic GlyphIdType getGlyphIdType()
Gets glyph id type specification.
getGlyphIdType in interface IGlyphAccessorgetGlyphIdType in class Fontpublic FontDefinition getFontDefinition()
Gets Font definition.
getFontDefinition in interface IFontgetFontDefinition in class Fontpublic 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 IGlyphAccessorgetGlyphById in class Fontid - 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 IGlyphAccessorgetAllGlyphIds in class Fontpublic 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 IGlyphAccessorgetGlyphsForText in class Fonttext - Input text.public Font convert(FontType fontType)
Converts the Font into another format. Note: TTF Font type is now supported only.
public Font convert(FontType fontType, Collection<Integer> limitingCharacterSet)
Converts the Font into another format with limiting character set Note: TTF Font type is now supported only.
fontType - Font format type to convert into.limitingCharacterSet - Limiting character set.Copyright © 2025 Aspose. All Rights Reserved.