Package org.apache.fop.afp.fonts
Class DoubleByteFont
- java.lang.Object
-
- org.apache.fop.fonts.Typeface
-
- org.apache.fop.afp.fonts.AFPFont
-
- org.apache.fop.afp.fonts.AbstractOutlineFont
-
- org.apache.fop.afp.fonts.DoubleByteFont
-
- All Implemented Interfaces:
FontMetrics
public class DoubleByteFont extends AbstractOutlineFont
Implementation ofAbstractOutlineFont
that supports double-byte fonts (CID Keyed font (Type 0)). The width of characters that are not prescribed a width metrics in the font resource use a fallback width. The default width is 1 em. A character can be supplied and queried for the fallback width of all non-ideograph characters.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.Integer>
charsProcessed
private static java.util.Set<java.lang.Character.UnicodeBlock>
IDEOGRAPHIC
private static org.apache.commons.logging.Log
log
-
Fields inherited from class org.apache.fop.afp.fonts.AbstractOutlineFont
charSet
-
Fields inherited from class org.apache.fop.fonts.Typeface
eventListener, NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description DoubleByteFont(java.lang.String name, boolean embeddable, CharacterSet charSet, AFPEventProducer eventProducer)
Constructor for an double-byte outline font.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Rectangle
getBoundingBox(int character, int size)
Returns the bounding box of the glyph at the given index, for the given font size.private java.awt.Rectangle
getBoundingBoxOrNull(int character, int size)
private java.awt.Rectangle
getDefaultCharacterBox(int character, int size)
private int
getDefaultCharacterWidth(int character)
int
getWidth(int character, int size)
Return the width (in 1/1000ths of point size) of the character at code point i.private int
inferCharWidth(int character)
-
Methods inherited from class org.apache.fop.afp.fonts.AbstractOutlineFont
getAFPEventProducer, getAscender, getCapHeight, getCharacterSet, getCharacterSet, getDescender, getEncodingName, getUnderlinePosition, getUnderlineThickness, getXHeight, hasChar, mapChar
-
Methods inherited from class org.apache.fop.afp.fonts.AFPFont
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
-
-
-
-
Constructor Detail
-
DoubleByteFont
public DoubleByteFont(java.lang.String name, boolean embeddable, CharacterSet charSet, AFPEventProducer eventProducer)
Constructor for an double-byte outline font.- Parameters:
name
- the name of the fontembeddable
- whether or not this font is embeddablecharSet
- the character seteventProducer
- Handles any AFP related events
-
-
Method Detail
-
getWidth
public int getWidth(int character, int size)
Return the width (in 1/1000ths of point size) of the character at code point i.- Parameters:
character
- code point indexsize
- font size- Returns:
- the width of the character
-
getDefaultCharacterWidth
private int getDefaultCharacterWidth(int character)
-
getBoundingBox
public java.awt.Rectangle getBoundingBox(int character, int size)
Description copied from class:AFPFont
Returns the bounding box of the glyph at the given index, for the given font size.- Specified by:
getBoundingBox
in interfaceFontMetrics
- Specified by:
getBoundingBox
in classAFPFont
- Parameters:
character
- glyph indexsize
- font size- Returns:
- the scaled bounding box scaled in 1/1000ths of the given size
-
getBoundingBoxOrNull
private java.awt.Rectangle getBoundingBoxOrNull(int character, int size)
-
getDefaultCharacterBox
private java.awt.Rectangle getDefaultCharacterBox(int character, int size)
-
inferCharWidth
private int inferCharWidth(int character)
-
-