[pango/matthiasc/for-main: 17/17] itemize: Try harder to avoid NULL fonts
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/matthiasc/for-main: 17/17] itemize: Try harder to avoid NULL fonts
- Date: Sat, 25 Dec 2021 14:35:31 +0000 (UTC)
commit eb995ddebf3ac0fee3f669353619273f8f99bc9d
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 24 13:52:20 2021 -0500
itemize: Try harder to avoid NULL fonts
Always fall back to the base font if the fontset
has no coverage.
pango/itemize.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pango/itemize.c b/pango/itemize.c
index 9aa0c29c..442fe8e9 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -772,7 +772,8 @@ get_font (ItemizeState *state,
GetFontInfo info;
/* We'd need a separate cache when fallback is disabled, but since lookup
- * with fallback disabled is faster anyways, we just skip caching */
+ * with fallback disabled is faster anyways, we just skip caching
+ */
if (state->enable_fallback && font_cache_get (state->cache, wc, font, position))
return TRUE;
@@ -783,8 +784,9 @@ get_font (ItemizeState *state,
if (state->enable_fallback)
pango_fontset_foreach (state->current_fonts, get_font_foreach, &info);
- else
- get_font_foreach (NULL, get_base_font (state), &info);
+
+ if (!info.font)
+ info.font = get_base_font (state);
*font = info.font;
*position = info.position;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]