Top |
PangoFontDescription | |
enum | PangoStyle |
enum | PangoWeight |
enum | PangoVariant |
enum | PangoStretch |
enum | PangoFontMask |
struct | PangoFontMetrics |
PangoFont | |
struct | PangoFontFamily |
struct | PangoFontFace |
PangoFontMap | |
struct | PangoFontMapClass |
struct | PangoFontset |
struct | PangoFontsetClass |
PangoFontsetSimple |
GBoxed ├── PangoFontDescription ╰── PangoFontMetrics GEnum ├── PangoStretch ├── PangoStyle ├── PangoVariant ╰── PangoWeight GFlags ╰── PangoFontMask GObject ├── PangoFont │ ╰── PangoFcFont ├── PangoFontFace ├── PangoFontFamily ├── PangoFontMap │ ╰── PangoFcFontMap ╰── PangoFontset ╰── PangoFontsetSimple
PangoFont is required by PangoCairoFont.
PangoFontMap is required by PangoCairoFontMap.
Pango supports a flexible architecture where a particular rendering architecture can supply an implementation of fonts. The PangoFont structure represents an abstract rendering-system-independent font. Pango provides routines to list available fonts, and to load a font of a given description.
#define PANGO_TYPE_FONT_DESCRIPTION (pango_font_description_get_type ())
The GObject type for PangoFontDescription.
PangoFontDescription *
pango_font_description_new (void
);
Creates a new font description structure with all fields unset.
the newly allocated PangoFontDescription, which
should be freed using pango_font_description_free()
.
PangoFontDescription *
pango_font_description_copy (const PangoFontDescription *desc
);
Make a copy of a PangoFontDescription.
the newly allocated
PangoFontDescription, which should be freed with
pango_font_description_free()
, or NULL
if desc
was
NULL
.
[nullable]
PangoFontDescription *
pango_font_description_copy_static (const PangoFontDescription *desc
);
Like pango_font_description_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.
the newly allocated
PangoFontDescription, which should be freed with
pango_font_description_free()
, or NULL
if desc
was
NULL
.
[nullable]
guint
pango_font_description_hash (const PangoFontDescription *desc
);
Computes a hash of a PangoFontDescription structure suitable
to be used, for example, as an argument to g_hash_table_new()
.
The hash value is independent of desc->mask
.
gboolean pango_font_description_equal (const PangoFontDescription *desc1
,const PangoFontDescription *desc2
);
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
.)
void
pango_font_description_free (PangoFontDescription *desc
);
Frees a font description.
void pango_font_descriptions_free (PangoFontDescription **descs
,int n_descs
);
Frees an array of font descriptions.
descs |
a pointer
to an array of PangoFontDescription, may be |
[allow-none][array length=n_descs][transfer full] |
n_descs |
number of font descriptions in |
void pango_font_description_set_family (PangoFontDescription *desc
,const char *family
);
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 PangoFontFamily. In some uses of PangoFontDescription, it is also possible to use a comma separated list of family names for this field.
void pango_font_description_set_family_static (PangoFontDescription *desc
,const char *family
);
Like pango_font_description_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.
const char *
pango_font_description_get_family (const PangoFontDescription *desc
);
Gets the family name field of a font description. See
pango_font_description_set_family()
.
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.
[nullable]
void pango_font_description_set_style (PangoFontDescription *desc
,PangoStyle style
);
Sets the style field of a PangoFontDescription. The PangoStyle enumeration describes whether the font is slanted and the manner in which it is slanted; it can be either PANGO_STYLE_NORMAL, PANGO_STYLE_ITALIC, or 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.
PangoStyle
pango_font_description_get_style (const PangoFontDescription *desc
);
Gets the style field of a PangoFontDescription. See
pango_font_description_set_style()
.
the style field for the font description.
Use pango_font_description_get_set_fields()
to find out if
the field was explicitly set or not.
void pango_font_description_set_variant (PangoFontDescription *desc
,PangoVariant variant
);
Sets the variant field of a font description. The PangoVariant
can either be PANGO_VARIANT_NORMAL
or PANGO_VARIANT_SMALL_CAPS
.
PangoVariant
pango_font_description_get_variant (const PangoFontDescription *desc
);
Gets the variant field of a PangoFontDescription. See
pango_font_description_set_variant()
.
the variant field for the font description. Use
pango_font_description_get_set_fields()
to find out if
the field was explicitly set or not.
void pango_font_description_set_weight (PangoFontDescription *desc
,PangoWeight weight
);
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 PangoWeight enumeration, other intermediate numeric values are possible.
PangoWeight
pango_font_description_get_weight (const PangoFontDescription *desc
);
Gets the weight field of a font description. See
pango_font_description_set_weight()
.
the weight field for the font description. Use
pango_font_description_get_set_fields()
to find out if
the field was explicitly set or not.
void pango_font_description_set_stretch (PangoFontDescription *desc
,PangoStretch stretch
);
Sets the stretch field of a font description. The stretch field specifies how narrow or wide the font should be.
PangoStretch
pango_font_description_get_stretch (const PangoFontDescription *desc
);
Gets the stretch field of a font description.
See pango_font_description_set_stretch()
.
the stretch field for the font description. Use
pango_font_description_get_set_fields()
to find out if
the field was explicitly set or not.
void pango_font_description_set_size (PangoFontDescription *desc
,gint size
);
Sets the size field of a font description in fractional points. This is mutually
exclusive with pango_font_description_set_absolute_size()
.
desc |
||
size |
the size of the font in points, scaled by PANGO_SCALE. (That is,
a |
gint
pango_font_description_get_size (const PangoFontDescription *desc
);
Gets the size field of a font description.
See pango_font_description_set_size()
.
the size field for the font description in points or device units.
You must call pango_font_description_get_size_is_absolute()
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 pango_font_description_get_set_fields()
to
find out if the field was explicitly set or not.
void pango_font_description_set_absolute_size (PangoFontDescription *desc
,double size
);
Sets the size field of a font description, in device units. This is mutually
exclusive with pango_font_description_set_size()
which sets the font size
in points.
desc |
||
size |
the new size, in Pango units. There are |
Since: 1.8
gboolean
pango_font_description_get_size_is_absolute
(const PangoFontDescription *desc
);
Determines whether the size of the font is in points (not absolute) or device units (absolute).
See pango_font_description_set_size()
and pango_font_description_set_absolute_size()
.
whether the size for the font description is in
points or device units. Use pango_font_description_get_set_fields()
to
find out if the size field of the font description was explicitly set or not.
Since: 1.8
void pango_font_description_set_gravity (PangoFontDescription *desc
,PangoGravity gravity
);
Sets the gravity field of a font description. The gravity field
specifies how the glyphs should be rotated. If gravity
is
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 PangoContext.
Since: 1.16
PangoGravity
pango_font_description_get_gravity (const PangoFontDescription *desc
);
Gets the gravity field of a font description. See
pango_font_description_set_gravity()
.
the gravity field for the font description. Use
pango_font_description_get_set_fields()
to find out if
the field was explicitly set or not.
Since: 1.16
PangoFontMask
pango_font_description_get_set_fields (const PangoFontDescription *desc
);
Determines which fields in a font description have been set.
void pango_font_description_unset_fields (PangoFontDescription *desc
,PangoFontMask to_unset
);
Unsets some of the fields in a PangoFontDescription. The unset fields will get back to their default values.
void pango_font_description_merge (PangoFontDescription *desc
,const PangoFontDescription *desc_to_merge
,gboolean replace_existing
);
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 |
||
desc_to_merge |
the PangoFontDescription to merge from, or |
[allow-none] |
replace_existing |
if |
void pango_font_description_merge_static (PangoFontDescription *desc
,const PangoFontDescription *desc_to_merge
,gboolean replace_existing
);
Like pango_font_description_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 |
||
desc_to_merge |
the PangoFontDescription to merge from |
|
replace_existing |
if |
gboolean pango_font_description_better_match (const PangoFontDescription *desc
,const PangoFontDescription *old_match
,const PangoFontDescription *new_match
);
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
.
PangoFontDescription *
pango_font_description_from_string (const char *str
);
Creates a new font description from a string representation in the
form "FAMILY-LIST [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.
char *
pango_font_description_to_string (const PangoFontDescription *desc
);
Creates a string representation of a font description. See
pango_font_description_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.
char *
pango_font_description_to_filename (const PangoFontDescription *desc
);
Creates a filename representation of a font description. The
filename is identical to the result from calling
pango_font_description_to_string()
, but with underscores instead of
characters that are untypical in filenames, and in lower case only.
#define PANGO_TYPE_FONT_METRICS (pango_font_metrics_get_type ())
The GObject type for PangoFontMetrics.
PangoFontMetrics *
pango_font_metrics_ref (PangoFontMetrics *metrics
);
Increase the reference count of a font metrics structure by one.
void
pango_font_metrics_unref (PangoFontMetrics *metrics
);
Decrease the reference count of a font metrics structure by one. If the result is zero, frees the structure and any associated memory.
int
pango_font_metrics_get_ascent (PangoFontMetrics *metrics
);
Gets the ascent from a font metrics structure. The ascent is the distance from the baseline to the logical top of a line of text. (The logical top may be above or below the top of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)
int
pango_font_metrics_get_descent (PangoFontMetrics *metrics
);
Gets the descent from a font metrics structure. The descent is the distance from the baseline to the logical bottom of a line of text. (The logical bottom may be above or below the bottom of the actual drawn ink. It is necessary to lay out the text to figure where the ink will be.)
int
pango_font_metrics_get_approximate_char_width
(PangoFontMetrics *metrics
);
Gets the approximate character width for a font metrics structure. This is merely a representative value useful, for example, for determining the initial size for a window. Actual characters in text will be wider and narrower than this.
int
pango_font_metrics_get_approximate_digit_width
(PangoFontMetrics *metrics
);
Gets the approximate digit width for a font metrics structure.
This is merely a representative value useful, for example, for
determining the initial size for a window. Actual digits in
text can be wider or narrower than this, though this value
is generally somewhat more accurate than the result of
pango_font_metrics_get_approximate_char_width()
for digits.
int
pango_font_metrics_get_underline_thickness
(PangoFontMetrics *metrics
);
Gets the suggested thickness to draw for the underline.
Since: 1.6
int
pango_font_metrics_get_underline_position
(PangoFontMetrics *metrics
);
Gets the suggested position to draw the underline. The value returned is the distance above the baseline of the top of the underline. Since most fonts have underline positions beneath the baseline, this value is typically negative.
Since: 1.6
int
pango_font_metrics_get_strikethrough_thickness
(PangoFontMetrics *metrics
);
Gets the suggested thickness to draw for the strikethrough.
Since: 1.6
int
pango_font_metrics_get_strikethrough_position
(PangoFontMetrics *metrics
);
Gets the suggested position to draw the strikethrough. The value returned is the distance above the baseline of the top of the strikethrough.
Since: 1.6
#define PANGO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont))
#define PANGO_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT))
PangoEngineShape * pango_font_find_shaper (PangoFont *font
,PangoLanguage *language
,guint32 ch
);
Finds the best matching shaper for a font for a particular language tag and character point.
PangoFontDescription *
pango_font_describe (PangoFont *font
);
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.
PangoFontDescription *
pango_font_describe_with_absolute_size
(PangoFont *font
);
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: 1.14
PangoCoverage * pango_font_get_coverage (PangoFont *font
,PangoLanguage *language
);
Computes the coverage map for a given font and language tag.
void pango_font_get_glyph_extents (PangoFont *font
,PangoGlyph glyph
,PangoRectangle *ink_rect
,PangoRectangle *logical_rect
);
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.
font |
a PangoFont. |
[nullable] |
glyph |
the glyph index |
|
ink_rect |
rectangle used to store the extents of the glyph
as drawn or |
[out][allow-none] |
logical_rect |
rectangle used to store the logical extents of
the glyph or |
[out][allow-none] |
PangoFontMetrics * pango_font_get_metrics (PangoFont *font
,PangoLanguage *language
);
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.
a PangoFontMetrics object. The caller must call pango_font_metrics_unref()
when finished using the object.
PangoFontMap *
pango_font_get_font_map (PangoFont *font
);
Gets the font map for which the font was created.
Note that the font maintains a weak reference
to the font map, so if all references to font map are dropped, the font
map will be finalized even if there are fonts created with the font
map that are still alive. In that case this function will return NULL
.
It is the responsibility of the user to ensure that the font map is kept
alive. In most uses this is not an issue as a PangoContext holds
a reference to the font map.
Since: 1.10
#define PANGO_TYPE_FONT_FAMILY (pango_font_family_get_type ())
The GObject type for PangoFontFamily.
#define PANGO_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
Casts a GObject to a PangoFontFamily.
#define PANGO_IS_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
const char *
pango_font_family_get_name (PangoFontFamily *family
);
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.
gboolean
pango_font_family_is_monospace (PangoFontFamily *family
);
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.
g_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
pango_font_metrics_get_approximate_digit_width()
, since the results
of pango_font_metrics_get_approximate_char_width()
may be affected
by double-width characters.
Since: 1.4
void pango_font_family_list_faces (PangoFontFamily *family
,PangoFontFace ***faces
,int *n_faces
);
Lists the different font faces that make up family
. The faces
in a family share a common design, but differ in slant, weight,
width and other aspects.
family |
||
faces |
location to store an array of pointers to PangoFontFace objects,
or |
[out][allow-none][array length=n_faces][transfer container] |
n_faces |
location to store number of elements in |
[out] |
#define PANGO_TYPE_FONT_FACE (pango_font_face_get_type ())
The GObject type for PangoFontFace.
#define PANGO_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace))
Casts a GObject to a PangoFontFace.
#define PANGO_IS_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE))
const char *
pango_font_face_get_face_name (PangoFontFace *face
);
Gets a name representing the style of this face among the different faces in the PangoFontFamily for the face. This name is unique among all faces in the family and is suitable for displaying to users.
void pango_font_face_list_sizes (PangoFontFace *face
,int **sizes
,int *n_sizes
);
List the available sizes for a font. This is only applicable to bitmap
fonts. For scalable fonts, stores NULL
at the location pointed to by
sizes
and 0 at the location pointed to by n_sizes
. The sizes returned
are in Pango units and are sorted in ascending order.
face |
||
sizes |
location to store a pointer to an array of int. This array
should be freed with |
[out][array length=n_sizes][nullable][optional] |
n_sizes |
location to store the number of elements in |
Since: 1.4
PangoFontDescription *
pango_font_face_describe (PangoFontFace *face
);
Returns the family, style, variant, weight and stretch of a PangoFontFace. The size field of the resulting font description will be unset.
a newly-created PangoFontDescription structure
holding the description of the face. Use pango_font_description_free()
to free the result.
gboolean
pango_font_face_is_synthesized (PangoFontFace *face
);
Returns whether a PangoFontFace is synthesized by the underlying font rendering engine from another face, perhaps by shearing, emboldening, or lightening it.
Since: 1.18
#define PANGO_TYPE_FONT_MAP (pango_font_map_get_type ())
The GObject type for PangoFontMap.
#define PANGO_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_MAP, PangoFontMap))
Casts a GObject to a PangoFontMap.
#define PANGO_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_MAP))
#define PANGO_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
Casts a GObject to a PangoFontMapClass.
#define PANGO_IS_FONT_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_MAP))
#define PANGO_FONT_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_MAP, PangoFontMapClass))
PangoContext *
pango_font_map_create_context (PangoFontMap *fontmap
);
Creates a PangoContext connected to fontmap
. This is equivalent
to pango_context_new()
followed by pango_context_set_font_map()
.
If you are using Pango as part of a higher-level system,
that system may have it's own way of create a PangoContext.
For instance, the GTK+ toolkit has, among others,
gdk_pango_context_get_for_screen()
, and
gtk_widget_get_pango_context()
. Use those instead.
the newly allocated PangoContext,
which should be freed with g_object_unref()
.
[transfer full]
Since: 1.22
PangoFont * pango_font_map_load_font (PangoFontMap *fontmap
,PangoContext *context
,const PangoFontDescription *desc
);
Load the font in the fontmap that is the closest match for desc
.
fontmap |
||
context |
the PangoContext the font will be used with |
|
desc |
a PangoFontDescription describing the font to load |
PangoFontset * pango_font_map_load_fontset (PangoFontMap *fontmap
,PangoContext *context
,const PangoFontDescription *desc
,PangoLanguage *language
);
Load a set of fonts in the fontmap that can be used to render
a font matching desc
.
fontmap |
||
context |
the PangoContext the font will be used with |
|
desc |
a PangoFontDescription describing the font to load |
|
language |
a PangoLanguage the fonts will be used for |
the newly allocated
PangoFontset loaded, or NULL
if no font matched.
[transfer full][nullable]
void pango_font_map_list_families (PangoFontMap *fontmap
,PangoFontFamily ***families
,int *n_families
);
List all families for a fontmap.
fontmap |
||
families |
location to store a pointer to an array of PangoFontFamily *.
This array should be freed with |
[out][array length=n_families][transfer container] |
n_families |
location to store the number of elements in |
[out] |
const char *
pango_font_map_get_shape_engine_type (PangoFontMap *fontmap
);
pango_font_map_get_shape_engine_type
has been deprecated since version 1.38 and should not be used in newly-written code.
Returns the render ID for shape engines for this fontmap.
See the render_type
field of
PangoEngineInfo.
the ID string for shape engines for this fontmap. Owned by Pango, should not be modified or freed.
Since: 1.4
guint
pango_font_map_get_serial (PangoFontMap *fontmap
);
Returns the current serial number of fontmap
. The serial number is
initialized to an small number larger than zero when a new fontmap
is created and is increased whenever the fontmap is changed. It may
wrap, but will never have the value 0. Since it can wrap, never compare
it with "less than", always use "not equals".
The fontmap can only be changed using backend-specific API, like changing fontmap resolution.
This can be used to automatically detect changes to a PangoFontMap, like in PangoContext.
Since: 1.32.4
void
pango_font_map_changed (PangoFontMap *fontmap
);
Forces a change in the context, which will cause any PangoContext using this fontmap to change.
This function is only useful when implementing a new backend for Pango, something applications won't do. Backends should call this function if they have attached extra data to the context and such data is changed.
Since: 1.34
#define PANGO_TYPE_FONTSET (pango_fontset_get_type ())
The GObject type for PangoFontset.
PangoFont * pango_fontset_get_font (PangoFontset *fontset
,guint wc
);
Returns the font in the fontset that contains the best glyph for the
Unicode character wc
.
a PangoFont. The caller must call g_object_unref when finished with the font.
[transfer full]
PangoFontMetrics *
pango_fontset_get_metrics (PangoFontset *fontset
);
Get overall metric information for the fonts in the fontset.
a PangoFontMetrics object. The caller must call pango_font_metrics_unref()
when finished using the object.
gboolean (*PangoFontsetForeachFunc) (PangoFontset *fontset
,PangoFont *font
,gpointer user_data
);
A callback function used by pango_fontset_foreach()
when enumerating
the fonts in a fontset.
Since: 1.4
void pango_fontset_foreach (PangoFontset *fontset
,PangoFontsetForeachFunc func
,gpointer data
);
Iterates through all the fonts in a fontset, calling func
for
each one. If func
returns TRUE
, that stops the iteration.
fontset |
||
func |
Callback function. |
[closure data][scope call] |
data |
data to pass to the callback function. |
[closure] |
Since: 1.4
#define PANGO_TYPE_FONTSET_SIMPLE (pango_fontset_simple_get_type ())
The GObject type for PangoFontsetSimple.
PangoFontsetSimple *
pango_fontset_simple_new (PangoLanguage *language
);
Creates a new PangoFontsetSimple for the given language.
void pango_fontset_simple_append (PangoFontsetSimple *fontset
,PangoFont *font
);
Adds a font to the fontset.
int
pango_fontset_simple_size (PangoFontsetSimple *fontset
);
Returns the number of fonts in the fontset.
typedef struct _PangoFontDescription PangoFontDescription;
The PangoFontDescription structure represents the description of an ideal font. These structures are used both to list what fonts are available on the system and also for specifying the characteristics of a font to load.
An enumeration specifying the weight (boldness) of a font. This is a numerical value ranging from 100 to 1000, but there are some predefined values:
the thin weight (= 100; Since: 1.24) |
||
the ultralight weight (= 200) |
||
the light weight (= 300) |
||
the semilight weight (= 350; Since: 1.36.7) |
||
the book weight (= 380; Since: 1.24) |
||
the default weight (= 400) |
||
the normal weight (= 500; Since: 1.24) |
||
the semibold weight (= 600) |
||
the bold weight (= 700) |
||
the ultrabold weight (= 800) |
||
the heavy weight (= 900) |
||
the ultraheavy weight (= 1000; Since: 1.24) |
An enumeration specifying the width of the font relative to other designs within a family.
The bits in a PangoFontMask correspond to fields in a PangoFontDescription that have been set.
struct PangoFontMetrics { };
A PangoFontMetrics structure holds the overall metric information for a font (possibly restricted to a script). The fields of this structure are private to implementations of a font backend. See the documentation of the corresponding getters for documentation of their meaning.
typedef struct _PangoFont PangoFont;
The PangoFont structure is used to represent
a font in a rendering-system-independent matter.
To create an implementation of a PangoFont,
the rendering-system specific code should allocate
a larger structure that contains a nested
PangoFont, fill in the klass
member of
the nested PangoFont with a pointer to
a appropriate PangoFontClass, then call
pango_font_init()
on the structure.
The PangoFont structure contains one member which the implementation fills in.
struct PangoFontFamily;
The PangoFontFamily structure is used to represent a family of related font faces. The faces in a family share a common design, but differ in slant, weight, width and other aspects.
struct PangoFontFace;
The PangoFontFace structure is used to represent a group of fonts with the same family, slant, weight, width, but varying sizes.
typedef struct _PangoFontMap PangoFontMap;
The PangoFontMap represents the set of fonts available for a
particular rendering system. This is a virtual object with
implementations being specific to particular rendering systems. To
create an implementation of a PangoFontMap, the rendering-system
specific code should allocate a larger structure that contains a nested
PangoFontMap, fill in the klass
member of the nested PangoFontMap with a
pointer to a appropriate PangoFontMapClass, then call
pango_font_map_init()
on the structure.
The PangoFontMap structure contains one member which the implementation fills in.
struct PangoFontMapClass { GObjectClass parent_class; PangoFont * (*load_font) (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc); void (*list_families) (PangoFontMap *fontmap, PangoFontFamily ***families, int *n_families); PangoFontset *(*load_fontset) (PangoFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc, PangoLanguage *language); const char *shape_engine_type; guint (*get_serial) (PangoFontMap *fontmap); void (*changed) (PangoFontMap *fontmap); };
The PangoFontMapClass structure holds the virtual functions for a particular PangoFontMap implementation.
GObjectClass |
parent GObjectClass. |
|
a function to load a font with a given description. See
|
||
A function to list available font families. See
|
||
a function to load a fontset with a given given description
suitable for a particular language. See |
||
the type of rendering-system-dependent engines that can handle fonts of this fonts loaded with this fontmap. |
||
a function to get the serial number of the fontmap.
See |
||
struct PangoFontset;
A PangoFontset represents a set of PangoFont to use when rendering text. It is the result of resolving a PangoFontDescription against a particular PangoContext. It has operations for finding the component font for a particular Unicode character, and for finding a composite set of metrics for the entire fontset.
struct PangoFontsetClass { GObjectClass parent_class; PangoFont * (*get_font) (PangoFontset *fontset, guint wc); PangoFontMetrics *(*get_metrics) (PangoFontset *fontset); PangoLanguage * (*get_language) (PangoFontset *fontset); void (*foreach) (PangoFontset *fontset, PangoFontsetForeachFunc func, gpointer data); };
The PangoFontsetClass structure holds the virtual functions for a particular PangoFontset implementation.
GObjectClass |
parent GObjectClass. |
|
a function to get the font in the fontset that contains the
best glyph for the given Unicode character; see |
||
a function to get overall metric information for the fonts
in the fontset; see |
||
a function to get the language of the fontset. |
||
a function to loop over the fonts in the fontset. See
|
typedef struct _PangoFontsetSimple PangoFontsetSimple;
PangoFontsetSimple is a implementation of the abstract PangoFontset base class in terms of an array of fonts, which the creator provides when constructing the PangoFontsetSimple.