Package com.inductiveautomation.rm.text
Class RMFont
- java.lang.Object
- 
- com.inductiveautomation.rm.text.RMFont
 
- 
- All Implemented Interfaces:
- Archivable
 
 public class RMFont extends java.lang.Object implements 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 Modifier and Type Field Description static RMFontHelvetica10static RMFontHelvetica12static RMFontHelvetica14
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.awt.Fontawt()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.RMRectcharBounds(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!).RMPathcharPath(char c)Returns the path for a given character.RMFontderiveFont(double aPointSize)Returns a font with the same family as the receiver but with the given size.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.RMFontgetBold()Returns the bold version of this font.static RMFontgetDefaultFont()Returns the user's default font.java.lang.StringgetFamily()Returns the family name of this font.java.lang.StringgetFamilyEnglish()Returns the family name of this font in English.static RMFontgetFont(java.awt.Font aFont)Returns the font for the given name and size (substitutes Arial if not found).static RMFontgetFont(java.lang.String aName, double aSize)Deprecated.RMFontFilegetFontFile()Returns the font file for this font.java.lang.StringgetFontName()Returns the name of this font.java.lang.StringgetFontNameEnglish()Returns the name of this font in English.intgetFontStyle()doublegetHeight()Returns the height of this font.RMFontgetItalic()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 for a line of text in this font.java.lang.StringgetLogicalName()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.doublegetSize()Returns the font size 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.booleanisSubstitute()Returns whether font had to substitute because name wasn't found.RMFontscaleFont(double aScale)Returns a font with the same family as the receiver but with size adjusted by given scale factor.doublestringAdvance(java.lang.String aString)Returns the horizontal distance spanned by the given string when rendered in this font.RMFonttoggleStyle(int style)Returns a new RMFont with style toggled.java.lang.StringtoString()Returns the font name, size and family for this font.RXElementtoXML(RXArchiver anArchiver)XML archival.
 
- 
- 
- 
Method Detail- 
getFont@Deprecated public static RMFont getFont(java.lang.String aName, double aSize) Deprecated.Returns the font for the given name and size (substitutes Arial if not found).
 - 
getFontpublic static RMFont getFont(java.awt.Font aFont) Returns the font for the given name and size (substitutes Arial if not found).
 - 
getDefaultFontpublic static RMFont getDefaultFont() Returns the user's default font.
 - 
getFontNamepublic java.lang.String getFontName() Returns the name of this font.
 - 
getFontNameEnglishpublic java.lang.String getFontNameEnglish() Returns the name of this font in English.
 - 
getLogicalNamepublic java.lang.String getLogicalName() 
 - 
getFontStylepublic int getFontStyle() 
 - 
getSizepublic double getSize() Returns the font size of this font.
 - 
getFamilypublic java.lang.String getFamily() Returns the family name of this font.
 - 
getFamilyEnglishpublic java.lang.String getFamilyEnglish() Returns the family name of this font in English.
 - 
getPSNamepublic java.lang.String getPSName() Returns the PostScript name of this font.
 - 
getFontFilepublic RMFontFile getFontFile() Returns 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!).
 - 
charPathpublic RMPath charPath(char c) Returns the path for a given character.
 - 
charBoundspublic RMRect charBounds(char aChar) Returns the bounds for a given character.
 - 
stringAdvancepublic double stringAdvance(@Nonnull java.lang.String aString)Returns 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.
 - 
getBold@Nonnull public RMFont getBold() Returns the bold version of this font.
 - 
getItalic@Nonnull public RMFont getItalic() Returns the italic version of this font.
 - 
toggleStyle@Nonnull public RMFont toggleStyle(int style) Returns a new RMFont with style toggled.
 - 
deriveFontpublic RMFont deriveFont(double aPointSize) Returns a font with the same family as the receiver but with the given size.
 - 
scaleFontpublic RMFont scaleFont(double aScale) Returns a font with the same family as the receiver but with size adjusted by given scale factor.
 - 
equalspublic boolean equals(java.lang.Object anObj) Standard equals implementation.- Overrides:
- equalsin class- java.lang.Object
 
 - 
toXMLpublic RXElement toXML(RXArchiver anArchiver) XML archival.- Specified by:
- toXMLin interface- Archivable
 
 - 
fromXMLpublic java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement) XML unarchival.- Specified by:
- fromXMLin interface- Archivable
 
 - 
toStringpublic java.lang.String toString() Returns the font name, size and family for this font.- Overrides:
- toStringin class- java.lang.Object
 
 - 
awtpublic java.awt.Font awt() Returns the AWT font for this font.
 
- 
 
-