Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.pt.awt
Class NFont

    java.lang.Object
      com.pt.awt.NFont

Direct Known Subclasses:
  com.pt.awt.font.NFontSimple

public abstract class NFont
extends java.lang.Object

Superclass for new fonts, which provide more control than `java.awt.Font`. (NFont is a complete font implementation from scratch, and does not use `java.awt.Font`.) Usage is patterned after `Font`, except that drawing is a method on the font rather than a special case of `Graphics2D`.

- `font property flags`. (Flags are identical to Adobe's definitions, with additional as marked.)
- `standard weight values`
- `display modes`
- `intellectual property font usage restriction settings` and `querying`
- `special characters`
- `creation`
- derive by `size`, `AffineTransform`
- query metadata: `getName()`, `getFamily()`, `getDesigner()`, `getCopyright()`, `getFormat()`, `getSubformat()`, `getRights()`, `getNumGlyphs()`, `getMaxGlyphNum()`
- query: `getSize()`, `getFlags()`, `getWeight()`, `getTransform()`, `isTransformed()`, `strFlags(int)`
- character encoding: `toUnicode(String)`, `fromUnicode(String)`, `getSpaceEchar()`
- measurement of advance: `stringAdvance(String)`, `stringAdvance(String)`, `estringAdvance(String,int,int)`, `charAdvance(int)`, `echarAdvance(int)`
- meansurement of bounds: `getStringBounds(String)`, `getStringBounds(String,int,int)`, `getEstringBounds(String,int,int)`, `getMaxCharBounds()`
- display Unicode: `canDisplay(int)`, `drawString(Graphics2D,String,float,float)`, `drawString(Graphics2D,String,float,float,long,int,Color)`
- display text in same encoding as font, which is necessary when font has characters that do not have Unicode mappings: `canDisplayEchar(int)`, `drawEstring(Graphics2D,String,float,float,long,int,Color)`
- logged, for applications to debug their use of fonts

Version:
  $Revision: 1.34 $ $Date: 2005/07/23 00:04:00 $

Field Summary
`static double` | `AFM_SCALE` Default coordinate scaling factor.
`protected java.awt.geom.AffineTransform` | `at_`
`static int` | `FLAG_ALLCAP`
`static int` | `FLAG_CONDENSED` Condensed (narrow) (non-Adobe).
`static int` | `FLAG_DEFAULT`
`static int` | `FLAG_EXPANDED` Expanded (wide) (non-Adobe).
`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_ORNAMENTAL` Ornamental (non-Adobe).
`static int` | `FLAG_SANSSERIF` Opposite of `FLAG_SERIF`.
`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 long` | `LAYOUT_FALLBACK` Allow font fallback, if in Unicode.
`static long` | `LAYOUT_KERN`
`static long` | `LAYOUT_LIGATURE`
`static long` | `LAYOUT_MINIMUM` Convenience: Minimum formatting necessary for correctness: formatting (tab, softhyphen), (only) necessary ligatures (as in Arabic), font fallback.
`static long` | `LAYOUT_NONE` Do no layout: map every character to a separate glyph, if possible, including control, formatting, and combining marks code points.
`static long` | `LAYOUT_NORMAL` Convenience: Usual text display, including fallback, ligatures and kerning.
`static long` | `LAYOUT_SMALLCAPS`
`static long` | `LAYOUT_SWASH`
`static com.pt.lang.UnicodeBlocks[]` | `MASKS_NONE`
`protected java.awt.geom.Rectangle2D` | `max_`
`static int` | `MODE_ADD` Add text to path for clipping.
`static int` | `MODE_FILL` Fill text [usual].
`static int` | `MODE_FILL_ADD` Fill text and add to path for clipping.
`static int` | `MODE_FILL_STROKE` Fill, then stroke, text.
`static int` | `MODE_FILL_STROKE_ADD` Fill, then stroke, text and add to path for clipping.
`static int` | `MODE_INVALID`
`static int` | `MODE_INVISIBLE` Neither fill nor stroke text (invisible) [used in scanned paper].
`static int` | `MODE_STROKE` Stroke text [outline].
`static int` | `MODE_STROKE_ADD` Stroke text and add to path for clipping.
`static java.lang.String` | `NOTDEF`
`static char` | `NOTDEF_CHAR`
`static char` | `NOTVALID_CHAR`
`static int` | `RIGHT_BITMAP` Bitmap embedding only.
`static int` | `RIGHT_EDITABLE` Editable embedding.
`static int` | `RIGHT_HEURISTIC` Rights not directly available to programmatically, and so were heuristically estimated, as by scanning text for legal language.
`static int` | `RIGHT_INSTALL` Installable Embedding.
`static int` | `RIGHT_LICENSED` Fonts subject to a licensing agreement are legally protected or licensed.
`static int` | `RIGHT_NONCOMMERCIAL` Right to use for non-commercial purposes.
`static int` | `RIGHT_NOSUBSET` No subsetting.
`static int` | `RIGHT_PREVIEW_PRINT` Print and preview embedding.
`static int` | `RIGHT_RESTRICTED` Font (if only this bit set) must not be modified, embedded or exchanged in any manner without first obtaining permission of the legal owner.
`static int` | `RIGHT_UNKNOWN` Rights could not be determined programmatically from font data.
`protected float` | `size_`
`static java.lang.String` | `SUBFORMAT_NONE`
`protected com.pt.awt.font.CMap` | `touni_`
`static int` | `WEIGHT_BLACK` Black (aka Heavy)
`static int` | `WEIGHT_BOLD` Bold
`static int` | `WEIGHT_EXTRABOLD` Extra-Bold (aka Ultra-bold)
`static int` | `WEIGHT_EXTRALIGHT` Extra-light (aka Ultra-light)
`static int` | `WEIGHT_LIGHT` Light
`static int` | `WEIGHT_MEDIUM` Medium
`static int` | `WEIGHT_NORMAL` Normal (aka Regular)
`static int` | `WEIGHT_SEMIBOLD` Semi-bold (aka Demi-bold)
`static int` | `WEIGHT_THIN` Thin

Constructor Summary
`protected` | `NFont(java.net.URL source)` Constructor, with source of font data, which may be `null`.

Method Summary
`boolean` | `canDisplay(int codepoint)` Can the Unicode codepoint be rendered?
`abstract boolean` | `canDisplayEchar(int ech)` Can the character ech in the font's encoding be rendered?
`java.awt.geom.Point2D` | `charAdvance(int codepoint)`
`NFont` | `deriveFont(java.awt.geom.AffineTransform at)` Transform all glyphs by arbitrary affine transform.
`NFont` | `deriveFont(float pointsize)` Creates font a new pointsize in pixels.
`abstract void` | `drawEstring(java.awt.Graphics2D g, java.lang.String estr, float x, float y, long layout, int mode, java.awt.Color strokecolor)` Draws string str in font's encoding at (x,y) in drawing mode mode.
`void` | `drawString(java.awt.Graphics2D g, java.lang.String uni, float x, float y)` Convenience method for drawing string in `fill mode`.
`void` | `drawString(java.awt.Graphics2D g, java.lang.String uni, float x, float y, long layout, int mode, java.awt.Color strokecolor)` Translates Unicode string uni to this font's encoding and invokes `drawEstring(Graphics2D, String, float, float, long,int, Color)`.
`abstract java.awt.geom.Point2D` | `echarAdvance(int ech)`
`java.awt.geom.Point2D` | `estringAdvance(java.lang.String estr, int beginIndex, int limit)`
`java.lang.String` | `fromUnicode(java.lang.String unicode)` Translates Unicode characters into current encoding.
`float` | `getAscent()` Returns design ascent of glyphs above baseline (usually a negative number, which is up in Java2D coordinate space).
`java.lang.String` | `getCopyright()` Returns copyright, or empty string if unknown.
`float` | `getDescent()` Returns maximum descent of glyphs below baseline.
`java.lang.String` | `getDesigner()` Returns name of font's designer, or empty string if unknown.
`java.awt.geom.Rectangle2D` | `getEstringBounds(java.lang.String estr, int beginIndex, int limit)`
`abstract java.lang.String` | `getFamily()` Returns name of font, such as "Times".
`int` | `getFlags()` Returns additional flags bit mask, such as `FLAG_ITALIC` and `FLAG_FIXEDPITCH`.
`abstract java.lang.String` | `getFormat()` Returns primary format, such as "Type1" or "OpenType".
`float` | `getHeight()` Returns design height of glyphs.
`static NFont` | `getInstance(java.lang.String family, int weight, int flags, float size)` Given family name (such as `Times`), `weight` and `flags`, returns best matching font, at point size size pixels.
`float` | `getLeading()` Returns recommended leading, for single spacing.
`static java.util.logging.Logger` | `getLogger()` Interesting events are logged to this logger
`abstract java.awt.geom.Rectangle2D` | `getMaxCharBounds()` Returns left in rectangle's x, ascent in y, width in width, height in height.
`int` | `getMaxGlyphNum()` Returns highest glyph index + 1, which may be larger than `getNumGlyphs()` if some "slots" are empty.
`protected static com.pt.io.RandomAccessMultiplex` | `getMultiplex()` Returns file descriptor multiplexer shared among all `NFont`s.
`abstract java.lang.String` | `getName()` Returns the PostScript name of font, such as "Times-Roman".
`abstract int` | `getNumGlyphs()` Returns number of glyphs defined in font.
`int` | `getRights()` Returns font usage rights bit mask.
`float` | `getSize()` Returns size in pixels.
`java.net.URL` | `getSource()` Returns font's source file or URL, which is usually a file, or `null` if font was created from `byte[]` or other non-addressible source.
`abstract char` | `getSpaceEchar()` Returns the character that seems to be used as a space in the current encoding, or `NOTDEF_CHAR` if no such character.
`java.awt.geom.Rectangle2D` | `getStringBounds(java.lang.String str)` Logical origin, ascent, advance, and height (includes leading).
`java.awt.geom.Rectangle2D` | `getStringBounds(java.lang.String str, int beginIndex, int limit)`
`java.lang.String` | `getSubformat()` Returns secondary format, such as "CFF/CID" under primary format "CFF".
`java.awt.geom.AffineTransform` | `getTransform()` Returns a copy of the transform associated with this `NFont`.
`com.pt.lang.UnicodeBlocks[]` | `getUnicode()` Returns Unicode ranges for which font has various levels of coverage: [0] = existence (at least one glyph), [1] = "good" coverage (of visible glyphs), and [2] = full coverage.
`java.lang.String` | `getVersion()` Returns version of font, or empty string if there is no version or it is not applicable.
`int` | `getWeight()` Returns weight, such as `WEIGHT_BOLD`.
`boolean` | `isHinted()` Returns `true` iff font has hinted outlines, which in Type 1 and TrueType is a sign of higher quality.
`boolean` | `isTransformed()` Returns whether the affine transform is the identity transform without creating a copy.
`static boolean` | `isUseBitmaps()`
`void` | `setManager(com.pt.awt.font.NFontManager fm)` Sets the font's manager, or `null` for none.
`static void` | `setUseBitmaps(boolean b)` To increase performance, some subclasses may cached glyphs as bitmaps, and in accelerated video memory in Java 5 and later.
`static java.lang.String` | `strFlags(int flags)` Decodes flag bit positions into humand-readable string.
`java.awt.geom.Point2D` | `stringAdvance(java.lang.String uni)`
`java.awt.geom.Point2D` | `stringAdvance(java.lang.String uni, int beginIndex, int limit)`
`static java.lang.String` | `strRights(int rights)`
`static java.lang.String` | `strWeight(int weight)`
`java.lang.String` | `toString()`
`java.lang.String` | `toUnicode(java.lang.String encoded)` Translates characters in current encoding into Unicode.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### FLAG_NONE

    public static final int FLAG_NONE

See Also:
  Constant Field Values

### FLAG_FIXEDPITCH

    public static final int FLAG_FIXEDPITCH

See Also:
  Constant Field Values

### FLAG_SERIF

    public static final int FLAG_SERIF

See Also:
  Constant Field Values

### FLAG_SANSSERIF

    public static final int FLAG_SANSSERIF

  Opposite of `FLAG_SERIF`.

  See Also:
    Constant Field Values

### FLAG_SYMBOLIC

    public static final int FLAG_SYMBOLIC

  Not exactly standard Latin; though could be close. This follows the Adobe definition and does NOT mean dingbat glyphs as in Symbol or Zapf Dingbats. And it's redundant with `FLAG_NONSYMBOLIC`.

  See Also:
    Constant Field Values

### FLAG_SCRIPT

    public static final int FLAG_SCRIPT

See Also:
  Constant Field Values

### FLAG_NONSYMBOLIC

    public static final int FLAG_NONSYMBOLIC

  Standard Latin character set.

  See Also:
    Constant Field Values

### FLAG_ITALIC

    public static final int FLAG_ITALIC

See Also:
  Constant Field Values

### FLAG_ALLCAP

    public static final int FLAG_ALLCAP

See Also:
  Constant Field Values

### FLAG_SMALLCAP

    public static final int FLAG_SMALLCAP

See Also:
  Constant Field Values

### FLAG_FORCEBOLD

    public static final int FLAG_FORCEBOLD

  Force boldface even at small point sizes.

  See Also:
    Constant Field Values

### FLAG_CONDENSED

    public static final int FLAG_CONDENSED

  Condensed (narrow) (non-Adobe).

  See Also:
    Constant Field Values

### FLAG_EXPANDED

    public static final int FLAG_EXPANDED

  Expanded (wide) (non-Adobe).

  See Also:
    Constant Field Values

### FLAG_ORNAMENTAL

    public static final int FLAG_ORNAMENTAL

  Ornamental (non-Adobe).

  See Also:
    Constant Field Values

### FLAG_DEFAULT

    public static final int FLAG_DEFAULT

See Also:
  Constant Field Values

### WEIGHT_THIN

    public static final int WEIGHT_THIN

  Thin

  See Also:
    Constant Field Values

### WEIGHT_EXTRALIGHT

    public static final int WEIGHT_EXTRALIGHT

  Extra-light (aka Ultra-light)

  See Also:
    Constant Field Values

### WEIGHT_LIGHT

    public static final int WEIGHT_LIGHT

  Light

  See Also:
    Constant Field Values

### WEIGHT_NORMAL

    public static final int WEIGHT_NORMAL

  Normal (aka Regular)

  See Also:
    Constant Field Values

### WEIGHT_MEDIUM

    public static final int WEIGHT_MEDIUM

  Medium

  See Also:
    Constant Field Values

### WEIGHT_SEMIBOLD

    public static final int WEIGHT_SEMIBOLD

  Semi-bold (aka Demi-bold)

  See Also:
    Constant Field Values

### WEIGHT_BOLD

    public static final int WEIGHT_BOLD

  Bold

  See Also:
    Constant Field Values

### WEIGHT_EXTRABOLD

    public static final int WEIGHT_EXTRABOLD

  Extra-Bold (aka Ultra-bold)

  See Also:
    Constant Field Values

### WEIGHT_BLACK

    public static final int WEIGHT_BLACK

  Black (aka Heavy)

  See Also:
    Constant Field Values

### MODE_FILL

    public static final int MODE_FILL

  Fill text [usual].

  See Also:
    Constant Field Values

### MODE_STROKE

    public static final int MODE_STROKE

  Stroke text [outline].

  See Also:
    Constant Field Values

### MODE_FILL_STROKE

    public static final int MODE_FILL_STROKE

  Fill, then stroke, text.

  See Also:
    Constant Field Values

### MODE_INVISIBLE

    public static final int MODE_INVISIBLE

  Neither fill nor stroke text (invisible) [used in scanned paper].

  See Also:
    Constant Field Values

### MODE_FILL_ADD

    public static final int MODE_FILL_ADD

  Fill text and add to path for clipping.

  See Also:
    Constant Field Values

### MODE_STROKE_ADD

    public static final int MODE_STROKE_ADD

  Stroke text and add to path for clipping.

  See Also:
    Constant Field Values

### MODE_FILL_STROKE_ADD

    public static final int MODE_FILL_STROKE_ADD

  Fill, then stroke, text and add to path for clipping.

  See Also:
    Constant Field Values

### MODE_ADD

    public static final int MODE_ADD

  Add text to path for clipping.

  See Also:
    Constant Field Values

### MODE_INVALID

    public static final int MODE_INVALID

See Also:
  Constant Field Values

### RIGHT_INSTALL

    public static final int RIGHT_INSTALL

  Installable Embedding.

  See Also:
    Constant Field Values

### RIGHT_LICENSED

    public static final int RIGHT_LICENSED

  Fonts subject to a licensing agreement are legally protected or licensed. Must check licensing manually. (Apple only; reserved in Adobe/Microsoft.)

  See Also:
    Constant Field Values

### RIGHT_RESTRICTED

    public static final int RIGHT_RESTRICTED

  Font (if only this bit set) must not be modified, embedded or exchanged in any manner without first obtaining permission of the legal owner.

  See Also:
    Constant Field Values

### RIGHT_PREVIEW_PRINT

    public static final int RIGHT_PREVIEW_PRINT

  Print and preview embedding.

  See Also:
    Constant Field Values

### RIGHT_EDITABLE

    public static final int RIGHT_EDITABLE

  Editable embedding.

  See Also:
    Constant Field Values

### RIGHT_NOSUBSET

    public static final int RIGHT_NOSUBSET

  No subsetting.

  See Also:
    Constant Field Values

### RIGHT_BITMAP

    public static final int RIGHT_BITMAP

  Bitmap embedding only.

  See Also:
    Constant Field Values

### RIGHT_NONCOMMERCIAL

    public static final int RIGHT_NONCOMMERCIAL

  Right to use for non-commercial purposes.

  See Also:
    Constant Field Values

### RIGHT_HEURISTIC

    public static final int RIGHT_HEURISTIC

  Rights not directly available to programmatically, and so were heuristically estimated, as by scanning text for legal language.

  See Also:
    Constant Field Values

### RIGHT_UNKNOWN

    public static final int RIGHT_UNKNOWN

  Rights could not be determined programmatically from font data. This is because either font format does not support this or because the information was not reported. Whether to interpret this as permitting embedding in PDF is left to the caller.

  See Also:
    Constant Field Values

### LAYOUT_NONE

    public static final long LAYOUT_NONE

  Do no layout: map every character to a separate glyph, if possible, including control, formatting, and combining marks code points. Used if glyph selection and positioning fully controlled by application, or precomputed as in PDF and DVI.

  See Also:
    Constant Field Values

### LAYOUT_FALLBACK

    public static final long LAYOUT_FALLBACK

  Allow font fallback, if in Unicode. That is, if a font is missing a glyph, try to find it in another font.

  See Also:
    Constant Field Values

### LAYOUT_LIGATURE

    public static final long LAYOUT_LIGATURE

See Also:
  Constant Field Values

### LAYOUT_SMALLCAPS

    public static final long LAYOUT_SMALLCAPS

See Also:
  Constant Field Values

### LAYOUT_SWASH

    public static final long LAYOUT_SWASH

See Also:
  Constant Field Values

### LAYOUT_KERN

    public static final long LAYOUT_KERN

See Also:
  Constant Field Values

### LAYOUT_MINIMUM

    public static final long LAYOUT_MINIMUM

  Convenience: Minimum formatting necessary for correctness: formatting (tab, softhyphen), (only) necessary ligatures (as in Arabic), font fallback.

  See Also:
    Constant Field Values

### LAYOUT_NORMAL

    public static final long LAYOUT_NORMAL

  Convenience: Usual text display, including fallback, ligatures and kerning.

  See Also:
    Constant Field Values

### MASKS_NONE

    public static final com.pt.lang.UnicodeBlocks[] MASKS_NONE

### SUBFORMAT_NONE

    public static final java.lang.String SUBFORMAT_NONE

See Also:
  Constant Field Values

### NOTDEF

    public static final java.lang.String NOTDEF

See Also:
  Constant Field Values

### NOTDEF_CHAR

    public static final char NOTDEF_CHAR

See Also:
  Constant Field Values

### NOTVALID_CHAR

    public static final char NOTVALID_CHAR

See Also:
  Constant Field Values

### AFM_SCALE

    public static final double AFM_SCALE

  Default coordinate scaling factor.

  See Also:
    Constant Field Values

### touni_

    protected com.pt.awt.font.CMap touni_

### size_

    protected float size_

### at_

    protected java.awt.geom.AffineTransform at_

### max_

    protected java.awt.geom.Rectangle2D max_

Constructor Detail

### NFont

    protected NFont(java.net.URL source)

  Constructor, with source of font data, which may be `null`.

Method Detail

### getInstance

    public static NFont getInstance(java.lang.String family,
                                    int weight,
                                    int flags,
                                    float size)

  Given family name (such as `Times`), `weight` and `flags`, returns best matching font, at point size size pixels. Font has Unicode encoding, if possible; font can be recoded. Uses system font manager to find font files in file system and match to requested.

### setUseBitmaps

    public static void setUseBitmaps(boolean b)

  To increase performance, some subclasses may cached glyphs as bitmaps, and in accelerated video memory in Java 5 and later. This is not always desirable because it prevents subpixel positioning, is in fact slower on OS X due to a performance bug in bitmap bitblt'ting, and is not needed on 2GHz or faster machines. The default setting is undefined. Bitmap use can be turned on by the user at runtime, with the command line option `-Dfont.usebitmaps=true`.

### isUseBitmaps

    public static boolean isUseBitmaps()

### deriveFont

    public NFont deriveFont(float pointsize)

  Creates font a new pointsize in pixels. Callers may want to adjust for screen pixels per inch. Note to subclassers: you must make a complete independent instance of the font here, even if pointsize and everything else is the same, as other `deriveFont` methods use this to make a clone and might make subsequent changes.

### deriveFont

    public NFont deriveFont(java.awt.geom.AffineTransform at)

  Transform all glyphs by arbitrary affine transform. Note that this sets the absolute transform -- new transforms replace previous ones and do not concatenate together.

### getName

    public abstract java.lang.String getName()

  Returns the PostScript name of font, such as "Times-Roman". This is different than the display name and the filename.

### getFamily

    public abstract java.lang.String getFamily()

  Returns name of font, such as "Times".

### getSource

    public java.net.URL getSource()

  Returns font's source file or URL, which is usually a file, or `null` if font was created from `byte[]` or other non-addressible source.

### getVersion

    public java.lang.String getVersion()

  Returns version of font, or empty string if there is no version or it is not applicable.

### getDesigner

    public java.lang.String getDesigner()

  Returns name of font's designer, or empty string if unknown.

### getCopyright

    public java.lang.String getCopyright()

  Returns copyright, or empty string if unknown.

### getRights

    public int getRights()

  Returns font usage rights bit mask.

### getFormat

    public abstract java.lang.String getFormat()

  Returns primary format, such as "Type1" or "OpenType".

### getSubformat

    public java.lang.String getSubformat()

  Returns secondary format, such as "CFF/CID" under primary format "CFF".

### getNumGlyphs

    public abstract int getNumGlyphs()

  Returns number of glyphs defined in font.

### getMaxGlyphNum

    public int getMaxGlyphNum()

  Returns highest glyph index + 1, which may be larger than `getNumGlyphs()` if some "slots" are empty.

### getUnicode

    public com.pt.lang.UnicodeBlocks[] getUnicode()

  Returns Unicode ranges for which font has various levels of coverage: [0] = existence (at least one glyph), [1] = "good" coverage (of visible glyphs), and [2] = full coverage.

### isHinted

    public boolean isHinted()

  Returns `true` iff font has hinted outlines, which in Type 1 and TrueType is a sign of higher quality.

### getSize

    public float getSize()

  Returns size in pixels.

### getWeight

    public int getWeight()

  Returns weight, such as `WEIGHT_BOLD`.

### getFlags

    public int getFlags()

  Returns additional flags bit mask, such as `FLAG_ITALIC` and `FLAG_FIXEDPITCH`.

### getTransform

    public java.awt.geom.AffineTransform getTransform()

  Returns a copy of the transform associated with this `NFont`.

### isTransformed

    public boolean isTransformed()

  Returns whether the affine transform is the identity transform without creating a copy.

### setManager

    public void setManager(com.pt.awt.font.NFontManager fm)

  Sets the font's manager, or `null` for none.

### toUnicode

    public java.lang.String toUnicode(java.lang.String encoded)

  Translates characters in current encoding into Unicode.

### fromUnicode

    public java.lang.String fromUnicode(java.lang.String unicode)

  Translates Unicode characters into current encoding. If there is no Unicode mapping for the character, the character `NOTDEF_CHAR` is returned.

### getSpaceEchar

    public abstract char getSpaceEchar()

  Returns the character that seems to be used as a space in the current encoding, or `NOTDEF_CHAR` if no such character.

### stringAdvance

    public java.awt.geom.Point2D stringAdvance(java.lang.String uni)

### stringAdvance

    public java.awt.geom.Point2D stringAdvance(java.lang.String uni,
                                               int beginIndex,
                                               int limit)

### estringAdvance

    public java.awt.geom.Point2D estringAdvance(java.lang.String estr,
                                                int beginIndex,
                                                int limit)

### charAdvance

    public java.awt.geom.Point2D charAdvance(int codepoint)

### echarAdvance

    public abstract java.awt.geom.Point2D echarAdvance(int ech)

### getStringBounds

    public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str)

  Logical origin, ascent, advance, and height (includes leading).

### getStringBounds

    public java.awt.geom.Rectangle2D getStringBounds(java.lang.String str,
                                                     int beginIndex,
                                                     int limit)

### getEstringBounds

    public java.awt.geom.Rectangle2D getEstringBounds(java.lang.String estr,
                                                      int beginIndex,
                                                      int limit)

### getMaxCharBounds

    public abstract java.awt.geom.Rectangle2D getMaxCharBounds()

  Returns left in rectangle's x, ascent in y, width in width, height in height. Note that some fonts lie about their max bounds.

### getHeight

    public float getHeight()

  Returns design height of glyphs.

### getAscent

    public float getAscent()

  Returns design ascent of glyphs above baseline (usually a negative number, which is up in Java2D coordinate space).

### getDescent

    public float getDescent()

  Returns maximum descent of glyphs below baseline.

### getLeading

    public float getLeading()

  Returns recommended leading, for single spacing.

### canDisplay

    public boolean canDisplay(int codepoint)

  Can the Unicode codepoint be rendered?

### canDisplayEchar

    public abstract boolean canDisplayEchar(int ech)

  Can the character ech in the font's encoding be rendered?

### drawString

    public void drawString(java.awt.Graphics2D g,
                           java.lang.String uni,
                           float x,
                           float y)

  Convenience method for drawing string in `fill mode`.

### drawString

    public void drawString(java.awt.Graphics2D g,
                           java.lang.String uni,
                           float x,
                           float y,
                           long layout,
                           int mode,
                           java.awt.Color strokecolor)

  Translates Unicode string uni to this font's encoding and invokes `drawEstring(Graphics2D, String, float, float, long,int, Color)`. Note that some fonts contain characters without Unicode mappings and therefore cannot be shown with this method; in that case, use `drawEstring(Graphics2D, String, float, float, long,int, Color)`. If the font cannot display the Unicode characters and it is `managed by a font manager` (which it is ordinarily) then drawing will try to find the Unicode glyphs in other fonts in the font manager.

### drawEstring

    public abstract void drawEstring(java.awt.Graphics2D g,
                                     java.lang.String estr,
                                     float x,
                                     float y,
                                     long layout,
                                     int mode,
                                     java.awt.Color strokecolor)

  Draws string str in font's encoding at (x,y) in drawing mode mode. For good results, set the `RenderingHints.KEY_ANTIALIASING` hint on the `Graphics2D`.

### strFlags

    public static java.lang.String strFlags(int flags)

  Decodes flag bit positions into humand-readable string.

### strWeight

    public static java.lang.String strWeight(int weight)

### strRights

    public static java.lang.String strRights(int rights)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getMultiplex

    protected static com.pt.io.RandomAccessMultiplex getMultiplex()

  Returns file descriptor multiplexer shared among all `NFont`s. Applications can use many fonts, requiring many file descriptors. Fonts should share file descriptors, taking as needed and releasing when possible, so as not to exhaust the system.

### getLogger

    public static java.util.logging.Logger getLogger()

  Interesting events are logged to this logger , at the following use of logging levels: `Level.CONFIG` font path, fonts found; `Level.FINE` font creation.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD