org.gnu.pango

Class FontDescription

public class FontDescription extends Boxed

Deprecated: This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may exist in java-gnome 4.0; look out for org.gnome.pango.FontDescription. As this package was never fully implemented in java-gnome 2.x, however, any new code written will have a considerably different public API.

The FontDescription represents the description of an ideal font. This is used both to list what fonts are available on the system and also for specifying the characteristics of a font to load.
Constructor Summary
FontDescription(Handle handle)
Create a new FontDescription using a handle from native methods.
FontDescription()
Create a new FontDescription.
FontDescription(String str)
Create a new FontDescription from a string in the form "[FAMILY-LIST][STYLE-OPTIONS][SIZE]" where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE-OPTIONS is a whitespace separated list of words where each WORD describes one of style, varient, weight, or stretch and SIZE is a decimal number (size in points).
FontDescription(FontDescription fd)
Create a new FontDescription that is a copy of the provided FontDescription.
Method Summary
booleanbetterMatch(FontDescription oldMatch, FontDescription newMatch)
Determines if the style attributes of newMatch are a closer match for this FontDescription than oldMatch, or if oldMatch is null, determines if newMatch is a match at all.
booleanequal(FontDescription fd)
Compares two FontDescriptions for equality.
StringgetFamily()
Gets the family name field of a font description.
FontMaskgetSetFields()
Determines which fields in a font description have been set.
intgetSize()
Gets the size field of a font description.
StretchgetStretch()
Gets the stretch field of a font description.
StylegetStyle()
Gets the style field of a PangoFontDescription.
VariantgetVariant()
Gets the variant field of the description.
WeightgetWeight()
Gets the weight field of a font description.
inthash()
Create a hash of this object.
voidreplace(FontDescription descToMerge, boolean replaceExisting)
Merges the fields that are set in desc_to_merge into the fields in desc.
voidsetFamily(String family)
Sets the family name field of a font description.
voidsetSize(int size)
Sets the size field of a font description.
voidsetStretch(Stretch stretch)
Sets the stretch field of a font description.
voidsetStyle(Style style)
Sets the style field of a PangoFontDescription.
voidsetVariant(Variant var)
Sets the variant field of a font description.
voidsetWeight(Weight weight)
Sets the weight field of a font description.
StringtoFilename()
Creates a filename representation of a font description.
StringtoString()
Creates a string representation of a font description.
voidunsetFields(FontMask mask)
Unset some of the fields in this FontDescription.

Constructor Detail

FontDescription

public FontDescription(Handle handle)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a new FontDescription using a handle from native methods. This should only be used internally by java-gnome.

FontDescription

public FontDescription()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a new FontDescription.

FontDescription

public FontDescription(String str)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a new FontDescription from a string in the form "[FAMILY-LIST][STYLE-OPTIONS][SIZE]" where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE-OPTIONS is a whitespace separated list of words where each WORD describes one of style, varient, weight, or stretch and SIZE is a decimal number (size in points). Any one of the options may be absent.

Parameters: str The string representation for the font description.

FontDescription

public FontDescription(FontDescription fd)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a new FontDescription that is a copy of the provided FontDescription.

Parameters: fd

Method Detail

betterMatch

public boolean betterMatch(FontDescription oldMatch, FontDescription newMatch)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Determines if the style attributes of newMatch are a closer match for this FontDescription than oldMatch, or if oldMatch is null, determines if newMatch is a match at all.

Parameters: oldMatch newMatch

equal

public boolean equal(FontDescription fd)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Compares two FontDescriptions for equality.

Parameters: fd

Returns: ture if the two FontDescriptions are proveably identical.

getFamily

public String getFamily()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the family name field of a font description.

getSetFields

public FontMask getSetFields()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Determines which fields in a font description have been set.

getSize

public int getSize()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the size field of a font description.

getStretch

public Stretch getStretch()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the stretch field of a font description.

getStyle

public Style getStyle()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the style field of a PangoFontDescription.

getVariant

public Variant getVariant()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the variant field of the description.

getWeight

public Weight getWeight()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Gets the weight field of a font description.

hash

public int hash()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Create a hash of this object.

replace

public void replace(FontDescription descToMerge, boolean replaceExisting)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Merges the fields that are set in desc_to_merge into the fields in desc. If replace_existing is FALSE, only fields in desc that are not already set are affected. If TRUE, then fields that are already set will be replaced as well.

setFamily

public void setFamily(String family)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the family name field of a font description. The family name represents a family of related font styles, and will resolve to a particular PangoFontFamily. In some uses of PangoFontDescription, it is also possible to use a comma separated list of family names for this field.

setSize

public void setSize(int size)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the size field of a font description.

setStretch

public void setStretch(Stretch stretch)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the stretch field of a font description. The stretch field specifies how narrow or wide the font should be.

setStyle

public void setStyle(Style style)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the style field of a PangoFontDescription. The PangoStyle enumeration describes whether the font is slanted and the manner in which it is slanted; it can be either Style.NORMAL, Style.ITALIC, or Style.OBLIQUE. Most fonts will either have a italic style or an oblique style, but not both, and font matching in Pango will match italic specifications with oblique fonts and vice-versa if an exact match is not found.

setVariant

public void setVariant(Variant var)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the variant field of a font description. The Variant can either be Variant.NORMAL or Variant.SMALL_CAPS.

setWeight

public void setWeight(Weight weight)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Sets the weight field of a font description. The weight field specifies how bold or light the font should be.

toFilename

public String toFilename()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Creates a filename representation of a font description. The filename is identical to the results of calling toString, but with underscores instead of characters that are untypical in filenames, and in lower case only.

toString

public String toString()

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Creates a string representation of a font description.

unsetFields

public void unsetFields(FontMask mask)

Deprecated: Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.

Unset some of the fields in this FontDescription.

Parameters: mask