freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] hdmx-advances 34fc55d 1/5: [truetype] Relocate subpixel flag


From: Werner Lemberg
Subject: [freetype2] hdmx-advances 34fc55d 1/5: [truetype] Relocate subpixel flag setting.
Date: Fri, 10 Dec 2021 22:36:03 -0500 (EST)

branch: hdmx-advances
commit 34fc55de47a5abe310f3c5a3f7d8cf9c5443e07f
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [truetype] Relocate subpixel flag setting.
    
    Eventually, we will use these flags to assess the `hdmx` usability
    prior to the glyph parsing.
    
    * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting to...
    * src/truetype/ttgload.c (tt_loader_init): ...here where it belongs
    and which is executed before each glyph is loaded.
---
 src/truetype/ttgload.c  | 29 ++++++++++++++++++++++++++++-
 src/truetype/ttinterp.c | 29 -----------------------------
 2 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ae2c0cb..9e438e8 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2720,7 +2720,34 @@
       if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
            exec->GS.instruct_control & 4                            )
         exec->ignore_x_mode = 0;
-#endif
+
+      exec->iup_called = FALSE;
+#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+      /*
+       * Toggle backward compatibility according to what font wants, except
+       * when
+       *
+       * 1) we have a `tricky' font that heavily relies on the interpreter to
+       *    render glyphs correctly, for example DFKai-SB, or
+       * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested.
+       *
+       * In those cases, backward compatibility needs to be turned off to get
+       * correct rendering.  The rendering is then completely up to the
+       * font's programming.
+       *
+       */
+      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
+           subpixel_hinting_lean                                    &&
+           !FT_IS_TRICKY( glyph->face )                             )
+        exec->backward_compatibility = !( exec->GS.instruct_control & 4 );
+      else
+        exec->backward_compatibility = FALSE;
+
+      exec->iupx_called = FALSE;
+      exec->iupy_called = FALSE;
+#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
 
       exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
       loader->exec = exec;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 731095e..ee8e152 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -7755,35 +7755,6 @@
 #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
 
 
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-    exc->iup_called = FALSE;
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
-
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
-    /*
-     * Toggle backward compatibility according to what font wants, except
-     * when
-     *
-     * 1) we have a `tricky' font that heavily relies on the interpreter to
-     *    render glyphs correctly, for example DFKai-SB, or
-     * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested.
-     *
-     * In those cases, backward compatibility needs to be turned off to get
-     * correct rendering.  The rendering is then completely up to the
-     * font's programming.
-     *
-     */
-    if ( SUBPIXEL_HINTING_MINIMAL          &&
-         exc->subpixel_hinting_lean        &&
-         !FT_IS_TRICKY( &exc->face->root ) )
-      exc->backward_compatibility = !( exc->GS.instruct_control & 4 );
-    else
-      exc->backward_compatibility = FALSE;
-
-    exc->iupx_called = FALSE;
-    exc->iupy_called = FALSE;
-#endif
-
     /* We restrict the number of twilight points to a reasonable,     */
     /* heuristic value to avoid slow execution of malformed bytecode. */
     num_twilight_points = FT_MAX( 30,



reply via email to

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