freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master f55a455: [ftgrid] Update FT_DEBUG_AUTOFIT mode.


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master f55a455: [ftgrid] Update FT_DEBUG_AUTOFIT mode.
Date: Thu, 10 May 2018 22:30:49 -0400 (EDT)

branch: master
commit f55a455e000cbfd5e290b9f0351305a732771d74
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    [ftgrid] Update FT_DEBUG_AUTOFIT mode.
    
    * src/ftgrid.c (grid_status_draw_outline) [FT_DEBUG_AUTOFIT]:
    Show active segments only when autohinter is forced. Minor tweaks.
---
 ChangeLog    |  7 +++++++
 src/ftgrid.c | 39 ++++++++++++++-------------------------
 2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dab4800..4463fd0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-05-10  Alexei Podtelezhnikov  <address@hidden>
+
+       [ftgrid] Update FT_DEBUG_AUTOFIT mode.
+
+       * src/ftgrid.c (grid_status_draw_outline) [FT_DEBUG_AUTOFIT]:
+       Show active segments only when autohinter is forced. Minor tweaks.
+
 2018-05-09  Alexei Podtelezhnikov  <address@hidden>
 
        [ftgrid] Accept bitmap fonts.
diff --git a/src/ftgrid.c b/src/ftgrid.c
index 288f400..c450319 100644
--- a/src/ftgrid.c
+++ b/src/ftgrid.c
@@ -683,32 +683,16 @@
     if ( err )
       return;
 
-#ifdef FT_DEBUG_AUTOFIT
-    /* Draw segment before drawing glyph. */
-    if ( status.do_segment )
-    {
-      /* Force hinting first in order to collect segment info. */
-      _af_debug_disable_horz_hints = 0;
-      _af_debug_disable_vert_hints = 0;
-
-      if ( !FT_Load_Glyph( size->face, (FT_UInt)st->Num,
-                           FT_LOAD_DEFAULT        |
-                           FT_LOAD_NO_BITMAP      |
-                           FT_LOAD_FORCE_AUTOHINT |
-                           FT_LOAD_TARGET_NORMAL ) )
-        grid_hint_draw_segment( &status, size, _af_debug_hints );
-    }
-
-    _af_debug_disable_horz_hints = !st->do_horz_hints;
-    _af_debug_disable_vert_hints = !st->do_vert_hints;
-    _af_debug_disable_blue_hints = !st->do_blue_hints;
-#endif
-
     if ( handle->encoding == FT_ENCODING_ORDER )
       glyph_idx = (FT_UInt)st->Num;
     else
       glyph_idx = FTDemo_Get_Index( handle, (FT_UInt32)st->Num );
 
+#ifdef FT_DEBUG_AUTOFIT
+    _af_debug_disable_horz_hints = !st->do_horz_hints;
+    _af_debug_disable_vert_hints = !st->do_vert_hints;
+    _af_debug_disable_blue_hints = !st->do_blue_hints;
+#endif
 
     if ( FT_Load_Glyph( size->face, glyph_idx,
                         handle->load_flags | FT_LOAD_NO_BITMAP ) )
@@ -721,10 +705,9 @@
       /* show advance width */
       grFillVLine( st->disp_bitmap,
                    st->x_origin +
-                     ( ( size->face->glyph->metrics.horiAdvance +
-                         size->face->glyph->lsb_delta           -
-                         size->face->glyph->rsb_delta           ) *
-                       scale >> 6 ),
+                     ( ( slot->metrics.horiAdvance +
+                         slot->lsb_delta           -
+                         slot->rsb_delta           ) * scale >> 6 ),
                    0,
                    st->disp_height,
                    st->axis_color );
@@ -778,6 +761,12 @@
       int          nn;
 
 
+#ifdef FT_DEBUG_AUTOFIT
+      /* Draw segment before drawing glyph. */
+      if ( status.do_segment && handle->load_flags & FT_LOAD_FORCE_AUTOHINT )
+        grid_hint_draw_segment( &status, size, _af_debug_hints );
+#endif
+
       /* scale the outline */
       for ( nn = 0; nn < gimage->n_points; nn++ )
       {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]