Class Overview
TrueTypeFont is not called SFntFont because it is not expected
to handle all types that may be housed in a such a font file.
If additional types are supported later, it may make sense to
create an SFnt superclass. Eg to handle sfnt-housed postscript fonts.
OpenType fonts are handled by this class, and possibly should be
represented by a subclass.
An instance stores some information from the font file to faciliate
faster access. File size, the table directory and the names of the font
are the most important of these. It amounts to approx 400 bytes
for a typical font. Systems with mutiple locales sometimes have up to 400
font files, and an app which loads all font files would need around
160Kbytes. So storing any more info than this would be expensive.
Summary
[Expand]
Inherited Methods |
From class
sun.font.FileFont
|
From class
sun.font.PhysicalFont
boolean
|
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
int
|
hashCode()
Returns a hash code value for the object.
|
|
From class
sun.font.Font2D
boolean
|
canDisplay(int cp)
|
boolean
|
canDisplay(char c)
|
boolean
|
canDoStyle(int style)
|
int
|
charToGlyph(int wchar)
|
byte
|
getBaselineFor(char c)
|
String
|
getFamilyName(Locale l)
|
void
|
getFontMetrics(Font font, AffineTransform at, Object aaHint, Object fmHint, float[] metrics)
The length of the metrics array must be >= 8.
|
void
|
getFontMetrics(Font font, FontRenderContext frc, float[] metrics)
The length of the metrics array must be >= 4.
|
String
|
getFontName(Locale l)
|
float
|
getItalicAngle(Font font, AffineTransform at, Object aaHint, Object fmHint)
|
int
|
getMissingGlyphCode()
|
int
|
getNumGlyphs()
|
String
|
getPostscriptName()
|
FontStrike
|
getStrike(Font font, AffineTransform devTx, AffineTransform glyphTx, int aa, int fm)
|
FontStrike
|
getStrike(Font font)
|
FontStrike
|
getStrike(Font font, AffineTransform devTx, int aa, int fm)
|
FontStrike
|
getStrike(Font font, FontRenderContext frc)
|
int
|
getStyle()
|
void
|
getStyleMetrics(float pointSize, float[] metrics, int offset)
The length of the metrics array must be >= offset+4, and offset must be
>= 0.
|
long
|
getUnitsPerEm()
|
int
|
getValidatedGlyphCode(int glyphCode)
|
boolean
|
hasSupplementaryChars()
|
void
|
setStyle()
|
boolean
|
useAAForPtSize(int ptsize)
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
Constants
public
static
final
int
EBLCTag
Constant Value:
1161972803
(0x45424c43)
public
static
final
short
ENGLISH_LOCALE_ID
Constant Value:
1033
(0x00000409)
public
static
final
int
FAMILY_NAME_ID
Constant Value:
1
(0x00000001)
public
static
final
int
FULL_NAME_ID
Constant Value:
4
(0x00000004)
public
static
final
int
GDEFTag
Constant Value:
1195656518
(0x47444546)
public
static
final
int
GPOSTag
Constant Value:
1196445523
(0x47504f53)
public
static
final
int
GSUBTag
Constant Value:
1196643650
(0x47535542)
public
static
final
int
MS_PLATFORM_ID
Constant Value:
3
(0x00000003)
public
static
final
int
POSTSCRIPT_NAME_ID
Constant Value:
6
(0x00000006)
public
static
final
int
cmapTag
Constant Value:
1668112752
(0x636d6170)
public
static
final
int
fdscTag
Constant Value:
1717859171
(0x66647363)
public
static
final
int
featTag
Constant Value:
1717920116
(0x66656174)
public
static
final
int
fvarTag
Constant Value:
1719034226
(0x66766172)
public
static
final
int
gaspTag
Constant Value:
1734439792
(0x67617370)
public
static
final
int
glyfTag
Constant Value:
1735162214
(0x676c7966)
public
static
final
int
headTag
Constant Value:
1751474532
(0x68656164)
public
static
final
int
hheaTag
Constant Value:
1751672161
(0x68686561)
public
static
final
int
hmtxTag
Constant Value:
1752003704
(0x686d7478)
public
static
final
int
locaTag
Constant Value:
1819239265
(0x6c6f6361)
public
static
final
int
maxpTag
Constant Value:
1835104368
(0x6d617870)
public
static
final
int
mortTag
Constant Value:
1836020340
(0x6d6f7274)
public
static
final
int
nameTag
Constant Value:
1851878757
(0x6e616d65)
public
static
final
int
os_2Tag
Constant Value:
1330851634
(0x4f532f32)
public
static
final
int
ottoTag
Constant Value:
1330926671
(0x4f54544f)
public
static
final
int
postTag
Constant Value:
1886352244
(0x706f7374)
public
static
final
int
reserved_bits1
Constant Value:
-2147483648
(0x80000000)
public
static
final
int
reserved_bits2
Constant Value:
65535
(0x0000ffff)
public
static
final
int
trueTag
Constant Value:
1953658213
(0x74727565)
public
static
final
int
ttcfTag
Constant Value:
1953784678
(0x74746366)
public
static
final
int
v1ttTag
Constant Value:
65536
(0x00010000)
Public Methods
public
int
getFontCount
()
Returns
- number of logical fonts. Is "1" for all but TTC files
public
String
getPostscriptName
()
public
void
getStyleMetrics
(float pointSize, float[] metrics, int offset)
The length of the metrics array must be >= offset+4, and offset must be
>= 0. Typically offset is 4. This method will
store the following elements in that array before returning:
metrics[off+0]: strikethrough offset
metrics[off+1]: strikethrough thickness
metrics[off+2]: underline offset
metrics[off+3]: underline thickness
Note that this implementation simply returns default values;
subclasses can override this method to provide more accurate values.
public
boolean
hasSupplementaryChars
()
public
String
toString
()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns
- a string representation of the object.
public
boolean
useAAForPtSize
(int ptsize)
Protected Methods
protected
boolean
checkUseNatives
()
protected
synchronized
void
close
()
protected
void
init
(int fIndex)
protected
void
initAllNames
(int requestedID, HashSet names)
protected
void
initNames
()
protected
String
lookupName
(short findLocaleID, int findNameID)
protected
void
setStyle
()