[gnome-font-viewer] font-widget: try to reuse all characters for sample string



commit d9c475400a527c15c24973b7bd90efa4e44aea0b
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jul 5 11:33:38 2019 -0700

    font-widget: try to reuse all characters for sample string
    
    If we have fewer characters in the font than the length of the desired
    sample string, just use all of them instead of repeating a few of
    them at random.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769247

 src/sushi-font-widget.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/sushi-font-widget.c b/src/sushi-font-widget.c
index 8b8e062..f85b9e0 100644
--- a/src/sushi-font-widget.c
+++ b/src/sushi-font-widget.c
@@ -295,6 +295,9 @@ random_string_from_available_chars (FT_Face face,
   if (total_chars == 0)
     return NULL;
 
+  if (total_chars <= n_chars)
+    return chars;
+
   retval = g_string_new (NULL);
 
   while (idx < n_chars) {


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