[pango/fontset-cosmetics] fontset simple: Add a getter



commit bbd72d87e0a21c6c7d22f881ca09cac40667c11f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 24 00:43:48 2021 -0500

    fontset simple: Add a getter

 pango/pango-fontset-simple-private.h | 34 ++++++++++++++++++++++++++++++++++
 pango/pango-fontset-simple.c         | 12 +++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-fontset-simple-private.h b/pango/pango-fontset-simple-private.h
new file mode 100644
index 00000000..e72a3158
--- /dev/null
+++ b/pango/pango-fontset-simple-private.h
@@ -0,0 +1,34 @@
+/* Pango
+ * pango-fontset-simple-private.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.
+ */
+
+#ifndef __PANGO_FONTSET_SIMPLE_PRIVATE_H__
+#define __PANGO_FONTSET_SIMPLE_PRIVATE_H__
+
+#include <pango/pango-fontset-simple.h>
+
+G_BEGIN_DECLS
+
+PangoFont * pango_fontset_simple_get_nth (PangoFontsetSimple *fontset,
+                                          int                 position);
+
+G_END_DECLS
+
+#endif /* __PANGO_FONTSET_SIMPLE_PRIVATE_H__ */
diff --git a/pango/pango-fontset-simple.c b/pango/pango-fontset-simple.c
index a499693f..9a34d8b1 100644
--- a/pango/pango-fontset-simple.c
+++ b/pango/pango-fontset-simple.c
@@ -27,7 +27,7 @@
 
 #include "pango-types.h"
 #include "pango-font-private.h"
-#include "pango-fontset-simple.h"
+#include "pango-fontset-simple-private.h"
 #include "pango-impl-utils.h"
 
 /* {{{ PangoFontset implementation */
@@ -141,6 +141,16 @@ pango_fontset_simple_class_init (PangoFontsetSimpleClass *class)
   fontset_class->foreach = pango_fontset_simple_foreach;
 }
 
+/* }}} */
+/* {{{ Private API */
+
+PangoFont *
+pango_fontset_simple_get_nth (PangoFontsetSimple *fontset,
+                              int                 position)
+{
+  return PANGO_FONT (g_ptr_array_index (fontset->fonts, position));
+}
+
 /* }}} */
 /* {{{ Public API */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]