A set of utilities to handle the Cairo_Font_Face type, and the Cairo 'toy' text API.
<c_version>1.8.8</c_version> <group>Cairo</group>
procedure Destroy (Font_Face : Cairo_Font_Face)
Decreases the reference count on Font_Face by one. If the result is zero, then Font_Face and all associated resources are freed. See Cairo.Font_Face.Reference.
a Cairo_Font_Face
function Get_Reference_Count (Font_Face : Cairo_Font_Face) return Guint
Returns the current reference count of Font_Face.
@since 1.4
a Cairo_Font_Face
the current reference count of Font_Face. If the object is a nil object, 0 will be returned.
function Get_Type (Font_Face : Cairo_Font_Face) return Cairo_Font_Type
This function returns the type of the backend used to create a font face. See Cairo_Font_Type for available types.
@since 1.2
a font face
The type of Font_Face.
function Get_User_Data
(Font_Face : Cairo_Font_Face;
Key : access Cairo_User_Data_Key) return System.Address
Return user data previously attached to Font_Face using the specified key. If no user data has been attached with the given key this function returns System.Null_Address.
a Cairo_Font_Face
the address of the Cairo_User_Data_Key the user data was attached to
the user data previously attached or System.Null_Address.
function Reference (Font_Face : Cairo_Font_Face) return Cairo_Font_Face
Increases the reference count on Font_Face by one. This prevents Font_Face from being destroyed until a matching call to Cairo.Font_Face.Destroy is made.
The number of references to a Cairo_Font_Face can be get using Cairo.Font_Face.Get_Reference_Count.
a Cairo_Font_Face, (may be Null_Font_Face in which case this function does nothing).
the referenced Cairo_Font_Face.
function Set_User_Data
(Font_Face : Cairo_Font_Face;
Key : access Cairo_User_Data_Key;
User_Data : System.Address;
Destroy : Cairo_Destroy_Func) return Cairo_Status
Attach user data to Font_Face. To remove user data from a font face, call this function with the key that was used to set it and System.Null_Address for data.
a Cairo_Font_Face
the address of a Cairo_User_Data_Key to attach the user data to
the user data to attach to the font face
a Cairo_Destroy_Func which will be called when the font face is destroyed or when new user data is attached using the same key.
Cairo_Status_Success or Cairo_Status_No_Memory if a slot could not be allocated for the user data.
function Status (Font_Face : Cairo_Font_Face) return Cairo_Status
Checks whether an error has previously occurred for this font face
a Cairo_Font_Face
Cairo_Status_Success or another error such as Cairo_Status_No_Memory.
function Toy_Font_Face_Create
(Family : Gtkada.Types.Chars_Ptr;
Slant : Cairo_Font_Slant;
Weight : Cairo_Font_Weight)
return Cairo_Font_Face
Creates a font face from a triplet of family, slant, and weight. These font faces are used in implementation of the the Cairo_Context "toy" font API.
If Family is the zero-length string "", the platform-specific default family is assumed. The default family then can be queried using Toy_Font_Face_Get_Family.
The Cairo_Select_Font_Face function uses this to create font faces. See that function for limitations of toy font faces.
@since 1.8
a font Family name, encoded in UTF-8
the Slant for the font
the Weight for the font
a newly created Cairo_Font_Face. Free with Cairo.Font_Face.Destroy when you are done using it.
function Toy_Font_Face_Get_Family
(Font_Face : Cairo_Font_Face)
return Gtkada.Types.Chars_Ptr
Gets the familly name of a toy font.
@since 1.8
A toy font face
The family name. This string is owned by the font face and remains valid as long as the font face is alive (referenced).
function Toy_Font_Face_Get_Slant
(Font_Face : Cairo_Font_Face)
return Cairo_Font_Slant
Gets the slant a toy font.
@since 1.8
A toy font face
The slant value
function Toy_Font_Face_Get_Weight
(Font_Face : Cairo_Font_Face)
return Cairo_Font_Weight
Gets the weight a toy font.
@since 1.8
A toy font face
The weight value