[pango/pango2: 35/301] Split off PangoFontFamily
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2: 35/301] Split off PangoFontFamily
- Date: Wed, 22 Jun 2022 15:53:32 +0000 (UTC)
commit c8cf9f37e9091c9568ce8d84947f70b2060667d7
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 12 10:35:58 2022 -0500
Split off PangoFontFamily
pango/fonts.c | 254 ---------------------------------
pango/meson.build | 2 +
pango/pango-font-family-private.h | 56 ++++++++
pango/pango-font-family.c | 288 ++++++++++++++++++++++++++++++++++++++
pango/pango-font-family.h | 50 +++++++
pango/pango-font-private.h | 35 +----
pango/pango-font.h | 32 +----
pango/pango-types.h | 4 +-
pango/pango.h | 1 +
pango/pangofc-fontmap.c | 1 +
10 files changed, 403 insertions(+), 320 deletions(-)
---
diff --git a/pango/fonts.c b/pango/fonts.c
index 584c64a4f..bf7133cf8 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -380,260 +380,6 @@ pango_font_get_hb_font (PangoFont *font)
return priv->hb_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 5d21c39e6..1bb845b5e 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 000000000..42ccdb9e9
--- /dev/null
+++ b/pango/pango-font-family-private.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2022 Red Hat, Inc.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <pango/pango-font-family.h>
+
+
+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_FONT_FAMILY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY,
PangoFontFamilyClass))
diff --git a/pango/pango-font-family.c b/pango/pango-font-family.c
new file mode 100644
index 000000000..2c983eb27
--- /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 000000000..5a605a222
--- /dev/null
+++ b/pango/pango-font-family.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2000 Red Hat Software
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#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 ())
+
+PANGO_AVAILABLE_IN_ALL
+PANGO_DECLARE_INTERNAL_TYPE (PangoFontFamily, pango_font_family, PANGO, FONT_FAMILY, GObject)
+
+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_END_DECLS
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index 7f4f74b6b..1e49617ca 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 859005a1e..d931715fc 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -26,42 +26,13 @@
#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>
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 1fbe98e6f..2d2003a57 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 3bb3ebff1..7004610a3 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>
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 19436aaec..866798a52 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -39,6 +39,7 @@
#include "pango-context.h"
#include "pango-font-private.h"
+#include "pango-font-family-private.h"
#include "pangofc-fontmap-private.h"
#include "pangofc-private.h"
#include "pango-impl-utils.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]