summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-02-12 10:35:58 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-02-17 14:01:45 -0600
commit435f55d0c7fd2d455647a300081bf5106bcc36ac (patch)
treec73244d8376dc701e0d0077ec7474e2722b20783
parent64a766e99830ed0e3658c9df93f2dcae36a5aa42 (diff)
downloadpango-435f55d0c7fd2d455647a300081bf5106bcc36ac.tar.gz
Split off PangoFontFamily
-rw-r--r--pango/fonts.c255
-rw-r--r--pango/meson.build2
-rw-r--r--pango/pango-font-family-private.h61
-rw-r--r--pango/pango-font-family.c288
-rw-r--r--pango/pango-font-family.h57
-rw-r--r--pango/pango-font-private.h35
-rw-r--r--pango/pango-font.h32
-rw-r--r--pango/pango-types.h4
-rw-r--r--pango/pango.h1
9 files changed, 415 insertions, 320 deletions
diff --git a/pango/fonts.c b/pango/fonts.c
index f2029ed2..bf7133cf 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -28,6 +28,7 @@
#include "pango-types.h"
#include "pango-font-private.h"
+#include "pango-font-metrics-private.h"
#include "pango-fontmap.h"
#include "pango-impl-utils.h"
@@ -380,260 +381,6 @@ pango_font_get_hb_font (PangoFont *font)
}
/*
- * PangoFontFamily
- */
-
-static GType
-pango_font_family_get_item_type (GListModel *list)
-{
- return PANGO_TYPE_FONT_FACE;
-}
-
-static guint
-pango_font_family_get_n_items (GListModel *list)
-{
- PangoFontFamily *family = PANGO_FONT_FAMILY (list);
- int n_faces;
-
- pango_font_family_list_faces (family, NULL, &n_faces);
-
- return (guint)n_faces;
-}
-
-static gpointer
-pango_font_family_get_item (GListModel *list,
- guint position)
-{
- PangoFontFamily *family = PANGO_FONT_FAMILY (list);
- PangoFontFace **faces;
- int n_faces;
- PangoFontFace *face;
-
- pango_font_family_list_faces (family, &faces, &n_faces);
-
- if (position < n_faces)
- face = g_object_ref (faces[position]);
- else
- face = NULL;
-
- g_free (faces);
-
- return face;
-}
-
-static void
-pango_font_family_list_model_init (GListModelInterface *iface)
-{
- iface->get_item_type = pango_font_family_get_item_type;
- iface->get_n_items = pango_font_family_get_n_items;
- iface->get_item = pango_font_family_get_item;
-}
-
-G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PangoFontFamily, pango_font_family, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, pango_font_family_list_model_init))
-
-static PangoFontFace *pango_font_family_real_get_face (PangoFontFamily *family,
- const char *name);
-
-static gboolean
-pango_font_family_default_is_monospace (PangoFontFamily *family)
-{
- return FALSE;
-}
-
-static gboolean
-pango_font_family_default_is_variable (PangoFontFamily *family)
-{
- return FALSE;
-}
-
-static void
-pango_font_family_default_list_faces (PangoFontFamily *family,
- PangoFontFace ***faces,
- int *n_faces)
-{
- if (faces)
- *faces = NULL;
-
- if (n_faces)
- *n_faces = 0;
-}
-
-static void
-pango_font_family_class_init (PangoFontFamilyClass *class G_GNUC_UNUSED)
-{
- class->is_monospace = pango_font_family_default_is_monospace;
- class->is_variable = pango_font_family_default_is_variable;
- class->get_face = pango_font_family_real_get_face;
- class->list_faces = pango_font_family_default_list_faces;
-}
-
-static void
-pango_font_family_init (PangoFontFamily *family G_GNUC_UNUSED)
-{
-}
-
-/**
- * pango_font_family_get_name:
- * @family: a `PangoFontFamily`
- *
- * 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.
- *
- * Return value: the name of the family. This string is owned
- * by the family object and must not be modified or freed.
- */
-const char *
-pango_font_family_get_name (PangoFontFamily *family)
-{
- g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), NULL);
-
- return PANGO_FONT_FAMILY_GET_CLASS (family)->get_name (family);
-}
-
-/**
- * pango_font_family_list_faces:
- * @family: a `PangoFontFamily`
- * @faces: (out) (optional) (array length=n_faces) (transfer container):
- * location to store an array of pointers to `PangoFontFace` objects,
- * or %NULL. This array should be freed with g_free() when it is no
- * longer needed.
- * @n_faces: (out): location to store number of elements in @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.
- *
- * 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 [iface@Gio.ListModel] interface
- * for enumerating faces.
- */
-void
-pango_font_family_list_faces (PangoFontFamily *family,
- PangoFontFace ***faces,
- int *n_faces)
-{
- g_return_if_fail (PANGO_IS_FONT_FAMILY (family));
-
- PANGO_FONT_FAMILY_GET_CLASS (family)->list_faces (family, faces, n_faces);
-}
-
-static PangoFontFace *
-pango_font_family_real_get_face (PangoFontFamily *family,
- const char *name)
-{
- PangoFontFace **faces;
- int n_faces;
- PangoFontFace *face;
- int i;
-
- pango_font_family_list_faces (family, &faces, &n_faces);
-
- face = NULL;
- if (name == NULL && n_faces > 0)
- {
- face = faces[0];
- }
- else
- {
- for (i = 0; i < n_faces; i++)
- {
- if (strcmp (name, pango_font_face_get_face_name (faces[i])) == 0)
- {
- face = faces[i];
- break;
- }
- }
- }
-
- g_free (faces);
-
- return face;
-}
-
-/**
- * pango_font_family_get_face:
- * @family: a `PangoFontFamily`
- * @name: (nullable): the name of a face. If the name is %NULL,
- * the family's default face (fontconfig calls it "Regular")
- * will be returned.
- *
- * Gets the `PangoFontFace` of @family with the given name.
- *
- * Returns: (transfer none) (nullable): the `PangoFontFace`,
- * or %NULL if no face with the given name exists.
- *
- * Since: 1.46
- */
-PangoFontFace *
-pango_font_family_get_face (PangoFontFamily *family,
- const char *name)
-{
- g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), NULL);
-
- return PANGO_FONT_FAMILY_GET_CLASS (family)->get_face (family, name);
-}
-
-/**
- * pango_font_family_is_monospace:
- * @family: a `PangoFontFamily`
- *
- * 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
- * [method@Pango.FontMetrics.get_approximate_digit_width], since the
- * results of [method@Pango.FontMetrics.get_approximate_char_width] may
- * be affected by double-width characters.
- *
- * Return value: %TRUE if the family is monospace.
- *
- * Since: 1.4
- */
-gboolean
-pango_font_family_is_monospace (PangoFontFamily *family)
-{
- g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE);
-
- return PANGO_FONT_FAMILY_GET_CLASS (family)->is_monospace (family);
-}
-
-/**
- * pango_font_family_is_variable:
- * @family: a `PangoFontFamily`
- *
- * 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
- * [method@Pango.FontDescription.set_variations] for more information.
- *
- * Return value: %TRUE if the family is variable
- *
- * Since: 1.44
- */
-gboolean
-pango_font_family_is_variable (PangoFontFamily *family)
-{
- g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE);
-
- return PANGO_FONT_FAMILY_GET_CLASS (family)->is_variable (family);
-}
-
-/*
* PangoFontFace
*/
diff --git a/pango/meson.build b/pango/meson.build
index a6ba61ee..e560e27b 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -11,6 +11,7 @@ pango_sources = [
'pango-coverage.c',
'pango-emoji.c',
'pango-font-description.c',
+ 'pango-font-family.c',
'pango-font-metrics.c',
'pango-fontmap.c',
'pango-fontset.c',
@@ -43,6 +44,7 @@ pango_headers = [
'pango-direction.h',
'pango-font.h',
'pango-font-description.h',
+ 'pango-font-family.h',
'pango-font-metrics.h',
'pango-fontmap.h',
'pango-fontset.h',
diff --git a/pango/pango-font-family-private.h b/pango/pango-font-family-private.h
new file mode 100644
index 00000000..4fe940ee
--- /dev/null
+++ b/pango/pango-font-family-private.h
@@ -0,0 +1,61 @@
+/* Pango
+ *
+ * Copyright (C) 2000 Red Hat Software
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#pragma once
+
+#include <pango/pango-font-family.h>
+
+G_BEGIN_DECLS
+
+typedef struct _PangoFontFamilyClass PangoFontFamilyClass;
+
+struct _PangoFontFamily
+{
+ GObject parent_instance;
+};
+
+struct _PangoFontFamilyClass
+{
+ GObjectClass parent_class;
+
+ /*< public >*/
+
+ void (*list_faces) (PangoFontFamily *family,
+ PangoFontFace ***faces,
+ int *n_faces);
+ const char * (*get_name) (PangoFontFamily *family);
+ gboolean (*is_monospace) (PangoFontFamily *family);
+ gboolean (*is_variable) (PangoFontFamily *family);
+
+ PangoFontFace * (*get_face) (PangoFontFamily *family,
+ const char *name);
+
+
+ /*< private >*/
+
+ /* Padding for future expansion */
+ void (*_pango_reserved2) (void);
+};
+
+#define PANGO_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
+#define PANGO_IS_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY))
+#define PANGO_FONT_FAMILY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
+
+G_END_DECLS
diff --git a/pango/pango-font-family.c b/pango/pango-font-family.c
new file mode 100644
index 00000000..2c983eb2
--- /dev/null
+++ b/pango/pango-font-family.c
@@ -0,0 +1,288 @@
+/* Pango
+ *
+ * Copyright (C) 1999 Red Hat Software
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "pango-font-family-private.h"
+#include "pango-font.h"
+
+#if 0
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include <gio/gio.h>
+
+#include "pango-types.h"
+#include "pango-font-private.h"
+#include "pango-fontmap.h"
+#include "pango-impl-utils.h"
+#endif
+
+
+static GType
+pango_font_family_get_item_type (GListModel *list)
+{
+ return PANGO_TYPE_FONT_FACE;
+}
+
+static guint
+pango_font_family_get_n_items (GListModel *list)
+{
+ PangoFontFamily *family = PANGO_FONT_FAMILY (list);
+ int n_faces;
+
+ pango_font_family_list_faces (family, NULL, &n_faces);
+
+ return (guint)n_faces;
+}
+
+static gpointer
+pango_font_family_get_item (GListModel *list,
+ guint position)
+{
+ PangoFontFamily *family = PANGO_FONT_FAMILY (list);
+ PangoFontFace **faces;
+ int n_faces;
+ PangoFontFace *face;
+
+ pango_font_family_list_faces (family, &faces, &n_faces);
+
+ if (position < n_faces)
+ face = g_object_ref (faces[position]);
+ else
+ face = NULL;
+
+ g_free (faces);
+
+ return face;
+}
+
+static void
+pango_font_family_list_model_init (GListModelInterface *iface)
+{
+ iface->get_item_type = pango_font_family_get_item_type;
+ iface->get_n_items = pango_font_family_get_n_items;
+ iface->get_item = pango_font_family_get_item;
+}
+
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PangoFontFamily, pango_font_family, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, pango_font_family_list_model_init))
+
+static PangoFontFace *pango_font_family_real_get_face (PangoFontFamily *family,
+ const char *name);
+
+static gboolean
+pango_font_family_default_is_monospace (PangoFontFamily *family)
+{
+ return FALSE;
+}
+
+static gboolean
+pango_font_family_default_is_variable (PangoFontFamily *family)
+{
+ return FALSE;
+}
+
+static void
+pango_font_family_default_list_faces (PangoFontFamily *family,
+ PangoFontFace ***faces,
+ int *n_faces)
+{
+ if (faces)
+ *faces = NULL;
+
+ if (n_faces)
+ *n_faces = 0;
+}
+
+static void
+pango_font_family_class_init (PangoFontFamilyClass *class G_GNUC_UNUSED)
+{
+ class->is_monospace = pango_font_family_default_is_monospace;
+ class->is_variable = pango_font_family_default_is_variable;
+ class->get_face = pango_font_family_real_get_face;
+ class->list_faces = pango_font_family_default_list_faces;
+}
+
+static void
+pango_font_family_init (PangoFontFamily *family G_GNUC_UNUSED)
+{
+}
+
+/**
+ * pango_font_family_get_name:
+ * @family: a `PangoFontFamily`
+ *
+ * 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.
+ *
+ * Return value: the name of the family. This string is owned
+ * by the family object and must not be modified or freed.
+ */
+const char *
+pango_font_family_get_name (PangoFontFamily *family)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), NULL);
+
+ return PANGO_FONT_FAMILY_GET_CLASS (family)->get_name (family);
+}
+
+/**
+ * pango_font_family_list_faces:
+ * @family: a `PangoFontFamily`
+ * @faces: (out) (optional) (array length=n_faces) (transfer container):
+ * location to store an array of pointers to `PangoFontFace` objects,
+ * or %NULL. This array should be freed with g_free() when it is no
+ * longer needed.
+ * @n_faces: (out): location to store number of elements in @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.
+ *
+ * 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 [iface@Gio.ListModel] interface
+ * for enumerating faces.
+ */
+void
+pango_font_family_list_faces (PangoFontFamily *family,
+ PangoFontFace ***faces,
+ int *n_faces)
+{
+ g_return_if_fail (PANGO_IS_FONT_FAMILY (family));
+
+ PANGO_FONT_FAMILY_GET_CLASS (family)->list_faces (family, faces, n_faces);
+}
+
+static PangoFontFace *
+pango_font_family_real_get_face (PangoFontFamily *family,
+ const char *name)
+{
+ PangoFontFace **faces;
+ int n_faces;
+ PangoFontFace *face;
+ int i;
+
+ pango_font_family_list_faces (family, &faces, &n_faces);
+
+ face = NULL;
+ if (name == NULL && n_faces > 0)
+ {
+ face = faces[0];
+ }
+ else
+ {
+ for (i = 0; i < n_faces; i++)
+ {
+ if (strcmp (name, pango_font_face_get_face_name (faces[i])) == 0)
+ {
+ face = faces[i];
+ break;
+ }
+ }
+ }
+
+ g_free (faces);
+
+ return face;
+}
+
+/**
+ * pango_font_family_get_face:
+ * @family: a `PangoFontFamily`
+ * @name: (nullable): the name of a face. If the name is %NULL,
+ * the family's default face (fontconfig calls it "Regular")
+ * will be returned.
+ *
+ * Gets the `PangoFontFace` of @family with the given name.
+ *
+ * Returns: (transfer none) (nullable): the `PangoFontFace`,
+ * or %NULL if no face with the given name exists.
+ *
+ * Since: 1.46
+ */
+PangoFontFace *
+pango_font_family_get_face (PangoFontFamily *family,
+ const char *name)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), NULL);
+
+ return PANGO_FONT_FAMILY_GET_CLASS (family)->get_face (family, name);
+}
+
+/**
+ * pango_font_family_is_monospace:
+ * @family: a `PangoFontFamily`
+ *
+ * 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
+ * [method@Pango.FontMetrics.get_approximate_digit_width], since the
+ * results of [method@Pango.FontMetrics.get_approximate_char_width] may
+ * be affected by double-width characters.
+ *
+ * Return value: %TRUE if the family is monospace.
+ *
+ * Since: 1.4
+ */
+gboolean
+pango_font_family_is_monospace (PangoFontFamily *family)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE);
+
+ return PANGO_FONT_FAMILY_GET_CLASS (family)->is_monospace (family);
+}
+
+/**
+ * pango_font_family_is_variable:
+ * @family: a `PangoFontFamily`
+ *
+ * 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
+ * [method@Pango.FontDescription.set_variations] for more information.
+ *
+ * Return value: %TRUE if the family is variable
+ *
+ * Since: 1.44
+ */
+gboolean
+pango_font_family_is_variable (PangoFontFamily *family)
+{
+ g_return_val_if_fail (PANGO_IS_FONT_FAMILY (family), FALSE);
+
+ return PANGO_FONT_FAMILY_GET_CLASS (family)->is_variable (family);
+}
diff --git a/pango/pango-font-family.h b/pango/pango-font-family.h
new file mode 100644
index 00000000..7979a5ec
--- /dev/null
+++ b/pango/pango-font-family.h
@@ -0,0 +1,57 @@
+/* Pango
+ * pango-font-family.h: Font handling
+ *
+ * Copyright (C) 2000 Red Hat Software
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#pragma once
+
+#include <pango/pango-types.h>
+
+#include <glib-object.h>
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+
+#define PANGO_TYPE_FONT_FAMILY (pango_font_family_get_type ())
+#define PANGO_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
+#define PANGO_IS_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
+
+PANGO_AVAILABLE_IN_ALL
+GType pango_font_family_get_type (void) G_GNUC_CONST;
+
+PANGO_AVAILABLE_IN_ALL
+void pango_font_family_list_faces (PangoFontFamily *family,
+ PangoFontFace ***faces,
+ int *n_faces);
+PANGO_AVAILABLE_IN_ALL
+const char * pango_font_family_get_name (PangoFontFamily *family) G_GNUC_PURE;
+PANGO_AVAILABLE_IN_1_4
+gboolean pango_font_family_is_monospace (PangoFontFamily *family) G_GNUC_PURE;
+PANGO_AVAILABLE_IN_1_44
+gboolean pango_font_family_is_variable (PangoFontFamily *family) G_GNUC_PURE;
+
+PANGO_AVAILABLE_IN_1_46
+PangoFontFace * pango_font_family_get_face (PangoFontFamily *family,
+ const char *name);
+
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontFamily, g_object_unref)
+
+G_END_DECLS
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index 7f4f74b6..1e49617c 100644
--- a/pango/pango-font-private.h
+++ b/pango/pango-font-private.h
@@ -22,6 +22,7 @@
#ifndef __PANGO_FONT_PRIVATE_H__
#define __PANGO_FONT_PRIVATE_H__
+#include <pango/pango-font-family.h>
#include <pango/pango-font.h>
#include <pango/pango-coverage.h>
#include <pango/pango-types.h>
@@ -30,40 +31,6 @@
G_BEGIN_DECLS
-typedef struct _PangoFontFamilyClass PangoFontFamilyClass;
-
-struct _PangoFontFamily
-{
- GObject parent_instance;
-};
-
-struct _PangoFontFamilyClass
-{
- GObjectClass parent_class;
-
- /*< public >*/
-
- void (*list_faces) (PangoFontFamily *family,
- PangoFontFace ***faces,
- int *n_faces);
- const char * (*get_name) (PangoFontFamily *family);
- gboolean (*is_monospace) (PangoFontFamily *family);
- gboolean (*is_variable) (PangoFontFamily *family);
-
- PangoFontFace * (*get_face) (PangoFontFamily *family,
- const char *name);
-
-
- /*< private >*/
-
- /* Padding for future expansion */
- void (*_pango_reserved2) (void);
-};
-
-#define PANGO_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
-#define PANGO_IS_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY))
-#define PANGO_FONT_FAMILY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass))
-
struct _PangoFontFace
{
GObject parent_instance;
diff --git a/pango/pango-font.h b/pango/pango-font.h
index 859005a1..d931715f 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -26,6 +26,7 @@
#include <pango/pango-types.h>
#include <pango/pango-font-description.h>
#include <pango/pango-font-metrics.h>
+#include <pango/pango-font-family.h>
#include <glib-object.h>
#include <hb.h>
@@ -33,36 +34,6 @@
G_BEGIN_DECLS
/*
- * PangoFontFamily
- */
-
-#define PANGO_TYPE_FONT_FAMILY (pango_font_family_get_type ())
-#define PANGO_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily))
-#define PANGO_IS_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY))
-
-typedef struct _PangoFontFace PangoFontFace;
-typedef struct _PangoFontFamily PangoFontFamily;
-
-PANGO_AVAILABLE_IN_ALL
-GType pango_font_family_get_type (void) G_GNUC_CONST;
-
-PANGO_AVAILABLE_IN_ALL
-void pango_font_family_list_faces (PangoFontFamily *family,
- PangoFontFace ***faces,
- int *n_faces);
-PANGO_AVAILABLE_IN_ALL
-const char *pango_font_family_get_name (PangoFontFamily *family) G_GNUC_PURE;
-PANGO_AVAILABLE_IN_1_4
-gboolean pango_font_family_is_monospace (PangoFontFamily *family) G_GNUC_PURE;
-PANGO_AVAILABLE_IN_1_44
-gboolean pango_font_family_is_variable (PangoFontFamily *family) G_GNUC_PURE;
-
-PANGO_AVAILABLE_IN_1_46
-PangoFontFace *pango_font_family_get_face (PangoFontFamily *family,
- const char *name);
-
-
-/*
* PangoFontFace
*/
@@ -196,7 +167,6 @@ PangoFont * pango_font_deserialize (PangoContext *context,
#endif
#endif
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontFamily, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontFace, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFont, g_object_unref)
diff --git a/pango/pango-types.h b/pango/pango-types.h
index ae27630d..810929fd 100644
--- a/pango/pango-types.h
+++ b/pango/pango-types.h
@@ -31,7 +31,9 @@ G_BEGIN_DECLS
typedef struct _PangoLogAttr PangoLogAttr;
-typedef struct _PangoFont PangoFont;
+typedef struct _PangoFont PangoFont;
+typedef struct _PangoFontFace PangoFontFace;
+typedef struct _PangoFontFamily PangoFontFamily;
typedef struct _PangoFontMap PangoFontMap;
diff --git a/pango/pango.h b/pango/pango.h
index 3bb3ebff..7004610a 100644
--- a/pango/pango.h
+++ b/pango/pango.h
@@ -32,6 +32,7 @@
#include <pango/pango-features.h>
#include <pango/pango-font.h>
#include <pango/pango-font-description.h>
+#include <pango/pango-font-family.h>
#include <pango/pango-font-metrics.h>
#include <pango/pango-fontmap.h>
#include <pango/pango-fontset.h>