Package snap.swing
Class AWTFontFile
java.lang.Object
snap.gfx.FontFile
snap.swing.AWTFontFile
This class represents all the information about a font that is independent of size. This allows Font to be
lighter weight (essentially just a font file at a given size).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canDisplayImpl
(char aChar) Returns if this font can display the given char.protected double
charAdvanceImpl
(char aChar) Returns the char advance for the given char.double
Returns the max distance above the baseline that this font goes.protected Shape
getCharPathImpl
(char c) Returns the path for a given char at 1000pt.double
Returns the max distance below the baseline that this font goes.Returns the family name of this font.Returns the family name of this font in English.getGlyphBounds
(String aString) Returns the bounds rect for glyphs in given string.double
Returns the default distance between lines for this font.double
Returns the max advance of characters in this font.getName()
Returns the name of this font.Returns the name of this font in English.Returns the awt font.getNative
(double aSize) Returns the awt font.Returns the awt font.getOutline
(CharSequence aStr, double aSize, double aX, double aY, double aCharSpacing) Returns the path for given string in given point size with character spacing.Returns the PostScript name of this font.double
Returns the default thickness that an underline should be drawn.toString()
Returns the font name of this font file.Methods inherited from class snap.gfx.FontFile
canDisplay, charAdvance, getArialFontFile, getBold, getCharKern, getCharPath, getFontFile, getItalic, getLineAdvance, getLineHeight, getStrikethroughOffset, getUnderlineOffset, isBold, isItalic
-
Constructor Details
-
AWTFontFile
Creates a font file for a given font name.
-
-
Method Details
-
getName
Returns the name of this font. -
getNameEnglish
Returns the name of this font in English.- Overrides:
getNameEnglish
in classFontFile
-
getFamily
Returns the family name of this font. -
getFamilyEnglish
Returns the family name of this font in English.- Overrides:
getFamilyEnglish
in classFontFile
-
getPSName
Returns the PostScript name of this font. -
charAdvanceImpl
protected double charAdvanceImpl(char aChar) Returns the char advance for the given char.- Specified by:
charAdvanceImpl
in classFontFile
-
getGlyphBounds
Returns the bounds rect for glyphs in given string.- Specified by:
getGlyphBounds
in classFontFile
-
getCharPathImpl
Returns the path for a given char at 1000pt.- Specified by:
getCharPathImpl
in classFontFile
-
getOutline
Returns the path for given string in given point size with character spacing.- Overrides:
getOutline
in classFontFile
-
getAscent
public double getAscent()Returns the max distance above the baseline that this font goes. -
getDescent
public double getDescent()Returns the max distance below the baseline that this font goes.- Specified by:
getDescent
in classFontFile
-
getLeading
public double getLeading()Returns the default distance between lines for this font.- Specified by:
getLeading
in classFontFile
-
getMaxAdvance
public double getMaxAdvance()Returns the max advance of characters in this font.- Overrides:
getMaxAdvance
in classFontFile
-
getUnderlineThickness
public double getUnderlineThickness()Returns the default thickness that an underline should be drawn.- Overrides:
getUnderlineThickness
in classFontFile
-
canDisplayImpl
protected boolean canDisplayImpl(char aChar) Returns if this font can display the given char.- Overrides:
canDisplayImpl
in classFontFile
-
getNative
Returns the awt font. -
getNativeName
Returns the awt font.- Overrides:
getNativeName
in classFontFile
-
getNative
Returns the awt font. -
toString
Returns the font name of this font file.
-