Libraries:Gtk:Pango:Context
Types
T
Inherits from:Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
New() : Gtk.Pango.Context.T
Creates a new T initialized to default values.
This function is not particularly useful as it should always be followed by a SetFontMap call, and the function Gtk.Pango.FontMap.CreateContext does these two steps together and hence users are recommended to use that.
If you are using Pango as part of a higher-level system, that system may have it's own way of create a T. For instance, the GTK+ toolkit has, among others, Gtk.Gdk.Pango.ContextGetForScreen, and Gtk.Gtk.Widget.GetPangoContext. Use those instead.
Returns | the newly allocated T, which should be freed with g_object_unref(). |
Methods
:GetBaseDir(self @ T) : Gtk.Pango.Direction.T
Retrieves the base direction for the context. See SetBaseDir.
context | a T |
Returns | the base direction for the context. |
:GetBaseGravity(self @ T) : Gtk.Pango.Gravity.T
Retrieves the base gravity for the context. See SetBaseGravity.
context | a T |
Returns | the base gravity for the context. |
:GetFontDescription(self @ T) : Gtk.Pango.FontDescription.T
Retrieve the default font description for the context.
context | a T |
Returns | a pointer to the context's default font description. This value must not be modified or freed. [transfer none] |
:GetFontMap(self @ T) : Gtk.Pango.FontMap.T
Gets the PangoFontmap used to look up fonts for this context.
context | a T |
Returns | the font map for the T. This value is owned by Pango and should not be unreferenced. [transfer none] |
:GetGravity(self @ T) : Gtk.Pango.Gravity.T
Retrieves the gravity for the context. This is similar to GetBaseGravity, except for when the base gravity is Gtk.Pango.Gravity.Auto for which Gtk.Pango.Global.GravityGetForMatrix is used to return the gravity from the current context matrix.
context | a T |
Returns | the resolved gravity for the context. |
:GetGravityHint(self @ T) : Gtk.Pango.GravityHint.T
Retrieves the gravity hint for the context. See SetGravityHint for details.
context | a T |
Returns | the gravity hint for the context. |
:GetLanguage(self @ T) : Gtk.Pango.Language.T
:GetMatrix(self @ T) : Gtk.Pango.Matrix.T
Gets the transformation matrix that will be applied when rendering with this context. See SetMatrix.
context | a T |
Returns | the matrix, or NULL if no matrix has been set (which is the same as the identity matrix). The returned matrix is owned by Pango and must not be modified or freed. |
:GetMetrics(self @ T, desc @ Gtk.Pango.FontDescription.T, language @ Gtk.Pango.Language.T) : Gtk.Pango.FontMetrics.T
Get overall metric information for a particular font description. Since the metrics may be substantially different for different scripts, a language tag can be provided to indicate that the metrics should be retrieved that correspond to the script(s) used by that language.
The Gtk.Pango.FontDescription.T is interpreted in the same way as by pango_itemize(), and the family name may be a comma separated list of figures. If characters from multiple of these families would be used to render the string, then the returned fonts would be a composite of the metrics for the fonts loaded for the individual families.
context | a T |
desc | a Gtk.Pango.FontDescription.T structure. NULL means that the font description from the context will be used. [allow-none] |
language | language tag used to determine which script to get the metrics for. NULL means that the language tag from the context will be used. If no language tag is set on the context, metrics for the default language (as determined by Gtk.Pango.Language.GetDefault) will be returned. [allow-none] |
Returns | a Gtk.Pango.FontMetrics.T object. The caller must call Gtk.Pango.FontMetrics.Unref when finished using the object. |
:ListFamilies(self @ T, families @ Std.Object.T, n_families @ Std.Object.T) : Std.Object.T
List all families for a context.
context | a T |
families | location to store a pointer to an array of Gtk.Pango.FontFamily.T *. This array should be freed with g_free(). [out][array length=n_families] |
n_families | location to store the number of elements in descs. [out] |
:LoadFont(self @ T, desc @ Gtk.Pango.FontDescription.T) : Gtk.Pango.Font.T
Loads the font in one of the fontmaps in the context that is the closest match for desc.
context | a T |
desc | a Gtk.Pango.FontDescription.T describing the font to load |
Returns | the newly allocated Gtk.Pango.Font.T that was loaded, or NULL if no font matched. [transfer full] |
:LoadFontset(self @ T, desc @ Gtk.Pango.FontDescription.T, language @ Gtk.Pango.Language.T) : Gtk.Pango.Fontset.T
Load a set of fonts in the context that can be used to render a font matching desc.
context | a T |
desc | a Gtk.Pango.FontDescription.T describing the fonts to load |
language | a Gtk.Pango.Language.T the fonts will be used for |
Returns | the newly allocated Gtk.Pango.Fontset.T loaded, or NULL if no font matched. [transfer full] |
:SetBaseDir(self @ T, direction @ Gtk.Pango.Direction.T) : Std.Object.T
Sets the base direction for the context.
The base direction is used in applying the Unicode bidirectional algorithm; if the direction is Gtk.Pango.Direction.Ltr or Gtk.Pango.Direction.Rtl, then the value will be used as the paragraph direction in the Unicode bidirectional algorithm. A value of Gtk.Pango.Direction.WeakLtr or Gtk.Pango.Direction.WeakRtl is used only for paragraphs that do not contain any strong characters themselves.
context | a T |
direction | the new base direction |
:SetBaseGravity(self @ T, gravity @ Gtk.Pango.Gravity.T) : Std.Object.T
Sets the base gravity for the context.
The base gravity is used in laying vertical text out.
context | a T |
gravity | the new base gravity |
:SetFontDescription(self @ T, desc @ Gtk.Pango.FontDescription.T) : Std.Object.T
:SetFontMap(self @ T, font_map @ Gtk.Pango.FontMap.T) : Std.Object.T
Sets the font map to be searched when fonts are looked-up in this context. This is only for internal use by Pango backends, a T obtained via one of the recommended methods should already have a suitable font map.
context | a T |
font_map | the Gtk.Pango.FontMap.T to set. |
:SetGravityHint(self @ T, hint @ Gtk.Pango.GravityHint.T) : Std.Object.T
Sets the gravity hint for the context.
The gravity hint is used in laying vertical text out, and is only relevant if gravity of the context as returned by GetGravity is set Gtk.Pango.Gravity.East or Gtk.Pango.Gravity.West.
context | a T |
hint | the new gravity hint |
:SetLanguage(self @ T, language @ Gtk.Pango.Language.T) : Std.Object.T
Sets the global language tag for the context. The default language for the locale of the running process can be found using Gtk.Pango.Language.GetDefault.
context | a T |
language | the new language tag. |
:SetMatrix(self @ T, matrix @ Gtk.Pango.Matrix.T) : Std.Object.T
Sets the transformation matrix that will be applied when rendering with this context. Note that reported metrics are in the user space coordinates before the application of the matrix, not device-space coordinates after the application of the matrix. So, they don't scale with the matrix, though they may change slightly for different matrices, depending on how the text is fit to the pixel grid.
context | a T |
matrix | a Gtk.Pango.Matrix.T, or NULL to unset any existing matrix. (No matrix set is the same as setting the identity matrix.). [allow-none] |