BRACKET
private static final int BRACKET
CJK_ENCODING
(package private) static final String CJK_ENCODING
The encoding used in the PDF document for CJK fonts
CMap
private String CMap
The CMap name associated with this font
FIRST
private static final int FIRST
SERIAL
private static final int SERIAL
V1Y
private static final int V1Y
allCMaps
(package private) static Hashtable allCMaps
allFonts
(package private) static Hashtable allFonts
cidDirect
private boolean cidDirect
cjkEncodings
(package private) static Properties cjkEncodings
cjkFonts
(package private) static Properties cjkFonts
fontDesc
private HashMap fontDesc
fontName
private String fontName
The font name
propertiesLoaded
private static boolean propertiesLoaded
style
private String style
The style modifier
translationMap
private char[] translationMap
vertical
private boolean vertical
charExists
public boolean charExists(char c)
Checks if a character exists in this font.
- charExists in interface BaseFont
c
- the character to check
true
if the character has a glyph,
false
otherwise
convertToHCIDMetrics
(package private) static String convertToHCIDMetrics(keys[] ,
IntHashtable h)
createMetric
(package private) static IntHashtable createMetric(String s)
getBBox
private float getBBox(int idx)
getCharBBox
public int[] getCharBBox(char c)
Gets the smallest box enclosing the character contours. It will return
null
if the font has not the information or the character has no
contours, as in the case of the space, for example. Characters with no contours may
also return [0,0,0,0].
- getCharBBox in interface BaseFont
c
- the character to get the contour bounding box from
- an array of four floats with the bounding box in the format [llx,lly,urx,ury] or
null
getCidCode
public char getCidCode(char c)
Gets the CID code given an Unicode.
It has only meaning with CJK fonts.
- getCidCode in interface BaseFont
getDescNumber
private float getDescNumber(String name)
getFamilyFontName
public String[][] getFamilyFontName()
Gets the family name of the font. If it is a True Type font
each array element will have {Platform ID, Platform Encoding ID,
Language ID, font name}. The interpretation of this values can be
found in the Open Type specification, chapter 2, in the 'name' table.
For the other fonts the array has a single element with {"", "", "",
font name}.
- getFamilyFontName in interface BaseFont
- the family name of the font
getFontDescriptor
public float getFontDescriptor(int key,
float fontSize)
Gets the font parameter identified by key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
and ITALICANGLE
.
- getFontDescriptor in interface BaseFont
key
- the parameter to be extractedfontSize
- the font size in points
getFullFontName
public String[][] getFullFontName()
Gets the full name of the font. If it is a True Type font
each array element will have {Platform ID, Platform Encoding ID,
Language ID, font name}. The interpretation of this values can be
found in the Open Type specification, chapter 2, in the 'name' table.
For the other fonts the array has a single element with {"", "", "",
font name}.
- getFullFontName in interface BaseFont
- the full name of the font
getKerning
public int getKerning(char char1,
char char2)
Gets the kerning between two Unicode chars.
- getKerning in interface BaseFont
char1
- the first charchar2
- the second char
- the kerning to be applied in normalized 1000 units
getRawWidth
(package private) int getRawWidth(int c,
String name)
Gets the width from the font according to the Unicode char c
or the name
. If the name
is null it's a symbolic font.
- getRawWidth in interface BaseFont
c
- the unicode charname
- the glyph name
getUnicodeEquivalent
public char getUnicodeEquivalent(char c)
Gets the Unicode equivalent to a CID.
The (inexistent) CID is translated as '\n'.
It has only meaning with CJK fonts with Identity encoding.
- getUnicodeEquivalent in interface BaseFont
getWidth
public int getWidth(String text)
Gets the width of a String
in normalized 1000 units.
- getWidth in interface BaseFont
text
- the String
to get the witdth of
- the width in normalized 1000 units
hasKernPairs
public boolean hasKernPairs()
Checks if the font has any kerning pairs.
- hasKernPairs in interface BaseFont
isCJKFont
public static boolean isCJKFont(String fontName,
String enc)
Checks if its a valid CJK font.
fontName
- the font nameenc
- the encoding
loadProperties
private static void loadProperties()
readCMap
(package private) static char[] readCMap(String name)
readFontProperties
(package private) static HashMap readFontProperties(String name)
setCharAdvance
public boolean setCharAdvance(char c,
int advance)
Sets the character advance.
- setCharAdvance in interface BaseFont
c
- the characteradvance
- the character advance normalized to 1000 units
true
if the advance was set,
false
otherwise. Will always return false
setKerning
public boolean setKerning(char char1,
char char2,
int kern)
Sets the kerning between two Unicode chars.
- setKerning in interface BaseFont
char1
- the first charchar2
- the second charkern
- the kerning to apply in normalized 1000 units
true
if the kerning was applied, false
otherwise
setPostscriptFontName
public void setPostscriptFontName(String name)
Sets the font name that will appear in the pdf font dictionary.
Use with care as it can easily make a font unreadable if not embedded.
- setPostscriptFontName in interface BaseFont