Package org.apache.fop.afp.fonts
Class AbstractOutlineFont
java.lang.Object
org.apache.fop.fonts.Typeface
org.apache.fop.afp.fonts.AFPFont
org.apache.fop.afp.fonts.AbstractOutlineFont
- All Implemented Interfaces:
FontMetrics
- Direct Known Subclasses:
DoubleByteFont
,OutlineFont
A font defined as a set of lines and curves as opposed to a bitmap font. An
outline font can be scaled to any size and otherwise transformed more easily
than a bitmap font, and with more attractive results.
-
Field Summary
Fields inherited from class org.apache.fop.fonts.Typeface
eventListener, NOT_FOUND
-
Constructor Summary
ConstructorDescriptionAbstractOutlineFont
(String name, boolean embeddable, CharacterSet charSet, AFPEventProducer eventProducer) Constructor for an outline font. -
Method Summary
Modifier and TypeMethodDescriptionint
getAscender
(int size) The ascender is the part of a lowercase letter that extends above the "x-height" (the height of the letter "x"), such as "d", "t", or "h".int
getCapHeight
(int size) Obtains the height of capital letters for the specified point size.Get the character set metrics.getCharacterSet
(int size) Get the character set metrics.int
getDescender
(int size) The descender is the part of a lowercase letter that extends below the base line, such as "g", "j", or "p".Get the encoding of the font.int
getUnderlinePosition
(int size) Returns the distance from the baseline to the center of the underline (negative value indicates below baseline).int
getUnderlineThickness
(int size) Returns the thickness of the underline.int
getXHeight
(int size) The "x-height" (the height of the letter "x").boolean
hasChar
(char c) Determines whether this font contains a particular character/glyph.char
mapChar
(char c) Map a Unicode character to a code point in the font.Methods inherited from class org.apache.fop.afp.fonts.AFPFont
getBoundingBox, getEmbedFontName, getFamilyNames, getFontName, getFontType, getFontURI, getFullName, getKerningInfo, getStrikeoutPosition, getStrikeoutThickness, getWidths, hasKerningInfo, isEmbeddable, toString, toUnicodeCodepoint
Methods inherited from class org.apache.fop.fonts.Typeface
getMaxAscent, hadMappingOperations, hasFeature, isCID, isMultiByte, notifyMapOperation, setEventListener, warnMissingGlyph
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.fop.fonts.FontMetrics
getWidth
-
Field Details
-
charSet
The character set for this font
-
-
Constructor Details
-
AbstractOutlineFont
public AbstractOutlineFont(String name, boolean embeddable, CharacterSet charSet, AFPEventProducer eventProducer) Constructor for an outline font.- Parameters:
name
- the name of the fontembeddable
- sets whether or not this font is to be embeddedcharSet
- the chracter seteventProducer
- The object to handle any events which occur from the object.
-
-
Method Details
-
getCharacterSet
Get the character set metrics.- Returns:
- the character set
-
getCharacterSet
Get the character set metrics.- Specified by:
getCharacterSet
in classAFPFont
- Parameters:
size
- ignored- Returns:
- the character set
-
getAscender
public int getAscender(int size) The ascender is the part of a lowercase letter that extends above the "x-height" (the height of the letter "x"), such as "d", "t", or "h". Also used to denote the part of the letter extending above the x-height.- Parameters:
size
- the font size (in mpt)- Returns:
- the ascender for the given size
-
getUnderlinePosition
public int getUnderlinePosition(int size) Returns the distance from the baseline to the center of the underline (negative value indicates below baseline).- Parameters:
size
- font size- Returns:
- the position in 1/1000ths of the font size
-
getUnderlineThickness
public int getUnderlineThickness(int size) Description copied from class:AFPFont
Returns the thickness of the underline.- Specified by:
getUnderlineThickness
in interfaceFontMetrics
- Overrides:
getUnderlineThickness
in classAFPFont
- Parameters:
size
- font size- Returns:
- the thickness in 1/1000ths of the font size
-
getCapHeight
public int getCapHeight(int size) Obtains the height of capital letters for the specified point size.- Parameters:
size
- the font size (in mpt)- Returns:
- the cap height for the given size
-
getDescender
public int getDescender(int size) The descender is the part of a lowercase letter that extends below the base line, such as "g", "j", or "p". Also used to denote the part of the letter extending below the base line.- Parameters:
size
- the font size (in mpt)- Returns:
- the descender for the given size
-
getXHeight
public int getXHeight(int size) The "x-height" (the height of the letter "x").- Parameters:
size
- the font size (in mpt)- Returns:
- the x height for the given size
-
hasChar
public boolean hasChar(char c) Determines whether this font contains a particular character/glyph. -
mapChar
public char mapChar(char c) Map a Unicode character to a code point in the font. -
getEncodingName
Get the encoding of the font.- Specified by:
getEncodingName
in classTypeface
- Returns:
- the encoding
-