Methods Summary |
---|
public abstract boolean | canDisplay(char c)Returns true if this FontPeerImpl can display the specified char
|
public int | charWidth(char ch)Returns the advance width of the specified char of this FontPeerImpl.
Note, if glyph is absent in the font's glyphset - returned value
is the advance of the deafualt glyph. For escape-chars returned
width value is 0.
Paint p;
AndroidGraphics2D g = AndroidGraphics2D.getInstance();
if(g == null) {
throw new RuntimeException("AndroidGraphics2D not instantiated!");
}
p = ((AndroidGraphics2D)g).getAndroidPaint();
char[] ca = {ch};
float[] fa = new float[1];
p.getTextWidths(ca, 0, 1, fa);
return (int)fa[0];
|
public int | charWidth(int ind)Returns the advance width of the specified char of this FontPeerImpl.
return charWidth((char)ind);
|
public abstract void | dispose()Disposes nesessary resources.
|
protected void | finalize()Sets new font type to the font object.
super.finalize();
dispose();
|
public int | getAscent()Returns ascent of this font peer.
Paint p;
AndroidGraphics2D g = AndroidGraphics2D.getInstance();
if(g == null) {
throw new RuntimeException("AndroidGraphics2D not instantiated!");
}
p = ((AndroidGraphics2D)g).getAndroidPaint();
return (int)p.ascent();
//return ascent;
|
public abstract Glyph | getDefaultGlyph()Returns Glyph represeting missing char.
|
public int | getDescent()Returns descent of this font peer.
return descent;
|
public abstract FontExtraMetrics | getExtraMetrics()
|
public java.lang.String | getFamily(java.util.Locale l)Returns family name of the font in specified locale settings.
return this.getFamily();
|
public java.lang.String | getFamily()Returns family name of this FontPeerImpl.
return fontFamilyName;
|
public long | getFontHandle()Returns native font handle of this font peer.
return pFont;
|
public java.lang.String | getFontName(java.util.Locale l)Returns face name of the font in specified locale settings.
return this.getFontName();
|
public java.lang.String | getFontName()Returns face name of this FontPeerImpl.
if (this.fontType == FontManager.FONT_TYPE_T1){
return this.fontFamilyName;
}
return faceName;
|
public int | getFontType()Returns type of this font.
return fontType;
|
public abstract Glyph | getGlyph(char ch)Returns Glyph representation of the given char.
|
public Glyph[] | getGlyphs(char uFirst, char uLast)Returns an array of Glyphs that represent characters from the specified
Unicode range.
char i = uFirst;
int len = uLast - uFirst;
ArrayList<Glyph> lst = new ArrayList<Glyph>(len);
if (size < 0) {
// awt.09=min range bound value is greater than max range bound
throw new IllegalArgumentException(Messages.getString("awt.09")); //$NON-NLS-1$
}
while (i < uLast) {
lst.add(this.getGlyph(i));
}
return (Glyph[]) lst.toArray();
|
public Glyph[] | getGlyphs(char[] chars)Returns an array of Glyphs representing given array of chars.
if (chars == null){
return null;
}
Glyph[] result = new Glyph[chars.length];
for (int i = 0; i < chars.length; i++) {
result[i] = this.getGlyph(chars[i]);
}
return result;
|
public Glyph[] | getGlyphs(java.lang.String str)Returns an array of Glyphs representing given string.
char[] chars = str.toCharArray();
return this.getGlyphs(chars);
|
public float | getHeight()Returns height of this font peer.
return height;
|
public float | getItalicAngle()Returns tangens of the italic angle of this FontPeerImpl.
If the FontPeerImpl has TrueType font type, italic angle value can be
calculated as (CharSlopeRun / CharSlopeRise) in terms of GDI.
return italicAngle;
|
public int | getLeading()Returns leading of this font peer.
return leading;
|
public abstract java.awt.font.LineMetrics | getLineMetrics(java.lang.String str, java.awt.font.FontRenderContext frc, java.awt.geom.AffineTransform at)Returns LineMetrics object with specified parameters
|
public java.awt.font.LineMetrics | getLineMetrics()Returns cached LineMetrics object of this font peer.
return nlm;
|
public int | getLogicalHeight()Returns height of this font peer in pixels.
return logicalHeight;
|
public java.awt.geom.Rectangle2D | getMaxCharBounds(java.awt.font.FontRenderContext frc)Returns the bounds of the largest char in this FontPeerImpl in
specified render context.
return maxCharBounds;
|
public abstract int | getMissingGlyphCode()Returns code of the missing glyph.
|
public java.lang.String | getName()Returns font name.
return name;
|
public int | getNumGlyphs()Returns the number of glyphs in this FontPeerImpl.
return numGlyphs;
|
public abstract java.lang.String | getPSName()Returns postscript name of the font.
|
public int | getSize()Returns font size.
return size;
|
public int | getStyle()Returns font style.
return style;
|
public java.lang.String | getTempFontFileName()Returns font file name of this font.
return this.tempFontFileName;
|
public boolean | hasUniformLineMetrics()Returns true if this font peer has uniform line metrics.
return uniformLM;
|
public boolean | isCreatedFromStream()Returns true, if this font peer was created from InputStream, false otherwise.
In case of creating fonts from InputStream some font peer implementations
may need to free temporary resources.
return this.createdFromStream;
|
public void | setCreatedFromStream(boolean value)Sets createdFromStream flag to the specified parameter.
If parameter is true it means font peer was created from InputStream.
this.createdFromStream = value;
|
public void | setFamily(java.lang.String familyName)Sets family name of the font in specified locale settings.
this.fontFamilyName = familyName;
|
public void | setFontFileName(java.lang.String value)Sets font file name of this font to the specified one.
this.tempFontFileName = value;
|
public void | setFontName(java.lang.String fontName)Sets font name of the font in specified locale settings.
this.faceName = fontName;
|
public void | setFontType(int newType)Sets new font type to the font object.
if (newType == FontManager.FONT_TYPE_T1 || newType == FontManager.FONT_TYPE_TT){
fontType = newType;
}
|
public void | setLogicalHeight(int newHeight)Sets height of this font peer in pixels to the given value.
logicalHeight = newHeight;
|
public void | setPSName(java.lang.String name)Set postscript name of the font to the specified parameter.
//private Graphics2D g = ((AndroidGraphicsFactory)Toolkit.getDefaultToolkit().getGraphicsFactory()).getGraphics2D();
//private Graphics2D g = AndroidGraphics2D.getInstance();
this.psName = name;
|