Package org.docx4j.fonts.fop.fonts
Class MultiByteFont
java.lang.Object
org.docx4j.fonts.fop.fonts.Typeface
org.docx4j.fonts.fop.fonts.CustomFont
org.docx4j.fonts.fop.fonts.CIDFont
org.docx4j.fonts.fop.fonts.MultiByteFont
- All Implemented Interfaces:
FontDescriptor,FontMetrics,MutableFont
public class MultiByteFont extends CIDFont
Generic MultiByte (CID) font
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MultiByteFont()Default constructor -
Method Summary
Modifier and Type Method Description char[]getCharsUsed()CIDSubsetgetCIDSubset()Returns the subset information for this font.CIDFontTypegetCIDType()Returns the type of the CID font.intgetDefaultWidth()Returns the default width for this font.java.lang.StringgetEmbedFontName()Returns the font name for font embedding (may include a prefix, Example: "1E28bcArialMT").java.lang.StringgetEncodingName()Get the encoding of the font.java.lang.StringgetOrdering()Returns a font name for use within a registry.java.lang.StringgetRegistry()Returns the name of the issuer of the font.intgetSupplement()Returns the supplement number of the character collection.java.lang.StringgetTTCName()Returns the TrueType Collection Name.java.util.MapgetUsedGlyphs()Returns a Map of used Glyphs.intgetWidth(int i, int size)Return the width (in 1/1000ths of point size) of the character at code point i.int[]getWidths()Return the array of widths.booleanhasChar(char c)Determines whether this font contains a particular character/glyph.charmapChar(char c)Map a Unicode character to a code point in the font.voidsetBFEntries(BFEntry[] entries)Sets the array of BFEntry instances which constitutes the Unicode to glyph index map for a font.voidsetCIDType(CIDFontType cidType)Sets the CIDType.voidsetDefaultWidth(int defaultWidth)Sets the defaultWidth.voidsetTTCName(java.lang.String ttcName)Sets the the TrueType Collection Name.voidsetWidthArray(int[] wds)Sets the width array.Methods inherited from class org.docx4j.fonts.fop.fonts.CustomFont
getAscender, getAscender, getCapHeight, getCapHeight, getDescender, getDescender, getEmbedFileName, getEmbedFileSource, getEmbedResourceName, getFamilyNames, getFirstChar, getFlags, getFontBBox, getFontName, getFontSubName, getFontType, getFullName, getItalicAngle, getKerningInfo, getLastChar, getMissingWidth, getPanose, getStemV, getStrippedFontName, getWeight, getXHeight, hasKerningInfo, isEmbeddable, isKerningEnabled, isSymbolicFont, putKerningEntry, replaceKerningMap, setAscender, setCapHeight, setDescender, setEmbeddable, setEmbedFileName, setEmbedResourceName, setFamilyNames, setFirstChar, setFlags, setFontBBox, setFontName, setFontSubFamilyName, setFontType, setFullName, setItalicAngle, setKerningEnabled, setLastChar, setMissingWidth, setPanose, setResolver, setStemV, setWeight, setXHeightMethods inherited from class org.docx4j.fonts.fop.fonts.Typeface
getMaxAscent, hadMappingOperations, notifyMapOperation, setEventListener, toString, warnMissingGlyph
-
Constructor Details
-
MultiByteFont
public MultiByteFont()Default constructor
-
-
Method Details
-
getDefaultWidth
public int getDefaultWidth()Returns the default width for this font.- Overrides:
getDefaultWidthin classCIDFont- Returns:
- the default width
-
getRegistry
public java.lang.String getRegistry()Returns the name of the issuer of the font.- Specified by:
getRegistryin classCIDFont- Returns:
- a String identifying an issuer of character collections - for example, Adobe
-
getOrdering
public java.lang.String getOrdering()Returns a font name for use within a registry.- Specified by:
getOrderingin classCIDFont- Returns:
- a String that uniquely names a character collection issued by a specific registry - for example, Japan1.
-
getSupplement
public int getSupplement()Returns the supplement number of the character collection.- Specified by:
getSupplementin classCIDFont- Returns:
- the supplement number
-
getCIDType
Returns the type of the CID font.- Specified by:
getCIDTypein classCIDFont- Returns:
- the type of the CID font
-
setCIDType
Sets the CIDType.- Parameters:
cidType- The cidType to set
-
getEmbedFontName
public java.lang.String getEmbedFontName()Returns the font name for font embedding (may include a prefix, Example: "1E28bcArialMT").- Specified by:
getEmbedFontNamein interfaceFontMetrics- Overrides:
getEmbedFontNamein classCustomFont- Returns:
- the name for font embedding
-
getCIDSubset
Returns the subset information for this font.- Specified by:
getCIDSubsetin classCIDFont- Returns:
- the subset information
-
getEncodingName
public java.lang.String getEncodingName()Get the encoding of the font.- Specified by:
getEncodingNamein classTypeface- Returns:
- the encoding
-
getWidth
public int getWidth(int i, int size)Return the width (in 1/1000ths of point size) of the character at code point i.- Parameters:
i- code point indexsize- font size- Returns:
- the width of the character
-
getWidths
public int[] getWidths()Return the array of widths.This is used to get an array for inserting in an output format. It should not be used for lookup.
- Returns:
- an array of widths
-
mapChar
public char mapChar(char c)Map a Unicode character to a code point in the font. -
hasChar
public boolean hasChar(char c)Determines whether this font contains a particular character/glyph. -
setBFEntries
Sets the array of BFEntry instances which constitutes the Unicode to glyph index map for a font. ("BF" means "base font")- Parameters:
entries- the Unicode to glyph index map
-
setDefaultWidth
public void setDefaultWidth(int defaultWidth)Sets the defaultWidth.- Parameters:
defaultWidth- The defaultWidth to set
-
getTTCName
public java.lang.String getTTCName()Returns the TrueType Collection Name.- Returns:
- the TrueType Collection Name
-
setTTCName
public void setTTCName(java.lang.String ttcName)Sets the the TrueType Collection Name.- Parameters:
ttcName- the TrueType Collection Name
-
setWidthArray
public void setWidthArray(int[] wds)Sets the width array.- Parameters:
wds- array of widths.
-
getUsedGlyphs
public java.util.Map getUsedGlyphs()Returns a Map of used Glyphs.- Returns:
- Map Map of used Glyphs
-
getCharsUsed
public char[] getCharsUsed()
-