summaryrefslogtreecommitdiff
path: root/pango/pango-font-face.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/pango-font-face.c')
-rw-r--r--pango/pango-font-face.c278
1 files changed, 139 insertions, 139 deletions
diff --git a/pango/pango-font-face.c b/pango/pango-font-face.c
index 36232694..475cb871 100644
--- a/pango/pango-font-face.c
+++ b/pango/pango-font-face.c
@@ -1,4 +1,4 @@
-/* Pango
+/* Pango2
*
* Copyright (C) 1999 Red Hat Software
*
@@ -52,19 +52,19 @@ get_backtrace (void)
#endif
/**
- * PangoFontFace:
+ * Pango2FontFace:
*
- * A `PangoFontFace` is used to represent a group of fonts with
+ * A `Pango2FontFace` is used to represent a group of fonts with
* the same family, slant, weight, and width, but varying sizes.
*
- * `PangoFontFace` provides APIs to determine coverage information,
- * such as [method@Pango.FontFace.has_char] and
- * [method@Pango.FontFace.supports_language], as well as general
- * information about the font face like [method@Pango.FontFace.is_monospace]
- * or [method@Pango.FontFace.is_variable].
+ * `Pango2FontFace` provides APIs to determine coverage information,
+ * such as [method@Pango2.FontFace.has_char] and
+ * [method@Pango2.FontFace.supports_language], as well as general
+ * information about the font face like [method@Pango2.FontFace.is_monospace]
+ * or [method@Pango2.FontFace.is_variable].
*/
-/* {{{ PangoFontFace implementation */
+/* {{{ Pango2FontFace implementation */
enum {
PROP_NAME = 1,
@@ -78,73 +78,73 @@ enum {
static GParamSpec *properties[N_PROPERTIES] = { NULL, };
-G_DEFINE_ABSTRACT_TYPE (PangoFontFace, pango_font_face, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE (Pango2FontFace, pango2_font_face, G_TYPE_OBJECT)
static gboolean
-pango_font_face_default_is_monospace (PangoFontFace *face)
+pango2_font_face_default_is_monospace (Pango2FontFace *face)
{
return FALSE;
}
static gboolean
-pango_font_face_default_is_variable (PangoFontFace *face)
+pango2_font_face_default_is_variable (Pango2FontFace *face)
{
return FALSE;
}
static gboolean
-pango_font_face_default_supports_language (PangoFontFace *face,
- PangoLanguage *language)
+pango2_font_face_default_supports_language (Pango2FontFace *face,
+ Pango2Language *language)
{
return TRUE;
}
-static PangoLanguage **
-pango_font_face_default_get_languages (PangoFontFace *face)
+static Pango2Language **
+pango2_font_face_default_get_languages (Pango2FontFace *face)
{
return NULL;
}
static gboolean
-pango_font_face_default_has_char (PangoFontFace *face,
- gunichar wc)
+pango2_font_face_default_has_char (Pango2FontFace *face,
+ gunichar wc)
{
return FALSE;
}
static const char *
-pango_font_face_default_get_faceid (PangoFontFace *face)
+pango2_font_face_default_get_faceid (Pango2FontFace *face)
{
return "";
}
-static PangoFont *
-pango_font_face_default_create_font (PangoFontFace *face,
- const PangoFontDescription *desc,
- float dpi,
- const PangoMatrix *ctm)
+static Pango2Font *
+pango2_font_face_default_create_font (Pango2FontFace *face,
+ const Pango2FontDescription *desc,
+ float dpi,
+ const Pango2Matrix *ctm)
{
return NULL;
}
static void
-pango_font_face_finalize (GObject *object)
+pango2_font_face_finalize (GObject *object)
{
- PangoFontFace *face = PANGO_FONT_FACE (object);
+ Pango2FontFace *face = PANGO2_FONT_FACE (object);
- pango_font_description_free (face->description);
+ pango2_font_description_free (face->description);
g_free (face->name);
- G_OBJECT_CLASS (pango_font_face_parent_class)->finalize (object);
+ G_OBJECT_CLASS (pango2_font_face_parent_class)->finalize (object);
}
static void
-pango_font_face_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+pango2_font_face_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- PangoFontFace *face = PANGO_FONT_FACE (object);
+ Pango2FontFace *face = PANGO2_FONT_FACE (object);
switch (property_id)
{
@@ -153,9 +153,9 @@ pango_font_face_get_property (GObject *object,
break;
case PROP_DESCRIPTION:
- if ((pango_font_description_get_set_fields (face->description) & PANGO_FONT_MASK_FACEID) == 0)
- pango_font_description_set_faceid (face->description,
- pango_font_face_get_faceid (face));
+ if ((pango2_font_description_get_set_fields (face->description) & PANGO2_FONT_MASK_FACEID) == 0)
+ pango2_font_description_set_faceid (face->description,
+ pango2_font_face_get_faceid (face));
g_value_set_boxed (value, face->description);
break;
@@ -165,15 +165,15 @@ pango_font_face_get_property (GObject *object,
break;
case PROP_SYNTHESIZED:
- g_value_set_boolean (value, pango_font_face_is_synthesized (face));
+ g_value_set_boolean (value, pango2_font_face_is_synthesized (face));
break;
case PROP_MONOSPACE:
- g_value_set_boolean (value, pango_font_face_is_monospace (face));
+ g_value_set_boolean (value, pango2_font_face_is_monospace (face));
break;
case PROP_VARIABLE:
- g_value_set_boolean (value, pango_font_face_is_variable (face));
+ g_value_set_boolean (value, pango2_font_face_is_variable (face));
break;
default:
@@ -182,23 +182,23 @@ pango_font_face_get_property (GObject *object,
}
static void
-pango_font_face_class_init (PangoFontFaceClass *class)
+pango2_font_face_class_init (Pango2FontFaceClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- object_class->finalize = pango_font_face_finalize;
- object_class->get_property = pango_font_face_get_property;
+ object_class->finalize = pango2_font_face_finalize;
+ object_class->get_property = pango2_font_face_get_property;
- class->is_monospace = pango_font_face_default_is_monospace;
- class->is_variable = pango_font_face_default_is_variable;
- class->get_languages = pango_font_face_default_get_languages;
- class->supports_language = pango_font_face_default_supports_language;
- class->has_char = pango_font_face_default_has_char;
- class->get_faceid = pango_font_face_default_get_faceid;
- class->create_font = pango_font_face_default_create_font;
+ class->is_monospace = pango2_font_face_default_is_monospace;
+ class->is_variable = pango2_font_face_default_is_variable;
+ class->get_languages = pango2_font_face_default_get_languages;
+ class->supports_language = pango2_font_face_default_supports_language;
+ class->has_char = pango2_font_face_default_has_char;
+ class->get_faceid = pango2_font_face_default_get_faceid;
+ class->create_font = pango2_font_face_default_create_font;
/**
- * PangoFontFace:name: (attributes org.gtk.Property.get=pango_font_face_get_name)
+ * Pango2FontFace:name: (attributes org.gtk.Property.get=pango2_font_face_get_name)
*
* A name representing the style of this face.
*/
@@ -207,7 +207,7 @@ pango_font_face_class_init (PangoFontFaceClass *class)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
- * PangoFontFace:description: (attributes org.gtk.Property.get=pango_font_face_describe)
+ * Pango2FontFace:description: (attributes org.gtk.Property.get=pango2_font_face_describe)
*
* A font description that matches the face.
*
@@ -217,21 +217,21 @@ pango_font_face_class_init (PangoFontFaceClass *class)
*/
properties[PROP_DESCRIPTION] =
g_param_spec_boxed ("description", NULL, NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
+ PANGO2_TYPE_FONT_DESCRIPTION,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
- * PangoFontFace:family: (attributes org.gtk.Property.get=pango_font_face_get_family)
+ * Pango2FontFace:family: (attributes org.gtk.Property.get=pango2_font_face_get_family)
*
- * The `PangoFontFamily` that the face belongs to.
+ * The `Pango2FontFamily` that the face belongs to.
*/
properties[PROP_FAMILY] =
g_param_spec_object ("family", NULL, NULL,
- PANGO_TYPE_FONT_FAMILY,
+ PANGO2_TYPE_FONT_FAMILY,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
- * PangoFontFace:synthesized: (attributes org.gtk.Property.get=pango_font_face_is_synthesized)
+ * Pango2FontFace:synthesized: (attributes org.gtk.Property.get=pango2_font_face_is_synthesized)
*
* `TRUE` if the face is synthesized.
*
@@ -244,7 +244,7 @@ pango_font_face_class_init (PangoFontFaceClass *class)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
- * PangoFontFace:monospace: (attributes org.gtk.Property.get=pango_font_face_is_monospace)
+ * Pango2FontFace:monospace: (attributes org.gtk.Property.get=pango2_font_face_is_monospace)
*
* `TRUE` if the face is designed for text display where the the
* characters form a regular grid.
@@ -254,7 +254,7 @@ pango_font_face_class_init (PangoFontFaceClass *class)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
- * PangoFontFace:variable: (attributes org.gtk.Property.get=pango_font_face_is_variable)
+ * Pango2FontFace:variable: (attributes org.gtk.Property.get=pango2_font_face_is_variable)
*
* `TRUE` if the face has axes that can be modified
* to produce variations.
@@ -267,40 +267,40 @@ pango_font_face_class_init (PangoFontFaceClass *class)
}
static void
-pango_font_face_init (PangoFontFace *face G_GNUC_UNUSED)
+pango2_font_face_init (Pango2FontFace *face G_GNUC_UNUSED)
{
}
/* }}} */
/* {{{ Private API */
-PangoFont *
-pango_font_face_create_font (PangoFontFace *face,
- const PangoFontDescription *desc,
- float dpi,
- const PangoMatrix *ctm)
+Pango2Font *
+pango2_font_face_create_font (Pango2FontFace *face,
+ const Pango2FontDescription *desc,
+ float dpi,
+ const Pango2Matrix *ctm)
{
- if (!PANGO_IS_FONT_FACE (face))
+ if (!PANGO2_IS_FONT_FACE (face))
{
- char *s = pango_font_description_to_string (desc);
+ char *s = pango2_font_description_to_string (desc);
#ifdef __linux__
char *bs = get_backtrace ();
#else
char *bs = g_strdup ("");
#endif
- g_critical ("pango_font_face_create_font called without a face for %s\n%s", s, bs);
+ g_critical ("pango2_font_face_create_font called without a face for %s\n%s", s, bs);
g_free (s);
g_free (bs);
}
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), NULL);
- return PANGO_FONT_FACE_GET_CLASS (face)->create_font (face, desc, dpi, ctm);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->create_font (face, desc, dpi, ctm);
}
/*< private >
- * pango_font_face_get_faceid:
- * @self: a `PangoHbFace`
+ * pango2_font_face_get_faceid:
+ * @self: a `Pango2HbFace`
*
* Returns the faceid of the face.
*
@@ -310,10 +310,10 @@ pango_font_face_create_font (PangoFontFace *face,
* this), the face index, the instance ID, as well as synthetic
* tweaks such as emboldening and transforms and variations.
*
- * [method@Pango.FontFace.describe] adds the faceid to the font
+ * [method@Pango2.FontFace.describe] adds the faceid to the font
* description that it produces.
*
- * See pango_hb_family_find_face() for the code that takes the
+ * See pango2_hb_family_find_face() for the code that takes the
* faceid into account when searching for a face. It is careful
* to fall back to approximate matching if an exact match for
* the faceid isn't found. That should make it safe to preserve
@@ -328,19 +328,19 @@ pango_font_face_create_font (PangoFontFace *face,
* Returns: (transfer none): the faceid
*/
const char *
-pango_font_face_get_faceid (PangoFontFace *face)
+pango2_font_face_get_faceid (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), "");
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), "");
- return PANGO_FONT_FACE_GET_CLASS (face)->get_faceid (face);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->get_faceid (face);
}
/* }}} */
/* {{{ Public API */
/**
- * pango_font_face_describe:
- * @face: a `PangoFontFace`
+ * pango2_font_face_describe:
+ * @face: a `Pango2FontFace`
*
* Returns a font description that matches the face.
*
@@ -348,27 +348,27 @@ pango_font_face_get_faceid (PangoFontFace *face)
* variant, weight and stretch of the face, but its size field
* will be unset.
*
- * Return value: a newly-created `PangoFontDescription` structure
- * holding the description of the face. Use [method@Pango.FontDescription.free]
+ * Return value: a newly-created `Pango2FontDescription` structure
+ * holding the description of the face. Use [method@Pango2.FontDescription.free]
* to free the result.
*/
-PangoFontDescription *
-pango_font_face_describe (PangoFontFace *face)
+Pango2FontDescription *
+pango2_font_face_describe (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), NULL);
- if ((pango_font_description_get_set_fields (face->description) & PANGO_FONT_MASK_FACEID) == 0)
- pango_font_description_set_faceid (face->description,
- pango_font_face_get_faceid (face));
+ if ((pango2_font_description_get_set_fields (face->description) & PANGO2_FONT_MASK_FACEID) == 0)
+ pango2_font_description_set_faceid (face->description,
+ pango2_font_face_get_faceid (face));
- return pango_font_description_copy (face->description);
+ return pango2_font_description_copy (face->description);
}
/**
- * pango_font_face_is_synthesized:
- * @face: a `PangoFontFace`
+ * pango2_font_face_is_synthesized:
+ * @face: a `Pango2FontFace`
*
- * Returns whether a `PangoFontFace` is synthesized.
+ * Returns whether a `Pango2FontFace` is synthesized.
*
* This will be the case if the underlying font rendering engine
* creates this face from another face, by shearing, emboldening,
@@ -377,19 +377,19 @@ pango_font_face_describe (PangoFontFace *face)
* Return value: whether @face is synthesized
*/
gboolean
-pango_font_face_is_synthesized (PangoFontFace *face)
+pango2_font_face_is_synthesized (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- if (PANGO_FONT_FACE_GET_CLASS (face)->is_synthesized != NULL)
- return PANGO_FONT_FACE_GET_CLASS (face)->is_synthesized (face);
+ if (PANGO2_FONT_FACE_GET_CLASS (face)->is_synthesized != NULL)
+ return PANGO2_FONT_FACE_GET_CLASS (face)->is_synthesized (face);
else
return FALSE;
}
/**
- * pango_font_face_get_name:
- * @face: a `PangoFontFace`.
+ * pango2_font_face_get_name:
+ * @face: a `Pango2FontFace`.
*
* Gets a name representing the style of this face.
*
@@ -401,32 +401,32 @@ pango_font_face_is_synthesized (PangoFontFace *face)
* owned by the face object and must not be modified or freed.
*/
const char *
-pango_font_face_get_name (PangoFontFace *face)
+pango2_font_face_get_name (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), NULL);
return face->name;
}
/**
- * pango_font_face_get_family:
- * @face: a `PangoFontFace`
+ * pango2_font_face_get_family:
+ * @face: a `Pango2FontFace`
*
- * Gets the `PangoFontFamily` that the face belongs to.
+ * Gets the `Pango2FontFamily` that the face belongs to.
*
- * Returns: (transfer none): the `PangoFontFamily`
+ * Returns: (transfer none): the `Pango2FontFamily`
*/
-PangoFontFamily *
-pango_font_face_get_family (PangoFontFace *face)
+Pango2FontFamily *
+pango2_font_face_get_family (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), NULL);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), NULL);
return face->family;
}
/**
- * pango_font_face_is_monospace:
- * @face: a `PangoFontFace`
+ * pango2_font_face_is_monospace:
+ * @face: a `Pango2FontFace`
*
* Returns whether this font face is monospace.
*
@@ -441,23 +441,23 @@ pango_font_face_get_family (PangoFontFace *face)
* font.
*
* The best way to find out the grid-cell size is to call
- * [method@Pango.FontMetrics.get_approximate_digit_width], since the
- * results of [method@Pango.FontMetrics.get_approximate_char_width] may
+ * [method@Pango2.FontMetrics.get_approximate_digit_width], since the
+ * results of [method@Pango2.FontMetrics.get_approximate_char_width] may
* be affected by double-width characters.
*
* Returns: `TRUE` if @face is monospace
*/
gboolean
-pango_font_face_is_monospace (PangoFontFace *face)
+pango2_font_face_is_monospace (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- return PANGO_FONT_FACE_GET_CLASS (face)->is_monospace (face);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->is_monospace (face);
}
/**
- * pango_font_face_is_variable:
- * @face: a `PangoFontFace`
+ * pango2_font_face_is_variable:
+ * @face: a `Pango2FontFace`
*
* Returns whether this font face is variable.
*
@@ -465,22 +465,22 @@ pango_font_face_is_monospace (PangoFontFace *face)
* to produce variations.
*
* Such axes are also known as _variations_; see
- * [method@Pango.FontDescription.set_variations] for more information.
+ * [method@Pango2.FontDescription.set_variations] for more information.
*
* Returns: `TRUE` if @face is variable
*/
gboolean
-pango_font_face_is_variable (PangoFontFace *face)
+pango2_font_face_is_variable (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- return PANGO_FONT_FACE_GET_CLASS (face)->is_variable (face);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->is_variable (face);
}
/**
- * pango_font_face_supports_language:
- * @face: a `PangoFontFace`
- * @language: a `PangoLanguage`
+ * pango2_font_face_supports_language:
+ * @face: a `Pango2FontFace`
+ * @language: a `Pango2Language`
*
* Returns whether the face has all the glyphs necessary to
* support this language.
@@ -488,17 +488,17 @@ pango_font_face_is_variable (PangoFontFace *face)
* Returns: `TRUE` if @face supports @language
*/
gboolean
-pango_font_face_supports_language (PangoFontFace *face,
- PangoLanguage *language)
+pango2_font_face_supports_language (Pango2FontFace *face,
+ Pango2Language *language)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- return PANGO_FONT_FACE_GET_CLASS (face)->supports_language (face, language);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->supports_language (face, language);
}
/**
- * pango_font_face_get_languages:
- * @face: a `PangoFontFace`
+ * pango2_font_face_get_languages:
+ * @face: a `Pango2FontFace`
*
* Returns the languages that are supported by the face.
*
@@ -509,20 +509,20 @@ pango_font_face_supports_language (PangoFontFace *face,
* The returned array is only valid as long as the face
* and its fontmap are valid.
*
- * Returns: (transfer none) (nullable) (array zero-terminated=1) (element-type PangoLanguage):
- * an array of `PangoLanguage`
+ * Returns: (transfer none) (nullable) (array zero-terminated=1) (element-type Pango2Language):
+ * an array of `Pango2Language`
*/
-PangoLanguage **
-pango_font_face_get_languages (PangoFontFace *face)
+Pango2Language **
+pango2_font_face_get_languages (Pango2FontFace *face)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- return PANGO_FONT_FACE_GET_CLASS (face)->get_languages (face);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->get_languages (face);
}
/**
- * pango_font_face_has_char:
- * @face: a `PangoFontFace`
+ * pango2_font_face_has_char:
+ * @face: a `Pango2FontFace`
* @wc: a Unicode character
*
* Returns whether the face provides a glyph for this character.
@@ -530,12 +530,12 @@ pango_font_face_get_languages (PangoFontFace *face)
* Returns: `TRUE` if @font can render @wc
*/
gboolean
-pango_font_face_has_char (PangoFontFace *face,
- gunichar wc)
+pango2_font_face_has_char (Pango2FontFace *face,
+ gunichar wc)
{
- g_return_val_if_fail (PANGO_IS_FONT_FACE (face), FALSE);
+ g_return_val_if_fail (PANGO2_IS_FONT_FACE (face), FALSE);
- return PANGO_FONT_FACE_GET_CLASS (face)->has_char (face, wc);
+ return PANGO2_FONT_FACE_GET_CLASS (face)->has_char (face, wc);
}
/* }}} */