Libraries:Gtk:Pango:FontDescription
Types
T
Constants
Nil : T
Functions
FromString(str @ Std.String.T) : Gtk.Pango.FontDescription.T
Creates a new font description from a string representation 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, variant, weight, stretch, or gravity, and SIZE is a decimal number (size in points) or optionally followed by the unit modifier "px" for absolute size. 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 NULL. 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.
str | string representation of a font description. |
Returns | a new T. |
GetType() : Gtk.GObject.Type.T
New() : Gtk.Pango.FontDescription.T
Creates a new font description structure with all fields unset.
Methods
:"="(_ @ T, _ @ T)
:BetterMatch(self @ T, old_match @ Gtk.Pango.FontDescription.T, new_match @ Gtk.Pango.FontDescription.T) : Std.Symbol.T
Determines if the style attributes of new_match are a closer match for desc than those of old_match are, or if old_match is NULL, determines if new_match is a match at all. Approximate matching is done for weight and style; other style attributes must match exactly. Style attributes are all attributes other than family and size-related attributes. Approximate matching for style considers PANGO_STYLE_OBLIQUE and PANGO_STYLE_ITALIC as matches, but not as good a match as when the styles are equal.
Note that old_match must match desc.
desc | a T |
old_match | a T, or NULL. [allow-none] |
new_match | a T |
Returns | TRUE if new_match is a better match |
:Copy(self @ T) : Gtk.Pango.FontDescription.T
Make a copy of a T.
desc | a T, may be NULL |
Returns | the newly allocated T, which should be freed with Free, or NULL if desc was NULL. |
:CopyStatic(self @ T) : Gtk.Pango.FontDescription.T
Like Copy, but only a shallow copy is made of the family name and other allocated fields. The result can only be used until desc is modified or freed. This is meant to be used when the copy is only needed temporarily.
desc | a T, may be NULL |
Returns | the newly allocated T, which should be freed with Free, or NULL if desc was NULL. |
:Equal(self @ T, desc2 @ Gtk.Pango.FontDescription.T) : Std.Symbol.T
Compares two font descriptions for equality. Two font descriptions are considered equal if the fonts they describe are provably identical. This means that their masks do not have to match, as long as other fields are all the same. (Two font descriptions may result in identical fonts being loaded, but still compare FALSE.)
:Free(self @ T) : Std.Object.T
:GetFamily(self @ T) : Std.String.T
Gets the family name field of a font description. See SetFamily.
desc | a T. |
Returns | the family name field for the font description, or NULL if not previously set. This has the same life-time as the font description itself and should not be freed. |
:GetGravity(self @ T) : Gtk.Pango.Gravity.T
Gets the gravity field of a font description. See SetGravity.
desc | a T |
Returns | the gravity field for the font description. Use GetSetFields to find out if the field was explicitly set or not. |
:GetSetFields(self @ T) : Std.Integer.SmallT
Determines which fields in a font description have been set.
desc | a T |
Returns | a bitmask with bits set corresponding to the fields in desc that have been set. |
:GetSize(self @ T) : Std.Integer.SmallT
Gets the size field of a font description. See SetSize.
desc | a T |
Returns | the size field for the font description in points or device units. You must call GetSizeIsAbsolute to find out which is the case. Returns 0 if the size field has not previously been set or it has been set to 0 explicitly. Use GetSetFields to find out if the field was explicitly set or not. |
:GetSizeIsAbsolute(self @ T) : Std.Symbol.T
Determines whether the size of the font is in points (not absolute) or device units (absolute). See SetSize and SetAbsoluteSize.
desc | a T |
Returns | whether the size for the font description is in points or device units. Use GetSetFields to find out if the size field of the font description was explicitly set or not. |
:GetStretch(self @ T) : Gtk.Pango.Stretch.T
Gets the stretch field of a font description. See SetStretch.
desc | a T. |
Returns | the stretch field for the font description. Use GetSetFields to find out if the field was explicitly set or not. |
:GetStyle(self @ T) : Gtk.Pango.Style.T
Gets the style field of a T. See SetStyle.
desc | a T |
Returns | the style field for the font description. Use GetSetFields to find out if the field was explicitly set or not. |
:GetVariant(self @ T) : Gtk.Pango.Variant.T
Gets the variant field of a T. See SetVariant.
desc | a T. |
Returns | the variant field for the font description. Use GetSetFields to find out if the field was explicitly set or not. |
:GetWeight(self @ T) : Gtk.Pango.Weight.T
Gets the weight field of a font description. See SetWeight.
desc | a T |
Returns | the weight field for the font description. Use GetSetFields to find out if the field was explicitly set or not. |
:Hash(self @ T) : Std.Integer.SmallT
Computes a hash of a T structure suitable to be used, for example, as an argument to g_hash_table_new(). The hash value is independent of desc->mask.
desc | a T |
Returns | the hash value. |
:Merge(self @ T, desc_to_merge @ Gtk.Pango.FontDescription.T, replace_existing @ Std.Symbol.T) : Std.Object.T
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.
If desc_to_merge is NULL, this function performs nothing.
desc | a T |
desc_to_merge | the T to merge from, or NULL. [allow-none] |
replace_existing | if TRUE, replace fields in desc with the corresponding values from desc_to_merge, even if they are already exist. |
:MergeStatic(self @ T, desc_to_merge @ Gtk.Pango.FontDescription.T, replace_existing @ Std.Symbol.T) : Std.Object.T
Like Merge, but only a shallow copy is made of the family name and other allocated fields. desc can only be used until desc_to_merge is modified or freed. This is meant to be used when the merged font description is only needed temporarily.
desc | a T |
desc_to_merge | the T to merge from |
replace_existing | if TRUE, replace fields in desc with the corresponding values from desc_to_merge, even if they are already exist. |
:SetAbsoluteSize(self @ T, size @ Std.Real.T) : Std.Object.T
Sets the size field of a font description, in device units. This is mutually exclusive with SetSize which sets the font size in points.
desc | a T |
size | the new size, in Pango units. There are PANGO_SCALE Pango units in one device unit. For an output backend where a device unit is a pixel, a size value of 10 * PANGO_SCALE gives a 10 pixel font. |
:SetFamily(self @ T, family @ Std.String.T) : Std.Object.T
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 Gtk.Pango.FontFamily.T. In some uses of T, it is also possible to use a comma separated list of family names for this field.
desc | a T. |
family | a string representing the family name. |
:SetFamilyStatic(self @ T, family @ Std.String.T) : Std.Object.T
Like SetFamily, except that no copy of family is made. The caller must make sure that the string passed in stays around until desc has been freed or the name is set again. This function can be used if family is a static string such as a C string literal, or if desc is only needed temporarily.
desc | a T |
family | a string representing the family name. |
:SetGravity(self @ T, gravity @ Gtk.Pango.Gravity.T) : Std.Object.T
Sets the gravity field of a font description. The gravity field specifies how the glyphs should be rotated. If gravity is Gtk.Pango.Gravity.Auto, this actually unsets the gravity mask on the font description.
This function is seldom useful to the user. Gravity should normally be set on a Gtk.Pango.Context.T.
desc | a T |
gravity | the gravity for the font description. |
:SetSize(self @ T, size @ Std.Integer.SmallT) : Std.Object.T
Sets the size field of a font description in fractional points. This is mutually exclusive with SetAbsoluteSize.
desc | a T |
size | the size of the font in points, scaled by PANGO_SCALE. (That is, a size value of 10 * PANGO_SCALE is a 10 point font. The conversion factor between points and device units depends on system configuration and the output device. For screen display, a logical DPI of 96 is common, in which case a 10 point font corresponds to a 10 * (96 / 72) = 13.3 pixel font. Use SetAbsoluteSize if you need a particular size in device units. |
:SetStretch(self @ T, stretch @ Gtk.Pango.Stretch.T) : Std.Object.T
Sets the stretch field of a font description. The stretch field specifies how narrow or wide the font should be.
desc | a T |
stretch | the stretch for the font description |
:SetStyle(self @ T, style @ Gtk.Pango.Style.T) : Std.Object.T
Sets the style field of a T. The Gtk.Pango.Style.T enumeration describes whether the font is slanted and the manner in which it is slanted; it can be either Gtk.Pango.Style.Normal, Gtk.Pango.Style.Italic, or Gtk.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.
desc | a T |
style | the style for the font description |
:SetVariant(self @ T, variant @ Gtk.Pango.Variant.T) : Std.Object.T
Sets the variant field of a font description. The Gtk.Pango.Variant.T can either be Gtk.Pango.Variant.Normal or Gtk.Pango.Variant.SmallCaps.
desc | a T |
variant | the variant type for the font description. |
:SetWeight(self @ T, weight @ Gtk.Pango.Weight.T) : Std.Object.T
Sets the weight field of a font description. The weight field specifies how bold or light the font should be. In addition to the values of the Gtk.Pango.Weight.T enumeration, other intermediate numeric values are possible.
desc | a T |
weight | the weight for the font description. |
:ToFilename(self @ T) : Std.String.T
Creates a filename representation of a font description. The filename is identical to the result from calling ToString, but with underscores instead of characters that are untypical in filenames, and in lower case only.
:ToString(self @ T) : Std.String.T
Creates a string representation of a font description. See FromString 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.
:UnsetFields(self @ T, to_unset @ Std.Integer.SmallT) : Std.Object.T
Unsets some of the fields in a T. The unset fields will get back to their default values.
desc | a T |
to_unset | bitmask of fields in the desc to unset. |