Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.java.awt.peer.ClasspathFontPeer
State kept by the peer: a peer is generated for each Font
object in the default implementation. If you wish to share peers between
fonts, you will need to subclass both ClasspathFontPeer and
ClasspathToolKit
.
Thread Safety: Methods of this interface may be called
from arbitrary threads at any time. Implementations of the
ClasspathFontPeer
interface are required to perform
the necessary synchronization.
Field Summary | |
protected String | |
protected String | |
protected String |
|
protected float |
|
protected int |
|
protected AffineTransform |
|
Constructor Summary | |
| |
|
Method Summary | |
abstract boolean |
|
abstract int |
|
protected static void |
|
static void |
|
static void |
|
protected static void |
|
abstract GlyphVector |
|
abstract GlyphVector | |
Font |
|
Font |
|
Font |
|
Font |
|
Font |
|
Font |
|
protected static String |
|
Map<K,V> |
|
AttributedCharacterIterator.Attribute[] |
|
abstract byte |
|
String |
|
String |
|
abstract FontMetrics |
|
String |
|
String |
|
abstract String |
|
float |
|
abstract LineMetrics |
|
abstract Rectangle2D |
|
abstract int |
|
String |
|
abstract int |
|
abstract String |
|
float |
|
protected void |
|
int |
|
abstract String |
|
AffineTransform |
|
abstract boolean |
|
boolean |
|
boolean |
|
protected static boolean |
|
boolean |
|
boolean |
|
abstract GlyphVector |
|
protected static String | |
protected void |
|
protected void |
|
protected static ClasspathToolkit |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected String logicalName
The 3 names of this font. all fonts have 3 names, some of which may be equal: logical -- name the font was constructed from family -- a designer or brand name (Helvetica) face -- specific instance of a design (Helvetica Regular)
- See Also:
isLogicalFontName
protected int style
The font style, which is a combination (by OR-ing) of the font style constants PLAIN, BOLD and ITALIC, in this class.
protected AffineTransform transform
The affine transformation the font is currently subject to.
public abstract boolean canDisplay(Font font, int c)
Implementation ofFont.canDisplay(char)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract int canDisplayUpTo(Font font, CharacterIterator i, int start, int limit)
Implementation ofFont.canDisplay(String)
,Font.canDisplay(char [], int, int)
, andFont.canDisplay(CharacterIterator, int, int)
.
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
protected static void copyTransformToAttrs(AffineTransform trans, Map<K,V> attrs)
public abstract GlyphVector createGlyphVector(Font font, FontRenderContext ctx, int[] glyphCodes)
Implementation ofFont.createGlyphVector(FontRenderContext,int[])
.
- Parameters:
font
- the font object that the created GlyphVector will return when it gets asked for its font. This argument is needed because the public API ofGlyphVector
works withFont
, not with font peers.
public abstract GlyphVector createGlyphVector(Font font, FontRenderContext frc, CharacterIterator ci)
Implementation ofFont.createGlyphVector(FontRenderContext,String)
,Font.createGlyphVector(FontRenderContext,char[])
, andFont.createGlyphVector(FontRenderContext,CharacterIterator)
.
- Parameters:
font
- the font object that the created GlyphVector will return when it gets asked for its font. This argument is needed because the public API ofGlyphVector
works withFont
, not with font peers.
public Font deriveFont(Font font, float size)
Implementation ofFont.deriveFont(float)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Font deriveFont(Font font, int style)
Implementation ofFont.deriveFont(int)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Font deriveFont(Font font, int style, float size)
Implementation ofFont.deriveFont(int,float)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Font deriveFont(Font font, int style, AffineTransform t)
Implementation ofFont.deriveFont(int,AffineTransform)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Font deriveFont(Font font, AffineTransform t)
Implementation ofFont.deriveFont(AffineTransform)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Font deriveFont(Font font, Map<K,V> attrs)
Implementation ofFont.deriveFont(Map)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public Map<K,V> getAttributes(Font font)
Implementation ofFont.getAttributes()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public AttributedCharacterIterator.Attribute[] getAvailableAttributes(Font font)
Implementation ofFont.getAvailableAttributes()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract byte getBaselineFor(Font font, char c)
Implementation ofFont.getBaselineFor(char)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public String getFamily(Font font)
Implementation ofFont.getFamily()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public String getFamily(Font font, Locale lc)
Implementation ofFont.getFamily(Locale)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract FontMetrics getFontMetrics(Font font)
Implementation ofFont.getFontMetrics()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public String getFontName(Font font)
Implementation ofFont.getFontName()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public String getFontName(Font font, Locale lc)
Implementation ofFont.getFontName(Locale)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract String getGlyphName(Font font, int glyphIndex)
Returns a name for the specified glyph. This is useful for generating PostScript or PDF files that embed some glyphs of a font. If the implementation follows glyph naming conventions specified by Adobe, search engines can extract the original text from the generated PostScript and PDF files.This method is currently not used by GNU Classpath. However, it would be very useful for someone wishing to write a good PostScript or PDF stream provider for the
javax.print
package.Names are not unique: Under some rare circumstances, the same name can be returned for different glyphs. It is therefore recommended that printer drivers check whether the same name has already been returned for antoher glyph, and make the name unique by adding the string ".alt" followed by the glyph index.
This situation would occur for an OpenType or TrueType font that has a
post
table of format 3 and provides a mapping from glyph IDs to Unicode sequences through aZapf
table. If the same sequence of Unicode codepoints leads to different glyphs (depending on contextual position, for example, or on typographic sophistication level), the same name would get synthesized for those glyphs. To avoid this, the font peer would have to go through the names of all glyphs, which would make this operation very inefficient with large fonts.
- Parameters:
font
- the font containing the glyph whose name is requested.glyphIndex
- the glyph whose name the caller wants to retrieve.
- Returns:
- the glyph name, or
null
if a font does not provide glyph names.
public float getItalicAngle(Font font)
Implementation ofFont.getItalicAngle()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract LineMetrics getLineMetrics(Font font, CharacterIterator ci, int begin, int limit, FontRenderContext rc)
Implementation ofFont.getLineMetrics(CharacterIterator,int,int,FontRenderContext)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract Rectangle2D getMaxCharBounds(Font font, FontRenderContext rc)
Implementation ofFont.getMaxCharBounds(FontRenderContext)
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract int getMissingGlyphCode(Font font)
Implementation ofFont.getMissingGlyphCode()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public String getName(Font font)
Implementation ofFont.getName()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract int getNumGlyphs(Font font)
Implementation ofFont.getNumGlyphs()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract String getPostScriptName(Font font)
Implementation ofFont.getPSName()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public float getSize(Font font)
Implementation ofFont.getSize()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public int getStyle(Font font)
Implementation ofFont.getStyle()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract String getSubFamilyName(Font font, Locale locale)
Returns the name of this font face inside the family, for example “Light”.This method is currently not used by
Font
. However, this name would be needed by any serious desktop publishing application.
- Parameters:
font
- the font whose sub-family name is requested.locale
- the locale for which to localize the name. Iflocale
isnull
, the returned name is localized to the user’s default locale.
- Returns:
- the name of the face inside its family, or
null
if the font does not provide a sub-family name.
public AffineTransform getTransform(Font font)
Implementation ofFont.getTransform()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract boolean hasUniformLineMetrics(Font font)
Implementation ofFont.hasUniformLineMetrics()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public boolean isBold(Font font)
Implementation ofFont.isBold()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public boolean isItalic(Font font)
Implementation ofFont.isItalic()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public boolean isPlain(Font font)
Implementation ofFont.isPlain()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public boolean isTransformed(Font font)
Implementation ofFont.isTransformed()
- Parameters:
font
- the font this peer is being called from. This may be useful if you are sharing peers between Font objects. Otherwise it may be ignored.
public abstract GlyphVector layoutGlyphVector(Font font, FontRenderContext frc, char[] chars, int start, int limit, int flags)
Implementation ofFont.layoutGlyphVector(FontRenderContext,char[],int,int,int)
.
- Parameters:
font
- the font object that the created GlyphVector will return when it gets asked for its font. This argument is needed because the public API ofGlyphVector
works withFont
, not with font peers.
protected void setStandardAttributes(String name, String family, int style, float size, AffineTransform trans)