phelps.awt.font
public class NFontTrueType extends NFontSimple implements OpenType, Cloneable
.ttf
), both Apple and Adobe/Microsoft varieties.
It also parses OS X .dfont
wrapper.
Does not execute the hinting instructions, which apparently requires a license from Apple.
Any bitmap glyphs are not supported; if the font contains only bitmaps, as indicated by the subtype, the user should not try to use the font.
Implementation Notes:
Version: $Revision: 1.32 $ $Date: 2004/01/10 07:50:32 $
Field Summary | |
---|---|
protected CMap | c2g_
In non-CID, mapping from all the way from encoded character through encoding to glyph.
|
static String | FORMAT |
protected float[] | lsb_ Indexed by glyph ID. |
static int | PID_MACINTOSH Platform ID for Macintosh. |
static int | PID_MICROSOFT Platform ID for Microsoft / Windows. |
static int | PID_UNICODE Platform ID for Unicode. |
static String | SUBFORMAT_BITMAP Font does not have any outline glyphs, only bitmaps. |
static String | SUBFORMAT_DFONT |
static String | SUBFORMAT_TTC TrueType Collection ( .ttc ). |
protected float[] | widths_ Indexed by glyph ID. |
Constructor Summary | |
---|---|
NFontTrueType(URL source)
Creates font from source, which can be file, JAR resource, or even network | |
NFontTrueType(byte[] data)
Creates font fron byte[] , for use on small fonts and fonts embedded in PDF.
|
Method Summary | |
---|---|
boolean | canDisplayEchar(char ech) |
NFontTrueType | deriveFont(float pointsize) |
NFontTrueType | deriveFont(Encoding encoding, CMap toUnicode) |
NFontTrueType | deriveFont(CMap cid2gid, CMap toUnicode) |
void | drawEstring(Graphics2D g, String estr, float x, float y, int mode) |
double | echarWidth(char ech) |
CMap | getCmap() Returns CMap in use. |
CMap | getCmap(int platformID, int platformSpecificID)
Returns cmap for platformID and platformSpecificID, or null if that table does not exist.
|
String | getCopyright() |
String | getDesigner() |
String | getFamily() |
int | getFlags() |
NFontTrueType | getFont(int num)
Returns font names of all fonts in file.
|
int | getFontCount() |
byte[] | getFontTable(int sfntTag) Returns the table as an array of bytes for a specified tag. |
byte[] | getFontTable(String strSfntTag) Returns the table as an array of bytes for a specified tag. |
byte[] | getFontTable(int sfntTag, int offset, int count) Returns a subset of the table as an array of bytes for a specified tag. |
byte[] | getFontTable(TrueTypeDirectory td, int offset, int count) |
byte[] | getFontTable(String strSfntTag, int offset, int count) Returns a subset of the table as an array of bytes for a specified tag. |
int | getFontTableSize(int sfntTag) Returns the size of the table for a specified tag. |
int | getFontTableSize(String strSfntTag) Returns the size of the table for a specified tag. |
String | getFormat() |
String | getName() |
int | getNumGlyphs() |
char | getSpaceChar() |
String | getSubformat() |
TrueTypeDirectory | getTableDirectory(int sfntTag) |
TrueTypeDirectory[] | getTables() Returns an array of the font table directories. |
int | getVersion() Returns the font version (first four bytes of file). |
int | getWeight() |
.ttc
). (Not supported.)byte[]
, for use on small fonts and fonts embedded in PDF.
The memory for data is not reclaimed until the entire font is garbage collected.null
if that table does not exist.
Pass -1
to match any value..dfont
s can have multiple fonts bundled in the same file.
The different bundled fonts can be obtained by....name? number?
By default the first font is used.