[pango/pango2: 150/178] hbfont: Silently accept lack of size




commit 3e19276c57eac8b4809c9f08afbeb26133625d1d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 19 07:49:05 2022 -0700

    hbfont: Silently accept lack of size
    
    The font chooser seems to rely on this behavior.

 pango/pango-hbfont.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/pango/pango-hbfont.c b/pango/pango-hbfont.c
index 8f7208931..751a2c386 100644
--- a/pango/pango-hbfont.c
+++ b/pango/pango-hbfont.c
@@ -1019,10 +1019,11 @@ pango_hb_font_new_for_description (PangoHbFace                *face,
 
   g_return_val_if_fail (PANGO_IS_HB_FACE (face), NULL);
   g_return_val_if_fail (description != NULL, NULL);
-  g_return_val_if_fail ((pango_font_description_get_set_fields (description) & PANGO_FONT_MASK_SIZE) != 0, 
NULL);
   g_return_val_if_fail (dpi > 0, NULL);
 
-  if (pango_font_description_get_size_is_absolute (description))
+  if ((pango_font_description_get_set_fields (description) & PANGO_FONT_MASK_SIZE) == 0)
+    size = 10 * PANGO_SCALE;
+  else if (pango_font_description_get_size_is_absolute (description))
     size = pango_font_description_get_size (description) * 72. / dpi;
   else
     size = pango_font_description_get_size (description);


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