Class TrueTypeFontRecord
java.lang.Object
org.pentaho.reporting.libraries.fonts.truetype.TrueTypeFontRecord
- All Implemented Interfaces:
Serializable
,FontRecord
,FontSource
A true-type font record. The record contains meta-information about the font, which allows the system to lookup the
font by one of its names and other style attributes.
A font without a 'name' table is rejected. The Name-Table is a mandatory table in the OpenType standard, and only
weird MacOS fonts omit that table.
Missing 'head' or 'OS/2' tables are ignored and default values are assumed instead.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns the family for this record.Returns the file name used to load the font.This identifies the font resource assigned to this record.long
int
hashCode()
boolean
isBold()
Returns true, if this font corresponds to a bold version of the font.boolean
boolean
isItalic()
Returns true, if this font includes italic glyphs.boolean
boolean
Returns tue, if this font's italic mode is in fact some sort of being oblique.
-
Constructor Details
-
TrueTypeFontRecord
public TrueTypeFontRecord(TrueTypeFont trueTypeFont, FontFamily family) throws IOException, FontException - Throws:
IOException
FontException
-
-
Method Details
-
getOffset
public long getOffset() -
getFamily
Description copied from interface:FontRecord
Returns the family for this record.- Specified by:
getFamily
in interfaceFontRecord
- Returns:
- the font family.
-
isEmbeddable
public boolean isEmbeddable()- Specified by:
isEmbeddable
in interfaceFontSource
-
isBold
public boolean isBold()Description copied from interface:FontRecord
Returns true, if this font corresponds to a bold version of the font. A font-renderer that renders a font that does not provide a bold face must emulate the boldness using other means. The font should *not* lie here and say 'true', if it does not contain bold glyphs, as this will make it impossible to differentiate between native bold fonts and fonts for which the renderer will have to provide boldness.- Specified by:
isBold
in interfaceFontRecord
- Returns:
- true, if the font provides bold glyphs, false otherwise.
-
isItalic
public boolean isItalic()Description copied from interface:FontRecord
Returns true, if this font includes italic glyphs. Italics is different from oblique, as certain glyphs (most notably the lowercase 'f') will have a different appearance, making the font look more like a script font. A font-renderer that renders a font that does not provide an italic face must emulate the italics using other means. The font should *not* lie here and say 'true', if it does not contain italic glyphs, as this will make it impossible to differentiate between native italics fonts and fonts for which the renderer will have to provide the italics style.- Specified by:
isItalic
in interfaceFontRecord
- Returns:
- true, if the font is italic.
-
isOblique
public boolean isOblique()Description copied from interface:FontRecord
Returns tue, if this font's italic mode is in fact some sort of being oblique. An oblique font's glyphs are sheared, but they are not made to look more script like. A font-renderer that renders a font that does not provide a oblique face must emulate the oblique-mode using other means. The font should *not* lie here and say 'true', if it does not contain oblique glyphs, as this will make it impossible to differentiate between native oblique fonts and fonts for which the renderer will have to provide the oblique style.- Specified by:
isOblique
in interfaceFontRecord
- Returns:
- true, if the font is oblique. All italic fonts are also oblique.
-
getFontSource
Description copied from interface:FontSource
Returns the file name used to load the font. This method exists only for iText.- Specified by:
getFontSource
in interfaceFontSource
- Returns:
- this is needed for iText.
-
getCollectionIndex
public int getCollectionIndex() -
equals
-
getIdentifier
This identifies the font resource assigned to this record.- Specified by:
getIdentifier
in interfaceFontRecord
- Returns:
-
isNonWindows
public boolean isNonWindows() -
hashCode
public int hashCode()
-