phelps.awt
public abstract class NFont extends Object
Unicode vs font encoding. Sometimes font has characters that do not have Unicode mappings. xxxString vs xxxEstring
Version: $Revision: 1.20 $ $Date: 2004/01/30 15:02:45 $
Field Summary | |
---|---|
protected AffineTransform | at_ |
static FileFilter | FILTER java.io.FileFilter that matches font files of supported formats (Type 1 PFA and PFB, TrueType, OpenType, OS X .dfont , TrueType Collection). |
static int | FLAG_ALLCAP |
static int | FLAG_CONDENSED Condensed (narrow) (non-Adobe). |
static int | FLAG_DEFAULT |
static int | FLAG_FIXEDPITCH |
static int | FLAG_FORCEBOLD Force boldface even at small point sizes. |
static int | FLAG_ITALIC |
static int | FLAG_NONE |
static int | FLAG_NONSYMBOLIC Standard Latin character set. |
static int | FLAG_SCRIPT |
static int | FLAG_SERIF |
static int | FLAG_SMALLCAP |
static int | FLAG_SYMBOLIC Not exactly standard Latin; though could be close. |
static int | MODE_ADD |
static int | MODE_FILL |
static int | MODE_FILL_ADD |
static int | MODE_FILL_STROKE |
static int | MODE_FILL_STROKE_ADD |
static int | MODE_INVISIBLE |
static int | MODE_STROKE |
static int | MODE_STROKE_ADD |
static String | NOTDEF |
static char | NOTDEF_CHAR |
static char | NOTVALID_CHAR |
protected float | size_ |
static String | SUBFORMAT_NONE |
protected CMap | touni_ |
static int | WEIGHT_BLACK Black (Heavy) |
static int | WEIGHT_BOLD Bold |
static int | WEIGHT_EXTRABOLD Extra-Bold (Ultra-bold) |
static int | WEIGHT_EXTRALIGHT Extra-light (Ultra-light) |
static int | WEIGHT_LIGHT Light |
static int | WEIGHT_MEDIUM Medium |
static int | WEIGHT_NORMAL Normal (Regular) |
static int | WEIGHT_SEMIBOLD Semi-bold (Demi-bold) |
static int | WEIGHT_THIN Thin |
static double | WIDTHS_SCALEX |
Method Summary | |
---|---|
boolean | canDisplay(char uni) Can the Unicode character uni be rendered? |
abstract boolean | canDisplayEchar(char ech) Can the character ch in the font's encoding be rendered? |
Point2D | charAdvance(char ch) |
abstract NFont | deriveFont(float pointsize)
Creates font a new pointsize, assuming 72 ppi.
|
NFont | deriveFont(AffineTransform at)
Transform all glyphs by arbitrary affine transform.
|
abstract void | drawEstring(Graphics2D g, String estr, float x, float y, int mode)
Draw string str in font's encoding at (x,y) in drawing mode mode.
|
void | drawString(Graphics2D g, String uni, float x, float y) Convenience method for drawing string in fill mode . |
void | drawString(Graphics2D g, String uni, float x, float y, int mode)
Translate Unicode string str to this font's encoding and invoke NFont.
|
abstract Point2D | echarAdvance(char ech) |
Point2D | estringAdvance(String estr, int beginIndex, int limit) |
String | fromUnicode(String unicode)
Translates Unicode characters into current encoding.
|
String | getCopyright() |
String | getDesigner() |
Rectangle2D | getEstringBounds(String estr, int beginIndex, int limit) |
abstract String | getFamily() |
int | getFlags() |
static NFontManager | getFontManager()
Returns standard system font manager.
|
abstract String | getFormat() |
static NFont | getInstance(String family, int weight, int flags, float size)
Given family and flags, returns best matching font, at point size size. |
abstract Rectangle2D | getMaxCharBounds() left, ascent, width, height. |
int | getMaxGlyphNum() Returns highest glyph index + 1, which may be larger than getNumGlyphs. |
abstract String | getName() |
abstract int | getNumGlyphs() |
float | getSize() |
abstract char | getSpaceChar() Returns the character that seems to be used as a space in the current encoding, or NOTDEF_CHAR if no such character. |
Rectangle2D | getStringBounds(String str) Logical origin, ascent, advance, and height (includes leading). |
Rectangle2D | getStringBounds(String str, int beginIndex, int limit) |
String | getSubformat() |
AffineTransform | getTransform() Returns a copy of the transform associated with this NFont. |
int | getWeight() |
boolean | isTransformed() |
static String | strFlags(int flags) Decode flag bit positions into slightly more readable string. |
Point2D | stringAdvance(String str) |
Point2D | stringAdvance(String str, int beginIndex, int limit) |
String | toString() |
String | toUnicode(String encoded) Translates characters in current encoding into Unicode. |
.dfont
, TrueType Collection).deriveFont
methods use this to make a clone and might make subsequent changes.Graphics2D
.fill mode
.If some characters are not appearing, it may be that those characters do not have Unicode mappings. In that case, try NFont.