Constructs a font description from a string representation.
font_name must have 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, variant, weight, or stretch, and SIZE is an decimal number (size in points). Any one of the options may be absent. If FAMILY-LIST is absent, then the family_name field of the resulting font description will be initialized to 0. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to 0.
String representation of a font description.
Member Function Documentation
Determines if the style attributes of new_match are a closer match for desc than old_match , or if old_match is 0, determines if new_match is a match at all.
Approximate matching is done for weight and style; other attributes must match exactly.
Determines which fields in a font description have been set.
A bitmask with bits set corresponding to the fields in desc that have been set.
Gets the size field of a font description.
The size field for the font description in pango units. (There are Pango::SCALE pango units in one device unit —for fonts, font points are the device unit.) Returns 0 if the stretch field has not previously been set. pango_font_description_get_set_fields() to find out if the field was explicitely set or not.
The family name represents a family of related font styles, and will resolve to a particular Pango::FontFamily. In some uses of Pango::FontDescription, it is also possible to use a comma separated list of family names for this field.
A string representing the family name.
Sets the size field of a font description.
The size for the font description in pango units. There are Pango::SCALEPango units in one device unit (device unit is a point, for font sizes).
The Pango::Style enumeration describes whether the font is slanted and the manner in which it is slanted; it can be either Pango::STYLE_NORMAL, Pango::STYLE_ITALIC, or Pango::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.
Creates a string representation of a font description.
See description_from_string() for a description of the format of the string representation. The family list in the string description will only have a terminating comma if the last word of the list is a valid style option.
A new string that must be freed with Glib::free().
Unsets some of the fields in a Pango::FontDescription.
Note that this merely marks the fields cleared, it does not clear the settings for those fields, to clear a family name set with pango_font_description_set_family_static() so that it won't be returned by subsequent calls to pango_font_description_get_family(), you must actually call pango_font_description_set_family (desc, 0);