summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-10 14:42:12 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-07-10 14:42:12 +0000
commit47e75d6fcb32c5a59dca30b2b8ebf6a30d0e83f4 (patch)
tree61ab9a0ee2192253477db1586c4cc00bd84424f7 /pango
parent96bcf49c1b0d7a0dc82d2dd3b20ca340100be841 (diff)
parent2926528b5b8044591c9307e280eff3ae6bec48d5 (diff)
downloadpango-47e75d6fcb32c5a59dca30b2b8ebf6a30d0e83f4.tar.gz
Merge branch 'matthiasc/for-master' into 'master'
Add a way to show fonts in test-layout output See merge request GNOME/pango!371
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-emoji.c6
-rw-r--r--pango/pango-language.c20
-rw-r--r--pango/pangofc-fontmap.c13
3 files changed, 17 insertions, 22 deletions
diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c
index 0abb8783..334970d6 100644
--- a/pango/pango-emoji.c
+++ b/pango/pango-emoji.c
@@ -104,12 +104,6 @@ _pango_Is_Emoji_Extended_Pictographic (gunichar ch)
}
static inline gboolean
-_pango_Is_Emoji_Text_Default (gunichar ch)
-{
- return _pango_Is_Emoji (ch) && !_pango_Is_Emoji_Presentation (ch);
-}
-
-static inline gboolean
_pango_Is_Emoji_Emoji_Default (gunichar ch)
{
return _pango_Is_Emoji_Presentation (ch);
diff --git a/pango/pango-language.c b/pango/pango-language.c
index bf492a9e..3370bc41 100644
--- a/pango/pango-language.c
+++ b/pango/pango-language.c
@@ -347,11 +347,11 @@ pango_language_from_string (const char *language)
}
len = strlen (language);
- result = g_malloc0 (sizeof (PangoLanguagePrivate) + len + 1);
- g_assert (result);
+ priv = g_malloc0 (sizeof (PangoLanguagePrivate) + len + 1);
+ g_assert (priv);
- priv = (PangoLanguagePrivate *) result;
- result += sizeof (*priv);
+ result = (char *)priv;
+ result += sizeof (PangoLanguagePrivate);
pango_language_private_init (priv);
@@ -746,7 +746,7 @@ parse_default_languages (void)
{
char *p, *p_copy;
gboolean done = FALSE;
- GArray *langs;
+ GPtrArray *langs;
p = getenv ("PANGO_LANGUAGE");
@@ -758,7 +758,7 @@ parse_default_languages (void)
p_copy = p = g_strdup (p);
- langs = g_array_new (TRUE, FALSE, sizeof (PangoLanguage *));
+ langs = g_ptr_array_new ();
while (!done)
{
@@ -776,16 +776,18 @@ parse_default_languages (void)
{
PangoLanguage *l = pango_language_from_string (p);
- g_array_append_val (langs, l);
+ g_ptr_array_add (langs, l);
}
if (!done)
p = end + 1;
}
+ g_ptr_array_add (langs, NULL);
+
g_free (p_copy);
- return (PangoLanguage **) g_array_free (langs, FALSE);
+ return (PangoLanguage **) g_ptr_array_free (langs, FALSE);
}
G_LOCK_DEFINE_STATIC (languages);
@@ -858,7 +860,7 @@ pango_language_get_preferred (void)
/* We call this just for its side-effect of initializing languages */
_pango_script_get_default_language (PANGO_SCRIPT_COMMON);
- return languages;
+ return (PangoLanguage **) languages;
}
/**
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index aada1909..62f2cd4b 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -2538,9 +2538,9 @@ _pango_fc_font_map_fc_to_languages (FcLangSet *langset)
FcStrSet *strset;
FcStrList *list;
FcChar8 *s;
- GArray *langs;
+ GPtrArray *langs;
- langs = g_array_new (TRUE, FALSE, sizeof (PangoLanguage *));
+ langs = g_ptr_array_new ();
strset = FcLangSetGetLangs (langset);
list = FcStrListCreate (strset);
@@ -2549,13 +2549,15 @@ _pango_fc_font_map_fc_to_languages (FcLangSet *langset)
while ((s = FcStrListNext (list)))
{
PangoLanguage *l = pango_language_from_string ((const char *)s);
- g_array_append_val (langs, l);
+ g_ptr_array_add (langs, l);
}
FcStrListDone (list);
FcStrSetDestroy (strset);
- return (PangoLanguage **) g_array_free (langs, FALSE);
+ g_ptr_array_add (langs, NULL);
+
+ return (PangoLanguage **) g_ptr_array_free (langs, FALSE);
}
PangoLanguage **
@@ -3389,9 +3391,6 @@ pango_fc_font_map_get_hb_face (PangoFcFontMap *fcfontmap,
{
hb_blob_t *blob;
- if (!hb_version_atleast (2, 0, 0))
- g_error ("Harfbuzz version too old (%s)\n", hb_version_string ());
-
blob = hb_blob_create_from_file (data->filename);
data->hb_face = hb_face_create (blob, data->id);
hb_blob_destroy (blob);