APIdia Launch Partner
Top Fields Constructors Methods
com.sun.java.swing.plaf.gtk

pack-priv Class PangoFonts

extends Object
Class Inheritance
Imports
java.awt.*, java.awt.geom.AffineTransform, javax.swing.plaf.FontUIResource, java.util.StringTokenizer, sun.font.FontConfigManager, .FontUtilities

Authors
Shannon Hickey, Leif Samuelsson

Field Summary

Modifier and TypeField and Description
public static final String
private static double
fontScale

Calculate a default scale factor for fonts in this L&F; to match the reported resolution of the screen.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

the size of the font described by pangoName (e.g. if pangoName is "Sans Italic 10", then this method returns 10)
getFontSize
(String
a String describing a pango font
pangoName
)

Parses a String containing a pango font description and returns the (unscaled) font size as an integer.

pack-priv static Font

Returns:

a Font object as a FontUIResource or null if no suitable font could be created.
lookupFont
(String
a String describing a pango font e.g. "Sans Italic 10"
pangoName
)

Parses a String containing a pango font description and returns a Font object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHARS_DIGITSback to summary
public static final String CHARS_DIGITS
fontScaleback to summary
private static double fontScale

Calculate a default scale factor for fonts in this L&F to match the reported resolution of the screen. Java 2D specified a default user-space scale of 72dpi. This is unlikely to correspond to that of the real screen. The Xserver reports a value which may be used to adjust for this. and Java 2D exposes it via a normalizing transform. However many Xservers report a hard-coded 90dpi whilst others report a calculated value based on possibly incorrect data. That is something that must be solved at the X11 level Note that in an X11 multi-screen environment, the default screen is the one used by the JRE so it is safe to use it here.

Constructor Detail

PangoFontsback to summary
pack-priv PangoFonts()

Method Detail

getFontSizeback to summary
pack-priv static int getFontSize(String pangoName)

Parses a String containing a pango font description and returns the (unscaled) font size as an integer.

Parameters
pangoName:String

a String describing a pango font

Returns:int

the size of the font described by pangoName (e.g. if pangoName is "Sans Italic 10", then this method returns 10)

lookupFontback to summary
pack-priv static Font lookupFont(String pangoName)

Parses a String containing a pango font description and returns a Font object.

Parameters
pangoName:String

a String describing a pango font e.g. "Sans Italic 10"

Returns:Font

a Font object as a FontUIResource or null if no suitable font could be created.