|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.ui.Typeface
public abstract class Typeface
A typeface represents a font definition that one would typically find in a file such as a true-type file. It defines how to produce glyphs to represent character codes such as unicode. A font represents a particular set of glyphs rasterized to a particular size, ready to be rendered. The typeface acts as a factory to fonts. Ideally the definition is defined as a set of scalable paths, and any size of font can be produced from the typeface. Some font definitions are provided as bitmaps however, and these font definitions can only be presented in the sizes for which the bitmaps are available.
| Constructor Summary | |
|---|---|
Typeface()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs. |
|
| Method Summary | |
|---|---|
static String |
add(byte[] facedef)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Add a new typeface definition to the font system. |
static String |
addFromResource(Class c,
String filename)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.A convenience interface to the add(byte[]) method
which loads a font definition as a resource relative to a class
using Class.getResourceAsStreamm. |
static Typeface |
create(byte[] def)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Create a typeface from a truetype font definition. |
static Typeface |
createFromResource(Class c,
String filename)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.A convenience interface to the create(byte[]) method
which loads a font definition as a resource relative to a class
using Class.getResourceAsStreamm. |
void |
dispose()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Dispose of the typeface, removing it from the font system and freeing the memory consumed by it. |
abstract String |
getFamily()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Fetch the font family name. |
Font |
getFont(int size)
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Fetch a font of the given point size. |
String |
getName()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Fetch the name used to represent the typeface and serve as the basename of font requests. |
abstract int[] |
getSupportedSizes()
EXPERIMENTAL Experimental APIs are APIs that are early-stage and not yet finalized or fully qualified. In future releases, these APIs may be changed in incompatible ways, replaced or even removed completely without warning. For these reasons, Danger will not publish applications that use any experimental APIs.Fetch the sizes available with this typeface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Typeface()
| Method Detail |
|---|
public static Typeface create(byte[] def)
dispose() to free up resources used.
Fonts created from the typeface directly will not be found in queries to
Font.findFont(java.lang.String). This keeps the fonts from being shared by other
applications, so that they can be safely unloaded by the application that creates
the fonts.
public static Typeface createFromResource(Class c,
String filename)
create(byte[]) method
which loads a font definition as a resource relative to a class
using Class.getResourceAsStreamm.
c - The class from which the resource should be loaded.filename - The name of the resource. This will be a relative path
from the class given.
public static String add(byte[] facedef)
familyname-style-size
where familyname is the familyname of the font, style
is the concatonation of the names of the style flags, and size is the desired point size
of the font. This is most easily produced by concatonating the name returned by this
method with a dash and size string.
facedef - byte array representing the contents of a font typeface definition
(i.e. the contents of a font file such as a true-type or
open-type file).
public static String addFromResource(Class c,
String filename)
add(byte[]) method
which loads a font definition as a resource relative to a class
using Class.getResourceAsStreamm.
c - The class from which the resource should be loaded.filename - The name of the resource. This will be a relative path
from the class given.
public Font getFont(int size)
public String getName()
public abstract String getFamily()
public abstract int[] getSupportedSizes()
public void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||