public class MultiByteFont extends CIDFont implements Substitutable, Positionable
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Rectangle[] |
boundingBoxes
Contains the character bounding boxes for all characters in the font
|
protected CIDSet |
cidSet |
additionalEncodings, cmap, svgs, unencodedCharacterseventListener, NOT_FOUND| Constructor and Description |
|---|
MultiByteFont(InternalResourceResolver resourceResolver,
EmbeddingMode embeddingMode)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPrivateUseMapping(int pu,
int gi)
Add a private use mapping {PU,GI} to the existing character map.
|
GlyphSequence |
charSequenceToGlyphSequence(java.lang.CharSequence charSequence,
java.util.List associations) |
int |
findGlyphIndex(int c)
Returns the glyph index for a Unicode character.
|
java.awt.Rectangle |
getBoundingBox(int glyphIndex,
int size)
Returns the bounding box of the glyph at the given index, for the given font size.
|
protected char[] |
getChars() |
CIDSet |
getCIDSet()
Returns the subset information for this font.
|
CIDFontType |
getCIDType()
Returns the type of the CID font.
|
java.io.InputStream |
getCmapStream() |
int |
getDefaultWidth()
Returns the default width for this font.
|
java.lang.String |
getEmbedFontName()
Returns the font name for font embedding (may include a prefix, Example: "1E28bcArialMT").
|
java.lang.String |
getEncodingName()
Get the encoding of the font.
|
GlyphDefinitionTable |
getGDEF()
Obtain glyph definition table.
|
int |
getGIDFromChar(char ch)
Gets the original glyph index in the font from a character.
|
protected java.util.BitSet |
getGlyphIndices() |
GlyphPositioningTable |
getGPOS()
Obtain glyph positioning table.
|
GlyphSubstitutionTable |
getGSUB()
Obtain glyph substitution table.
|
java.lang.String |
getOrdering()
Returns a font name for use within a registry.
|
java.lang.String |
getRegistry()
Returns the name of the issuer of the font.
|
int |
getSupplement()
Returns the supplement number of the character collection.
|
SVGGlyphData |
getSVG(int c) |
java.lang.String |
getTTCName()
Returns the TrueType Collection Name.
|
char |
getUnicodeFromGID(int glyphIndex)
Returns the character from it's original glyph index in the font
|
protected int[] |
getUnscaledWidths(GlyphSequence gs) |
java.util.LinkedHashMap<java.lang.Integer,java.lang.String> |
getUsedGlyphNames() |
java.util.Map<java.lang.Integer,java.lang.Integer> |
getUsedGlyphs()
Returns a Map of used Glyphs.
|
int |
getWidth(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.
|
java.util.Map<java.lang.Integer,java.lang.Integer> |
getWidthsMap() |
boolean |
hasChar(char c)
Determines whether this font contains a particular character/glyph.
|
boolean |
hasCodePoint(int cp)
Determines whether this font contains a particular code point/glyph.
|
boolean |
hasFeature(int tableType,
java.lang.String script,
java.lang.String language,
java.lang.String feature)
Determine if metrics supports specific feature in specified font table.
|
boolean |
isEmbeddable()
Indicates if this font may be embedded.
|
boolean |
isOTFFile() |
boolean |
isSubsetEmbedded()
Indicates whether this font is subset embedded.
|
char |
mapChar(char c)
Map a Unicode character to a code point in the font.
|
int |
mapCodePoint(int cp)
Map a Unicode code point to a code point in the font.
|
void |
mapUsedGlyphName(int gid,
java.lang.String value) |
int[][] |
performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language)
Perform glyph positioning using an implied font size.
|
int[][] |
performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language,
int fontSize)
Perform glyph positioning.
|
boolean |
performsPositioning()
Determines if font performs glyph positioning.
|
boolean |
performsSubstitution()
Determines if font performs glyph substitution.
|
java.lang.CharSequence |
performSubstitution(java.lang.CharSequence charSequence,
java.lang.String script,
java.lang.String language,
java.util.List associations,
boolean retainControls)
Perform substitutions on characters to effect glyph substitution.
|
java.lang.CharSequence |
reorderCombiningMarks(java.lang.CharSequence cs,
int[][] gpa,
java.lang.String script,
java.lang.String language,
java.util.List associations)
Reorder combining marks in character sequence so that they precede (within the sequence) the base
character to which they are applied.
|
void |
setBBoxArray(java.awt.Rectangle[] boundingBoxes)
Sets the bounding boxes array.
|
void |
setCIDType(CIDFontType cidType)
Sets the CIDType.
|
void |
setDefaultWidth(int defaultWidth)
Sets the defaultWidth.
|
void |
setGDEF(GlyphDefinitionTable gdef)
Establishes the glyph definition table.
|
void |
setGPOS(GlyphPositioningTable gpos)
Establishes the glyph positioning table.
|
void |
setGSUB(GlyphSubstitutionTable gsub)
Establishes the glyph substitution table.
|
void |
setIsOTFFile(boolean isOTFFile) |
void |
setTTCName(java.lang.String ttcName)
Sets the the TrueType Collection Name.
|
void |
setWidthArray(int[] wds)
Sets the width array.
|
isMultiByteaddUnencodedCharacter, getAdditionalEncoding, getAdditionalEncodingCount, getAscender, getAscender, getCapHeight, getCapHeight, getCMap, getDescender, getDescender, getEmbeddingMode, getEmbedFileURI, getEmbedResourceName, getFamilyNames, getFirstChar, getFlags, getFontBBox, getFontName, getFontSubName, getFontType, getFontURI, getFullName, getInputStream, getItalicAngle, getKerningInfo, getLastChar, getMissingWidth, getSimulateStyle, getStemV, getStrikeoutPosition, getStrikeoutThickness, getStrippedFontName, getUnderlinePosition, getUnderlineThickness, getWeight, getXHeight, hasAdditionalEncodings, hasKerningInfo, hasSVG, isAdvancedEnabled, isKerningEnabled, isSymbolicFont, mapUnencodedChar, putKerningEntry, replaceKerningMap, setAdvancedEnabled, setAscender, setCapHeight, setCMap, setDescender, setEmbeddingMode, setEmbedResourceName, setEmbedURI, setFamilyNames, setFirstChar, setFlags, setFontBBox, setFontName, setFontSubFamilyName, setFontType, setFontURI, setFullName, setItalicAngle, setKerningEnabled, setLastChar, setMissingWidth, setSimulateStyle, setStemV, setStrikeoutPosition, setStrikeoutThickness, setSVG, setUnderlinePosition, setUnderlineThickness, setWeight, setXHeightgetMaxAscent, hadMappingOperations, isCID, notifyMapOperation, setEventListener, toString, warnMissingGlyphclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetMaxAscentprotected final CIDSet cidSet
protected java.awt.Rectangle[] boundingBoxes
public MultiByteFont(InternalResourceResolver resourceResolver, EmbeddingMode embeddingMode)
public int getDefaultWidth()
getDefaultWidth in class CIDFontpublic java.lang.String getRegistry()
getRegistry in class CIDFontpublic java.lang.String getOrdering()
getOrdering in class CIDFontpublic int getSupplement()
getSupplement in class CIDFontpublic CIDFontType getCIDType()
getCIDType in class CIDFontpublic void setIsOTFFile(boolean isOTFFile)
public boolean isOTFFile()
public void setCIDType(CIDFontType cidType)
cidType - The cidType to setpublic java.lang.String getEmbedFontName()
getEmbedFontName in interface FontMetricsgetEmbedFontName in class CustomFontpublic boolean isEmbeddable()
isEmbeddable in interface FontDescriptorpublic boolean isSubsetEmbedded()
FontDescriptorisSubsetEmbedded in interface FontDescriptorpublic CIDSet getCIDSet()
public void mapUsedGlyphName(int gid,
java.lang.String value)
public java.util.LinkedHashMap<java.lang.Integer,java.lang.String> getUsedGlyphNames()
public java.lang.String getEncodingName()
getEncodingName in class Typefacepublic int getWidth(int i,
int size)
getWidth in interface FontMetricsi - code point indexsize - font sizepublic int[] getWidths()
This is used to get an array for inserting in an output format. It should not be used for lookup.
getWidths in interface FontMetricspublic java.awt.Rectangle getBoundingBox(int glyphIndex,
int size)
FontMetricsgetBoundingBox in interface FontMetricsglyphIndex - glyph indexsize - font sizepublic int findGlyphIndex(int c)
c - the Unicode character indexprotected void addPrivateUseMapping(int pu,
int gi)
protected java.util.BitSet getGlyphIndices()
protected char[] getChars()
public char mapChar(char c)
public int mapCodePoint(int cp)
mapCodePoint in class CIDFontcp - code point to mappublic boolean hasChar(char c)
public boolean hasCodePoint(int cp)
hasCodePoint in class CIDFontcp - character to checkpublic void setDefaultWidth(int defaultWidth)
defaultWidth - The defaultWidth to setpublic java.lang.String getTTCName()
public void setTTCName(java.lang.String ttcName)
ttcName - the TrueType Collection Namepublic void setWidthArray(int[] wds)
wds - array of widths.public void setBBoxArray(java.awt.Rectangle[] boundingBoxes)
boundingBoxes - array of bounding boxes.public java.util.Map<java.lang.Integer,java.lang.Integer> getUsedGlyphs()
getUsedGlyphs in class CustomFontpublic char getUnicodeFromGID(int glyphIndex)
getUnicodeFromGID in class CustomFontglyphIndex - The original index of the characterpublic int getGIDFromChar(char ch)
ch - The characterpublic void setGDEF(GlyphDefinitionTable gdef)
gdef - the glyph definition table to be used by this fontpublic GlyphDefinitionTable getGDEF()
public void setGSUB(GlyphSubstitutionTable gsub)
gsub - the glyph substitution table to be used by this fontpublic GlyphSubstitutionTable getGSUB()
public void setGPOS(GlyphPositioningTable gpos)
gpos - the glyph positioning table to be used by this fontpublic GlyphPositioningTable getGPOS()
public boolean performsSubstitution()
performsSubstitution in interface Substitutablepublic java.lang.CharSequence performSubstitution(java.lang.CharSequence charSequence,
java.lang.String script,
java.lang.String language,
java.util.List associations,
boolean retainControls)
performSubstitution in interface SubstitutablecharSequence - character sequence to map to output font encoding character sequencescript - a script identifierlanguage - a language identifierassociations - optional list to receive list of character associationsretainControls - if true, then retain control characters and their glyph mappings, otherwise removepublic GlyphSequence charSequenceToGlyphSequence(java.lang.CharSequence charSequence, java.util.List associations)
public java.lang.CharSequence reorderCombiningMarks(java.lang.CharSequence cs,
int[][] gpa,
java.lang.String script,
java.lang.String language,
java.util.List associations)
reorderCombiningMarks in interface Substitutablecs - character sequence within which combining marks to be reorderedgpa - associated glyph position adjustments (also reordered)script - a script identifierlanguage - a language identifierassociations - optional list of associations to be reorderedprotected int[] getUnscaledWidths(GlyphSequence gs)
public boolean performsPositioning()
performsPositioning in interface Positionablepublic int[][] performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language,
int fontSize)
performPositioning in interface Positionablecs - character sequence to map to position offsets (advancement adjustments)script - a script identifierlanguage - a language identifierfontSize - font sizepublic int[][] performPositioning(java.lang.CharSequence cs,
java.lang.String script,
java.lang.String language)
performPositioning in interface Positionablecs - character sequence to map to position offsets (advancement adjustments)script - a script identifierlanguage - a language identifierpublic boolean hasFeature(int tableType,
java.lang.String script,
java.lang.String language,
java.lang.String feature)
TypefacehasFeature in interface FontMetricshasFeature in class TypefacetableType - type of table (GSUB, GPOS, ...), see GlyphTable.GLYPH_TABLE_TYPE_*script - to qualify feature lookuplanguage - to qualify feature lookupfeature - to testpublic java.util.Map<java.lang.Integer,java.lang.Integer> getWidthsMap()
public java.io.InputStream getCmapStream()
public SVGGlyphData getSVG(int c)
Copyright 1999-2022 The Apache Software Foundation. All Rights Reserved.