Package org.csstudio.opibuilder.util
Class OPIFont
java.lang.Object
org.csstudio.opibuilder.util.OPIFont
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return the FontData, scaled according to whether its size represents pixels or points.Returns the Macro Name of the OPIFont.Returns the name of the Font.int
Returns the height of the font in either fonts or pixels depending on the value of sizeInPixels.Return the raw FontData, not scaled.int
getStyle()
Returns the style of the receiver which is a bitwise OR of one or more of theSWT
constants NORMAL(0), BOLD(2) and ITALIC(1).Return the appropriately-scaled SWT font.int
hashCode()
boolean
boolean
void
setSizeInPixels
(boolean sizeInPixels) toString()
-
Field Details
-
POINTS_PER_INCH
public static final int POINTS_PER_INCH- See Also:
-
-
Constructor Details
-
OPIFont
-
OPIFont
-
OPIFont
-
-
Method Details
-
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
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 theSWT
constants NORMAL(0), BOLD(2) and ITALIC(1).- Returns:
- the style of the font.
-
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
Return the raw FontData, not scaled.- Returns:
- the raw FontData.
-
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
-
hashCode
public int hashCode() -
equals
-
setSizeInPixels
public void setSizeInPixels(boolean sizeInPixels) -
isSizeInPixels
public boolean isSizeInPixels()
-