[pango/pango2: 155/168] hbfont: Silently accept lack of size




commit 871b4889664a7a287e92437b4be1a02c8dd717bd
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 8f720893..751a2c38 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]