1.5 <PangoFontFamily>

Class: <PangoFontFamily>

It derives from <GObject>.

A <PangoFontFamily> is used to represent a family of related font faces.

The font faces in a family share a common design, but differ in slant, weight, width or other aspects.

Fields

parent-instance

Properties

Property: font-family:is-monospace self

Is this a monospace font

Its value is a boolean.

It is read only.

Property: font-family:is-variable self

Is this a variable font

Its value is a boolean.

It is read only.

Property: font-family:item-type self

The type of items contained in this list.

Its value is a class, or a GType number.

It is read only.

Property: font-family:n-items self

The number of items contained in this list.

Its value is an unsigned 32-bit integer.

It is read only.

Property: font-family:name self

The name of the family

Its value is a string, or #f.

It is read only.

Procedures

Method: font-family:get-face self [name] ⇒ %return
Method: get-face self [name] ⇒ %return

Gets the <PangoFontFace> of self with the given name.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

name

Passed, or left out: a string, or #f.

the name of a face. If the name is #f, the family’s default face (fontconfig calls it "Regular") will be returned.

%return

Returned: a <PangoFontFace>, or #f.

the <PangoFontFace>, or #f if no face with the given name exists.

Method: font-family:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name of the family.

The name is unique among all fonts for the font backend and can be used in a <PangoFontDescription> to specify that a face from this family is desired.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a string.

the name of the family. This string is owned by the family object and must not be modified or freed.

Method: font-family:is-monospace? self ⇒ %return
Method: is-monospace? self ⇒ %return

A monospace font is a font designed for text display where the the characters form a regular grid.

For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. unichar-iswide? returns a result that indicates whether a character is typically double-width in a monospace font.

The best way to find out the grid-cell size is to call font-metrics:get-approximate-digit-width, since the results of font-metrics:get-approximate-char-width may be affected by double-width characters.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a boolean.

#t if the family is monospace.

Method: font-family:is-variable? self ⇒ %return
Method: is-variable? self ⇒ %return

A variable font is a font which has axes that can be modified to produce different faces.

Such axes are also known as _variations_; see font-description:set-variations for more information.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a boolean.

#t if the family is variable

Method: font-family:list-faces self ⇒ faces
Method: list-faces self ⇒ faces

Lists the different font faces that make up self.

The faces in a family share a common design, but differ in slant, weight, width and other aspects.

Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics.

<PangoFontFamily> also implemented the <GListModel> interface for enumerating faces.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

faces

Returned: a vector, each a <PangoFontFace>.

location to store an array of pointers to <PangoFontFace> objects, or #f. This array should be freed with byte-array:free when it is no longer needed.

n-faces

Not returned: it is the length of faces.

location to store number of elements in faces.

Virtual methods

Virtual method: font-family:do-get-face implementor self [name] ⇒ %return

Gets the <PangoFontFace> of self with the given name.

To override it in a new class, give register-type #:vfuncs `((get-face . ,procedure)). The procedure is called as (procedure self name) ⇒ %return.

implementor

Passed: the class whose implementation to call: <PangoFontFamily>, or a class that derives from it, or its GType number.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

name

Passed, or left out: a string, or #f.

the name of a face. If the name is #f, the family’s default face (fontconfig calls it "Regular") will be returned.

%return

Returned: a <PangoFontFace>, or #f.

the <PangoFontFace>, or #f if no face with the given name exists.

Virtual method: font-family:do-get-name implementor self ⇒ %return

Gets the name of the family.

The name is unique among all fonts for the font backend and can be used in a <PangoFontDescription> to specify that a face from this family is desired.

To override it in a new class, give register-type #:vfuncs `((get-name . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <PangoFontFamily>, or a class that derives from it, or its GType number.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a string.

the name of the family. This string is owned by the family object and must not be modified or freed.

Virtual method: font-family:do-is-monospace implementor self ⇒ %return

A monospace font is a font designed for text display where the the characters form a regular grid.

For Western languages this would mean that the advance width of all characters are the same, but this categorization also includes Asian fonts which include double-width characters: characters that occupy two grid cells. unichar-iswide? returns a result that indicates whether a character is typically double-width in a monospace font.

The best way to find out the grid-cell size is to call font-metrics:get-approximate-digit-width, since the results of font-metrics:get-approximate-char-width may be affected by double-width characters.

To override it in a new class, give register-type #:vfuncs `((is-monospace . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <PangoFontFamily>, or a class that derives from it, or its GType number.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a boolean.

#t if the family is monospace.

Virtual method: font-family:do-is-variable implementor self ⇒ %return

A variable font is a font which has axes that can be modified to produce different faces.

Such axes are also known as _variations_; see font-description:set-variations for more information.

To override it in a new class, give register-type #:vfuncs `((is-variable . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <PangoFontFamily>, or a class that derives from it, or its GType number.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

%return

Returned: a boolean.

#t if the family is variable

Virtual method: font-family:do-list-faces implementor self ⇒ faces

Lists the different font faces that make up self.

The faces in a family share a common design, but differ in slant, weight, width and other aspects.

Note that the returned faces are not in any particular order, and multiple faces may have the same name or characteristics.

<PangoFontFamily> also implemented the <GListModel> interface for enumerating faces.

To override it in a new class, give register-type #:vfuncs `((list-faces . ,procedure)). The procedure is called as (procedure self) ⇒ faces.

implementor

Passed: the class whose implementation to call: <PangoFontFamily>, or a class that derives from it, or its GType number.

self

Passed: a <PangoFontFamily>.

a <PangoFontFamily>

faces

Returned: a vector, each a <PangoFontFace>.

location to store an array of pointers to <PangoFontFace> objects, or #f. This array should be freed with byte-array:free when it is no longer needed.

n-faces

Not returned: it is the length of faces.

location to store number of elements in faces.