Package com.inductiveautomation.rm.text
Class RMFont
java.lang.Object
com.inductiveautomation.rm.text.RMFont
- All Implemented Interfaces:
- Archivable
This class represents a font for use in rich text. Currently this is necessary because Java fonts are missing
 so much basic typographic information.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionawt()Returns the AWT font for this font.booleancanDisplay(char aChar) Returns if this font can display the given char.doublecharAdvance(char aChar) Returns the char advance for the given char.charBounds(char aChar) Returns the bounds for a given character.doublecharKern(char aChar1, char aChar2) Returns the kerning for the given pair of characters (no way to do this in Java!).charPath(char c) Returns the path for a given character.deriveFont(double aPointSize) Returns a font with the same family as the receiver but with the given size.booleanStandard equals implementation.fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.getBold()Returns the bold version of this font.static RMFontReturns the user's default font.Returns the family name of this font.Returns the family name of this font in English.static RMFontReturns the font for the given name and size (substitutes Arial if not found).static RMFontDeprecated.Returns the font file for this font.Returns the name of this font.Returns the name of this font in English.intdoubleReturns the height of this font.Returns the italic version of this font.doubleReturns the default distance between lines for this font.doubleReturns the distance from the top of a line of text to the to top of a successive line of text.doubleReturns the height for a line of text in this font.doubleReturns the max distance above the baseline that this font goes.doubleReturns the max distance below the baseline that this font goes.Returns the PostScript name of this font.doublegetSize()Returns the font size of this font.doubleReturns the distance above the baseline that a strikethrough should be drawn.doubleReturns the distance below the baseline that an underline should be drawn.doubleReturns 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.booleanReturns whether font had to substitute because name wasn't found.scaleFont(double aScale) Returns a font with the same family as the receiver but with size adjusted by given scale factor.doublestringAdvance(String aString) Returns the horizontal distance spanned by the given string when rendered in this font.toggleStyle(int style) Returns a new RMFont with style toggled.toString()Returns the font name, size and family for this font.toXML(RXArchiver anArchiver) XML archival.
- 
Field Details- 
Helvetica10
- 
Helvetica12
- 
Helvetica14
 
- 
- 
Constructor Details- 
RMFontpublic RMFont()Creates an empty font (really only used for unarchival).
- 
RMFontDeprecated.Returns the font for the given name and size.
- 
RMFont
 
- 
- 
Method Details- 
getFontDeprecated.Returns the font for the given name and size (substitutes Arial if not found).
- 
getFontReturns the font for the given name and size (substitutes Arial if not found).
- 
getDefaultFontReturns the user's default font.
- 
getFontNameReturns the name of this font.
- 
getFontNameEnglishReturns the name of this font in English.
- 
getLogicalName
- 
getFontStylepublic int getFontStyle()
- 
getSizepublic double getSize()Returns the font size of this font.
- 
getFamilyReturns the family name of this font.
- 
getFamilyEnglishReturns the family name of this font in English.
- 
getPSNameReturns the PostScript name of this font.
- 
getFontFileReturns the font file for this font.
- 
charAdvancepublic double charAdvance(char aChar) Returns the char advance for the given char.
- 
charKernpublic double charKern(char aChar1, char aChar2) Returns the kerning for the given pair of characters (no way to do this in Java!).
- 
charPathReturns the path for a given character.
- 
charBoundsReturns the bounds for a given character.
- 
stringAdvanceReturns the horizontal distance spanned by the given string when rendered in this font.
- 
getMaxAscentpublic double getMaxAscent()Returns the max distance above the baseline that this font goes.
- 
getMaxDescentpublic double getMaxDescent()Returns the max distance below the baseline that this font goes.
- 
getLeadingpublic double getLeading()Returns the default distance between lines for this font.
- 
getHeightpublic double getHeight()Returns the height of this font.
- 
getLineHeightpublic double getLineHeight()Returns the height for a line of text in this font.
- 
getLineAdvancepublic double getLineAdvance()Returns the distance from the top of a line of text to the to top of a successive line of text.
- 
getUnderlineOffsetpublic double getUnderlineOffset()Returns the distance below the baseline that an underline should be drawn.
- 
getUnderlineThicknesspublic double getUnderlineThickness()Returns the default thickness that an underline should be drawn.
- 
getStrikethroughOffsetpublic double getStrikethroughOffset()Returns the distance above the baseline that a strikethrough should be drawn.
- 
isBoldpublic boolean isBold()Returns whether this font is considered bold.
- 
isItalicpublic boolean isItalic()Returns whether this font is considered italic.
- 
isSubstitutepublic boolean isSubstitute()Returns whether font had to substitute because name wasn't found.
- 
canDisplaypublic boolean canDisplay(char aChar) Returns if this font can display the given char.
- 
getBoldReturns the bold version of this font.
- 
getItalicReturns the italic version of this font.
- 
toggleStyleReturns a new RMFont with style toggled.
- 
deriveFontReturns a font with the same family as the receiver but with the given size.
- 
scaleFontReturns a font with the same family as the receiver but with size adjusted by given scale factor.
- 
equalsStandard equals implementation.
- 
toXMLXML archival.- Specified by:
- toXMLin interface- Archivable
 
- 
fromXMLXML unarchival.- Specified by:
- fromXMLin interface- Archivable
 
- 
toStringReturns the font name, size and family for this font.
- 
awtReturns the AWT font for this font.
 
-