Package com.inductiveautomation.snap.gfx
Class SnapFontFile
- java.lang.Object
-
- com.inductiveautomation.snap.gfx.SnapFontFile
-
public class SnapFontFile extends java.lang.ObjectThis class represents all the information about a font that is independent of size. This allows SnapFont to be lighter weight (essentially just a font file at a given size).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDisplay(char aChar)Returns if this font can display the given char.doublecharAdvance(char aChar)Returns the char advance for the given char.doublecharKern(char aChar1, char aChar2)Returns the kerning for the given pair of characters (no way to do this in Java!).SnapFontFilegetBold()Returns the bold version of this font.java.lang.StringgetFamily()Returns the family name of this font.java.lang.StringgetFamilyEnglish()Returns the family name of this font in English.static SnapFontFilegetFontFile(java.lang.String aName)Returns a font file for a given font name.java.lang.StringgetFontName()Returns the name of this font.java.lang.StringgetFontNameEnglish()Returns the name of this font in English.doublegetHeight()Returns the height of this font file.SnapFontFilegetItalic()Returns the italic version of this font.doublegetLeading()Returns the default distance between lines for this font.doublegetLineAdvance()Returns the distance from the top of a line of text to the to top of a successive line of text.doublegetLineHeight()Returns the height of a line of text in this font.doublegetMaxAdvance()Returns the max advance of characters in this font.doublegetMaxAscent()Returns the max distance above the baseline that this font goes.doublegetMaxDescent()Returns the max distance below the baseline that this font goes.java.lang.StringgetPSName()Returns the PostScript name of this font.doublegetStrikethroughOffset()Returns the distance above the baseline that a strikethrough should be drawn.doublegetUnderlineOffset()Returns the distance below the baseline that an underline should be drawn.doublegetUnderlineThickness()Returns the default thickness that an underline should be drawn.booleanisBold()Returns whether this font is considered bold.booleanisItalic()Returns whether this font is considered italic.java.lang.StringtoString()Returns the font name of this font file.
-
-
-
Method Detail
-
getFontFile
public static SnapFontFile getFontFile(java.lang.String aName)
Returns a font file for a given font name.
-
getFontName
public java.lang.String getFontName()
Returns the name of this font.
-
getFontNameEnglish
public java.lang.String getFontNameEnglish()
Returns the name of this font in English.
-
getFamily
public java.lang.String getFamily()
Returns the family name of this font.
-
getFamilyEnglish
public java.lang.String getFamilyEnglish()
Returns the family name of this font in English.
-
getPSName
public java.lang.String getPSName()
Returns the PostScript name of this font.
-
charAdvance
public double charAdvance(char aChar)
Returns the char advance for the given char.
-
charKern
public double charKern(char aChar1, char aChar2)Returns the kerning for the given pair of characters (no way to do this in Java!).
-
getMaxAscent
public double getMaxAscent()
Returns the max distance above the baseline that this font goes.
-
getMaxDescent
public double getMaxDescent()
Returns the max distance below the baseline that this font goes.
-
getLeading
public double getLeading()
Returns the default distance between lines for this font.
-
getHeight
public double getHeight()
Returns the height of this font file.
-
getLineHeight
public double getLineHeight()
Returns the height of a line of text in this font.
-
getLineAdvance
public double getLineAdvance()
Returns the distance from the top of a line of text to the to top of a successive line of text.
-
getMaxAdvance
public double getMaxAdvance()
Returns the max advance of characters in this font.
-
getUnderlineOffset
public double getUnderlineOffset()
Returns the distance below the baseline that an underline should be drawn.
-
getUnderlineThickness
public double getUnderlineThickness()
Returns the default thickness that an underline should be drawn.
-
getStrikethroughOffset
public double getStrikethroughOffset()
Returns the distance above the baseline that a strikethrough should be drawn.
-
isBold
public boolean isBold()
Returns whether this font is considered bold.
-
isItalic
public boolean isItalic()
Returns whether this font is considered italic.
-
canDisplay
public boolean canDisplay(char aChar)
Returns if this font can display the given char.
-
getBold
public SnapFontFile getBold()
Returns the bold version of this font.
-
getItalic
public SnapFontFile getItalic()
Returns the italic version of this font.
-
toString
public java.lang.String toString()
Returns the font name of this font file.- Overrides:
toStringin classjava.lang.Object
-
-