Index

Package: Font

Description

package Pango.Font is
---------------------------------------------------------------------------- -- Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet -- Copyright (C) 2000-2014, AdaCore -- -- This library is free software; you can redistribute it and/or modify it -- under terms of the GNU General Public License as published by the Free -- Software Foundation; either version 3, or (at your option) any later -- version. This library is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- As a special exception under Section 7 of GPL version 3, you are granted -- additional permissions described in the GCC Runtime Library Exception, -- version 3.1, as published by the Free Software Foundation. -- -- You should have received a copy of the GNU General Public License and -- a copy of the GCC Runtime Library Exception along with this program; -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- <http://www.gnu.org/licenses/>. -- -- ----------------------------------------------------------------------------

Packages

Classes

Pango_Font_Record

type Pango_Font_Record is new GObject_Record with null record;

Ancestors:

Primitive operations:

Get_Glyph_Extents
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)

Types

Pango_Font

type Pango_Font is access all Pango_Font_Record'Class;

Pango_Font_Description

type Pango_Font_Description is new Glib.C_Proxy;

Property_Font_Description

type Property_Font_Description is new Desc_Properties.Property;

Subprograms & Entries

Font_Get_Type

function Font_Get_Type return Glib.GType;

Gdk_New

procedure Gdk_New 
(Self: out Pango_Font_Description);
Creates a new font description structure with all fields unset.

Pango_Font_Description_New

function Pango_Font_Description_New return Pango_Font_Description;
Creates a new font description structure with all fields unset.

Get_Type

function Get_Type return Glib.GType;

Describe

function Describe 
(Font: not null access Pango_Font_Record'Class) return Pango_Font_Description;
Returns a description of the font, with font size set in points. Use Pango.Font.Describe_With_Absolute_Size if you want the font size in device units.

Describe_With_Absolute_Size

function Describe_With_Absolute_Size 
(Font: not null access Pango_Font_Record'Class) return Pango_Font_Description;
Returns a description of the font, with absolute font size set (in device units). Use Pango.Font.Describe if you want the font size in points. Since: gtk+ 1.14

Get_Glyph_Extents

procedure Get_Glyph_Extents 
(Font: not null access Pango_Font_Record;
Glyph: Pango_Glyph;
Ink_Rect: out Pango_Rectangle;
Logical_Rect: out Pango_Rectangle);
Gets the logical and ink extents of a glyph within a font. The coordinate system for each rectangle has its origin at the base line and horizontal origin of the character with increasing coordinates extending to the right and down. The macros PANGO_ASCENT, PANGO_DESCENT, PANGO_LBEARING, and PANGO_RBEARING can be used to convert from the extents rectangle to more traditional font metrics. The units of the rectangles are in 1/PANGO_SCALE of a device unit. If Font is null, this function gracefully sets some sane values in the output variables and returns. "glyph": the glyph index "ink_rect": rectangle used to store the extents of the glyph as drawn or null to indicate that the result is not needed. "logical_rect": rectangle used to store the logical extents of the glyph or null to indicate that the result is not needed.

Get_Metrics

Gets overall metric information for a font. 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. If Font is null, this function gracefully sets some sane values in the output variables and returns. "language": language tag used to determine which script to get the metrics for, or null to indicate to get the metrics for the entire font.

Better_Match

function Better_Match 
(Self: Pango_Font_Description;
Old_Match: Pango_Font_Description;
New_Match: Pango_Font_Description) return Boolean;
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. "old_match": a Pango.Font.Pango_Font_Description, or null "new_match": a Pango.Font.Pango_Font_Description

Equal

function Equal 
(Self: Pango_Font_Description;
Desc2: Pango_Font_Description) return Boolean;
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.) "desc2": another Pango.Font.Pango_Font_Description

Get_Family

function Get_Family 
(Self: Pango_Font_Description) return UTF8_String;
Gets the family name field of a font description. See Pango.Font.Set_Family.

Set_Family

procedure Set_Family 
(Self: Pango_Font_Description;
Family: UTF8_String);
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 Pango.Font_Family.Pango_Font_Family. In some uses of Pango.Font.Pango_Font_Description, it is also possible to use a comma separated list of family names for this field. "family": a string representing the family name.

Get_Gravity

function Get_Gravity 
(Self: Pango_Font_Description) return Pango.Enums.Gravity;

Set_Gravity

procedure Set_Gravity 
(Self: Pango_Font_Description;
Gravity: Pango.Enums.Gravity);

Get_Set_Fields

function Get_Set_Fields 
(Self: Pango_Font_Description) return Pango.Enums.Font_Mask;

Get_Size

function Get_Size 
(Self: Pango_Font_Description) return Gint;

Set_Size

procedure Set_Size 
(Self: Pango_Font_Description;
Size: Gint);

Get_Size_Is_Absolute

function Get_Size_Is_Absolute 
(Self: Pango_Font_Description) return Boolean;
Determines whether the size of the font is in points (not absolute) or device units (absolute). See Pango.Font.Set_Size and Pango.Font.Set_Absolute_Size. Since: gtk+ 1.8

Get_Stretch

function Get_Stretch 
(Self: Pango_Font_Description) return Pango.Enums.Stretch;

Set_Stretch

procedure Set_Stretch 
(Self: Pango_Font_Description;
Stretch: Pango.Enums.Stretch);

Get_Variant

function Get_Variant 
(Self: Pango_Font_Description) return Pango.Enums.Variant;

Set_Variant

procedure Set_Variant 
(Self: Pango_Font_Description;
Variant: Pango.Enums.Variant);

Get_Weight

function Get_Weight 
(Self: Pango_Font_Description) return Pango.Enums.Weight;

Set_Weight

procedure Set_Weight 
(Self: Pango_Font_Description;
Weight: Pango.Enums.Weight);

Merge

procedure Merge 
(Self: Pango_Font_Description;
Desc_To_Merge: Pango_Font_Description;
Replace_Existing: Boolean);
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_to_merge": the Pango.Font.Pango_Font_Description to merge from, or null "replace_existing": if True, replace fields in Desc with the corresponding values from Desc_To_Merge, even if they are already exist.

Merge_Static

procedure Merge_Static 
(Self: Pango_Font_Description;
Desc_To_Merge: Pango_Font_Description;
Replace_Existing: Boolean);
Like Pango.Font.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_to_merge": the Pango.Font.Pango_Font_Description 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.

Set_Absolute_Size

procedure Set_Absolute_Size 
(Self: Pango_Font_Description;
Size: Gdouble);

Set_Family_Static

procedure Set_Family_Static 
(Self: Pango_Font_Description;
Family: UTF8_String);
Like Pango.Font.Set_Family, 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. "family": a string representing the family name.

To_Filename

function To_Filename 
(Self: Pango_Font_Description) return UTF8_String;
Creates a filename representation of a font description. The filename is identical to the result from calling Pango.Font.To_String, but with underscores instead of characters that are untypical in filenames, and in lower case only.

To_String

function To_String 
(Self: Pango_Font_Description) return UTF8_String;
Creates a string representation of a font description. See Pango.Font.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.

Unset_Fields

procedure Unset_Fields 
(Self: Pango_Font_Description;
To_Unset: Pango.Enums.Font_Mask);

To_Font_Description

function To_Font_Description 
(Family_Name: String := "";
Style: Pango.Enums.Style := Pango.Enums.Pango_Style_Normal;
Variant: Pango.Enums.Variant := Pango.Enums.Pango_Variant_Normal;
Weight: Pango.Enums.Weight := Pango.Enums.Pango_Weight_Normal;
Stretch: Pango.Enums.Stretch := Pango.Enums.Pango_Stretch_Normal;
Size: Gint := 0) return Pango_Font_Description;
Create a new font decription from the given parameters.

To_Address

function To_Address 
(F: Pango_Font_Description;
Add: System.Address) return System.Address;

Free

procedure Free 
(Desc: in out Pango_Font_Description);
Deallocate the given font description.

From_String

function From_String 
(Str: UTF8_String) return Pango_Font_Description;
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.