Class OPIFont

java.lang.Object
org.csstudio.opibuilder.util.OPIFont

public class OPIFont extends Object
The dedicated font type which supports predefined font name in OPI builder font file. If the font name doesn't exist in the font file, the system font will be adopted.
  • Field Details

  • Constructor Details

    • OPIFont

      public OPIFont(String name, FontData fontData)
    • OPIFont

      public OPIFont(FontData fontData)
    • OPIFont

      public OPIFont(OPIFont opiFont)
  • Method Details

    • getFontMacroName

      public String getFontMacroName()
      Returns the Macro Name of the OPIFont.
      Returns:
      the predefined font macro name or flattened font data string if it is not predefined.
    • getFontName

      public String getFontName()
      Returns the name of the Font. On platforms that support font foundries, the return value will be the foundry followed by a dash ("-") followed by the face name.
      Returns:
      the name of the font
    • getHeight

      public int getHeight()
      Returns the height of the font in either fonts or pixels depending on the value of sizeInPixels.
      Returns:
      the height of the font.
    • getStyle

      public int getStyle()
      Returns the style of the receiver which is a bitwise OR of one or more of the SWT constants NORMAL(0), BOLD(2) and ITALIC(1).
      Returns:
      the style of the font.
    • getFontData

      public FontData getFontData()
      Return the FontData, scaled according to whether its size represents pixels or points. This may be called only on the UI thread, since it uses the SWT Display to do the scaling.
      Returns:
      the scaled FontData
    • getRawFontData

      public FontData getRawFontData()
      Return the raw FontData, not scaled.
      Returns:
      the raw FontData.
    • getSWTFont

      public Font getSWTFont()
      Return the appropriately-scaled SWT font.
      Returns:
      scaled SWT font
    • isPreDefined

      public boolean isPreDefined()
      Returns:
      true if this font is predefined in font file, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • setSizeInPixels

      public void setSizeInPixels(boolean sizeInPixels)
    • isSizeInPixels

      public boolean isSizeInPixels()