APIdia Launch Partner
Top Fields Constructors Methods
sun.font

public abstract Class Font2D

extends Object
Class Inheritance
Known Direct Subclasses
sun.font.PhysicalFont, sun.font.CompositeFont
Imports
java.awt.Font, java.awt.font.FontRenderContext, java.awt.geom.AffineTransform, java.lang.ref.Reference, .SoftReference, .WeakReference, java.util.concurrent.ConcurrentHashMap, java.util.Locale, .Set

Field Summary

Modifier and TypeField and Description
private static final String[]
private static final String[]
private static final FontRenderContext
public static final int
protected FontFamily
protected String
public static final int
protected int
protected String
public static final int
public static final int
public static final int
public Font2DHandle
private static final String[]
public static final int
protected Reference<FontStrike>
protected CharToGlyphMapper
public static final int
protected ConcurrentHashMap<FontStrikeDesc, Reference<FontStrike>>
private int
protected int
public static final int
public static final int
public static final int
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDisplay(char c)

public boolean
canDisplay(int cp)

public boolean
canDoStyle(int style)

public int
charToGlyph(int wchar)

public int
charToGlyphRaw(int wchar)

public int
charToVariationGlyph(int wchar, int variationSelector)

public int
charToVariationGlyphRaw(int wchar, int variationSelector)

pack-priv abstract FontStrike
public byte
public String
public void
getFontMetrics(Font font, AffineTransform at, Object aaHint, Object fmHint, float[] metrics)

The length of the metrics array must be >= 8.

public void
getFontMetrics(Font font, FontRenderContext frc, float[] metrics)

The length of the metrics array must be >= 4.

public String
public float
getItalicAngle(Font font, AffineTransform at, Object aaHint, Object fmHint)

pack-priv abstract CharToGlyphMapper
public int
public int
protected long
public String
pack-priv int
public FontStrike
public FontStrike
getStrike(Font font, AffineTransform devTx, int aa, int fm)

public FontStrike
getStrike(Font font, AffineTransform devTx, AffineTransform glyphTx, int aa, int fm)

public FontStrike
pack-priv FontStrike
private FontStrike
getStrike(FontStrikeDesc desc, boolean copy)

public int
public void
getStyleMetrics(float pointSize, float[] metrics, int offset)

The length of the metrics array must be >= offset+4, and offset must be >= 0.

protected byte[]
getTableBytes(int tag)

protected long
protected int
getValidatedGlyphCode(int glyphCode)

public int
public int
public boolean
pack-priv void
setRank(int rank)

protected void
pack-priv void
setUseWeakRefs(boolean weak, int maxStrikes)

pack-priv boolean
pack-priv void
public boolean
useAAForPtSize(int ptsize)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boldItalicNamesback to summary
private static final String[] boldItalicNames
boldNamesback to summary
private static final String[] boldNames
DEFAULT_FRCback to summary
private static final FontRenderContext DEFAULT_FRC
DEFAULT_RANKback to summary
public static final int DEFAULT_RANK
familyback to summary
protected FontFamily family
familyNameback to summary
protected String familyName
FONT_CONFIG_RANKback to summary
public static final int FONT_CONFIG_RANK
fontRankback to summary
protected int fontRank
fullNameback to summary
protected String fullName
FWEIGHT_BOLDback to summary
public static final int FWEIGHT_BOLD
FWEIGHT_NORMALback to summary
public static final int FWEIGHT_NORMAL
FWIDTH_NORMALback to summary
public static final int FWIDTH_NORMAL
handleback to summary
public Font2DHandle handle
italicNamesback to summary
private static final String[] italicNames
JRE_RANKback to summary
public static final int JRE_RANK
lastFontStrikeback to summary
protected Reference<FontStrike> lastFontStrike
mapperback to summary
protected CharToGlyphMapper mapper
NATIVE_RANKback to summary
public static final int NATIVE_RANK
strikeCacheback to summary
protected ConcurrentHashMap<FontStrikeDesc, Reference<FontStrike>> strikeCache
strikeCacheMaxback to summary
private int strikeCacheMax
styleback to summary
protected int style
TTF_RANKback to summary
public static final int TTF_RANK
TYPE1_RANKback to summary
public static final int TYPE1_RANK
UNKNOWN_RANKback to summary
public static final int UNKNOWN_RANK
useWeakback to summary
private boolean useWeak

Constructor Detail

Font2Dback to summary
public Font2D()

Method Detail

canDisplayback to summary
public boolean canDisplay(char c)
canDisplayback to summary
public boolean canDisplay(int cp)
canDoStyleback to summary
public boolean canDoStyle(int style)
charToGlyphback to summary
public int charToGlyph(int wchar)
charToGlyphRawback to summary
public int charToGlyphRaw(int wchar)
charToVariationGlyphback to summary
public int charToVariationGlyph(int wchar, int variationSelector)
charToVariationGlyphRawback to summary
public int charToVariationGlyphRaw(int wchar, int variationSelector)
createStrikeback to summary
pack-priv abstract FontStrike createStrike(FontStrikeDesc desc)
getBaselineForback to summary
public byte getBaselineFor(char c)
getFamilyNameback to summary
public String getFamilyName(Locale l)
getFontMetricsback to summary
public void getFontMetrics(Font font, AffineTransform at, Object aaHint, Object fmHint, float[] metrics)

The length of the metrics array must be >= 8. This method will store the following elements in that array before returning: metrics[0]: ascent metrics[1]: descent metrics[2]: leading metrics[3]: max advance metrics[4]: strikethrough offset metrics[5]: strikethrough thickness metrics[6]: underline offset metrics[7]: underline thickness

getFontMetricsback to summary
public void getFontMetrics(Font font, FontRenderContext frc, float[] metrics)

The length of the metrics array must be >= 4. This method will store the following elements in that array before returning: metrics[0]: ascent metrics[1]: descent metrics[2]: leading metrics[3]: max advance

getFontNameback to summary
public String getFontName(Locale l)
getItalicAngleback to summary
public float getItalicAngle(Font font, AffineTransform at, Object aaHint, Object fmHint)
getMapperback to summary
pack-priv abstract CharToGlyphMapper getMapper()
getMissingGlyphCodeback to summary
public int getMissingGlyphCode()
getNumGlyphsback to summary
public int getNumGlyphs()
getPlatformNativeFontPtrback to summary
protected long getPlatformNativeFontPtr()
getPostscriptNameback to summary
public String getPostscriptName()
getRankback to summary
pack-priv int getRank()
getStrikeback to summary
public FontStrike getStrike(Font font)
getStrikeback to summary
public FontStrike getStrike(Font font, AffineTransform devTx, int aa, int fm)
getStrikeback to summary
public FontStrike getStrike(Font font, AffineTransform devTx, AffineTransform glyphTx, int aa, int fm)
getStrikeback to summary
public FontStrike getStrike(Font font, FontRenderContext frc)
getStrikeback to summary
pack-priv FontStrike getStrike(FontStrikeDesc desc)
getStrikeback to summary
private FontStrike getStrike(FontStrikeDesc desc, boolean copy)
getStyleback to summary
public int getStyle()
getStyleMetricsback to summary
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.

getTableBytesback to summary
protected byte[] getTableBytes(int tag)
getUnitsPerEmback to summary
protected long getUnitsPerEm()
getValidatedGlyphCodeback to summary
protected int getValidatedGlyphCode(int glyphCode)
getWeightback to summary
public int getWeight()
getWidthback to summary
public int getWidth()
hasSupplementaryCharsback to summary
public boolean hasSupplementaryChars()
setRankback to summary
pack-priv void setRank(int rank)
setStyleback to summary
protected void setStyle()
setUseWeakRefsback to summary
pack-priv void setUseWeakRefs(boolean weak, int maxStrikes)
supportsEncodingback to summary
pack-priv boolean supportsEncoding(String encoding)
updateLastStrikeRefback to summary
pack-priv void updateLastStrikeRef(FontStrike strike)
useAAForPtSizeback to summary
public boolean useAAForPtSize(int ptsize)