org.gnu.pango

Class FontDescription


public class FontDescription
extends Boxed

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.

Field Summary

Fields inherited from class org.gnu.glib.Boxed

handle

Constructor Summary

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(Handle handle)
Create a new FontDescription using a handle from native methods.
FontDescription(FontDescription fd)
Create a new FontDescription that is a copy of the provided FontDescription.

Method Summary

boolean
betterMatch(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.
boolean
equal(FontDescription fd)
Compares two FontDescriptions for equality.
protected void
finalize()
String
getFamily()
Gets the family name field of a font description.
FontMask
getSetFields()
Determines which fields in a font description have been set.
int
getSize()
Gets the size field of a font description.
Stretch
getStretch()
Gets the stretch field of a font description.
Style
getStyle()
Gets the style field of a PangoFontDescription.
Variant
getVariant()
Gets the variant field of the description
Weight
getWeight()
Gets the weight field of a font description.
int
hash()
Create a hash of this object.
protected static boolean
pango_font_description_better_match(Handle desc, Handle oldMatch, Handle newMatch)
protected static Handle
pango_font_description_copy(Handle desc)
protected static boolean
pango_font_description_equal(Handle desc1, Handle desc2)
protected static void
pango_font_description_free(Handle desc)
protected static Handle
pango_font_description_from_string(String str)
protected static String
pango_font_description_get_family(Handle desc)
protected static int
pango_font_description_get_set_fields(Handle desc)
protected static int
pango_font_description_get_size(Handle desc)
protected static int
pango_font_description_get_stretch(Handle desc)
protected static int
pango_font_description_get_style(Handle desc)
protected static int
pango_font_description_get_type()
protected static int
pango_font_description_get_variant(Handle desc)
protected static int
pango_font_description_get_weight(Handle desc)
protected static int
pango_font_description_hash(Handle desc)
protected static void
pango_font_description_merge(Handle desc, Handle descToMerge, boolean replaceExisting)
protected static Handle
pango_font_description_new()
protected static void
pango_font_description_set_family(Handle desc, String family)
protected static void
pango_font_description_set_size(Handle desc, int size)
protected static void
pango_font_description_set_stretch(Handle desc, int stretch)
protected static void
pango_font_description_set_style(Handle desc, int style)
protected static void
pango_font_description_set_variant(Handle desc, int variant)
protected static void
pango_font_description_set_weight(Handle desc, int weight)
protected static String
pango_font_description_to_filename(Handle desc)
protected static String
pango_font_description_to_string(Handle desc)
protected static void
pango_font_description_unset_fields(Handle desc, int toUnset)
void
replace(FontDescription descToMerge, boolean replaceExisting)
Merges the fields that are set in desc_to_merge into the fields in desc.
void
setFamily(String family)
Sets the family name field of a font description.
void
setSize(int size)
Sets the size field of a font description.
void
setStretch(Stretch stretch)
Sets the stretch field of a font description.
void
setStyle(Style style)
Sets the style field of a PangoFontDescription.
void
setVariant(Variant var)
Sets the variant field of a font description.
void
setWeight(Weight weight)
Sets the weight field of a font description.
String
toFilename()
Creates a filename representation of a font description.
String
toString()
Creates a string representation of a font description.
void
unsetFields(FontMask mask)
Unset some of the fields in this FontDescription.

Methods inherited from class org.gnu.glib.Boxed

equals, getHandle, hashCode, setHandle

Constructor Details

FontDescription

public FontDescription()
Create a new FontDescription.


FontDescription

public 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). Any one of the options may be absent.

Parameters:
str - The string representation for the font description.


FontDescription

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


FontDescription

public FontDescription(FontDescription fd)
Create a new FontDescription that is a copy of the provided FontDescription.

Parameters:
fd -

Method Details

betterMatch

public boolean betterMatch(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.

Parameters:
oldMatch -
newMatch -


equal

public boolean equal(FontDescription fd)
Compares two FontDescriptions for equality.

Parameters:
fd -

Returns:
ture if the two FontDescriptions are proveably identical.


finalize

protected void finalize()
            throws Throwable


getFamily

public String getFamily()
Gets the family name field of a font description.


getSetFields

public FontMask getSetFields()
Determines which fields in a font description have been set.


getSize

public int getSize()
Gets the size field of a font description.


getStretch

public Stretch getStretch()
Gets the stretch field of a font description.


getStyle

public Style getStyle()
Gets the style field of a PangoFontDescription.


getVariant

public Variant getVariant()
Gets the variant field of the description


getWeight

public Weight getWeight()
Gets the weight field of a font description.


hash

public int hash()
Create a hash of this object.


pango_font_description_better_match

protected static final boolean pango_font_description_better_match(Handle desc,
                                                                   Handle oldMatch,
                                                                   Handle newMatch)


pango_font_description_copy

protected static final Handle pango_font_description_copy(Handle desc)


pango_font_description_equal

protected static final boolean pango_font_description_equal(Handle desc1,
                                                            Handle desc2)


pango_font_description_free

protected static final void pango_font_description_free(Handle desc)


pango_font_description_from_string

protected static final Handle pango_font_description_from_string(String str)


pango_font_description_get_family

protected static final String pango_font_description_get_family(Handle desc)


pango_font_description_get_set_fields

protected static final int pango_font_description_get_set_fields(Handle desc)


pango_font_description_get_size

protected static final int pango_font_description_get_size(Handle desc)


pango_font_description_get_stretch

protected static final int pango_font_description_get_stretch(Handle desc)


pango_font_description_get_style

protected static final int pango_font_description_get_style(Handle desc)


pango_font_description_get_type

protected static final int pango_font_description_get_type()


pango_font_description_get_variant

protected static final int pango_font_description_get_variant(Handle desc)


pango_font_description_get_weight

protected static final int pango_font_description_get_weight(Handle desc)


pango_font_description_hash

protected static final int pango_font_description_hash(Handle desc)


pango_font_description_merge

protected static final void pango_font_description_merge(Handle desc,
                                                         Handle descToMerge,
                                                         boolean replaceExisting)


pango_font_description_new

protected static final Handle pango_font_description_new()


pango_font_description_set_family

protected static final void pango_font_description_set_family(Handle desc,
                                                              String family)


pango_font_description_set_size

protected static final void pango_font_description_set_size(Handle desc,
                                                            int size)


pango_font_description_set_stretch

protected static final void pango_font_description_set_stretch(Handle desc,
                                                               int stretch)


pango_font_description_set_style

protected static final void pango_font_description_set_style(Handle desc,
                                                             int style)


pango_font_description_set_variant

protected static final void pango_font_description_set_variant(Handle desc,
                                                               int variant)


pango_font_description_set_weight

protected static final void pango_font_description_set_weight(Handle desc,
                                                              int weight)


pango_font_description_to_filename

protected static final String pango_font_description_to_filename(Handle desc)


pango_font_description_to_string

protected static final String pango_font_description_to_string(Handle desc)


pango_font_description_unset_fields

protected static final void pango_font_description_unset_fields(Handle desc,
                                                                int toUnset)


replace

public void replace(FontDescription descToMerge,
                    boolean replaceExisting)
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)
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)
Sets the size field of a font description.


setStretch

public void setStretch(Stretch stretch)
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)
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)
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)
Sets the weight field of a font description. The weight field specifies how bold or light the font should be.


toFilename

public String toFilename()
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()
Creates a string representation of a font description.


unsetFields

public void unsetFields(FontMask mask)
Unset some of the fields in this FontDescription.

Parameters:
mask -