diff options
author | Benjamin Otte <otte@redhat.com> | 2019-12-08 03:33:02 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-12-08 03:33:02 +0100 |
commit | 5e07328675aa49d9b84b3ab4405ff94b92835e9c (patch) | |
tree | 42f19c9d575ec1ddb7976079561780ae2aa93714 /pango/pangofc-fontmap.c | |
parent | 5ab34cc4103de109ef4e4e54c435c5e4e41cfe96 (diff) | |
download | pango-5e07328675aa49d9b84b3ab4405ff94b92835e9c.tar.gz |
family: Clarify and improve pango_font_family_get_face()
- Clarify that the function can return NULL
- Fix annotations
- Allow passing NULL as name to get a guaranteed default face.
- Map the default name to "Regular" in the FC backend
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r-- | pango/pangofc-fontmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index 49040b24..9ecea09b 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -2861,6 +2861,9 @@ pango_fc_family_get_face (PangoFontFamily *family, ensure_faces (fcfamily); + if (name == NULL) + name = "Regular"; /* This name always exists in fontconfig */ + for (i = 0; i < fcfamily->n_faces; i++) { PangoFontFace *face = PANGO_FONT_FACE (fcfamily->faces[i]); |