]> git.eshelyaron.com Git - emacs.git/commitdiff
Repair displaying compound glyph components with anchor points
authorPo Lu <luangruo@yahoo.com>
Wed, 23 Aug 2023 04:09:08 +0000 (12:09 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 23 Aug 2023 04:09:27 +0000 (12:09 +0800)
* src/sfnt.c (sfnt_interpret_compound_glyph_1): Move
initialization of x and y out of conditional.

src/sfnt.c

index bf55e9302b0469b22bb8d74ad7de1725174fdcba..c987ec424413e0ce9317bcd6f2d25b6fc282a017 100644 (file)
@@ -11891,7 +11891,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
          /* The offset is determined by matching a point location in
             a preceeding component with a point location in the
             current component.  The index of the point in the
-            previous component can be determined by adding
+            previous component is established by adding
             component->argument1.a or component->argument1.c to
             point.  argument2 contains the index of the point in the
             current component.  */
@@ -11920,30 +11920,29 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
 
          if (!subglyph->compound)
            {
+             /* Detect invalid child anchor points within simple
+                glyphs in advance.  */
+
              if (point2 >= subglyph->simple->number_of_points + 2)
                {
-                 /* If POINT2 is placed within a phantom point, use
-                    that.  */
-
                  if (need_free)
                    free_glyph (subglyph, dcontext);
 
                  return "Invalid component anchor point";
                }
+           }
 
-             /* First, set offsets to 0, because it is not yet
-                possible to ascertain the position of the anchor
-                point in the child.  That position cannot be
-                established prior to the completion of
-                grid-fitting.  */
-             x = 0;
-             y = 0;
+         /* First, set offsets to 0, because it is not yet possible
+            to ascertain the position of the anchor point in the
+            child.  That position cannot be established prior to the
+            completion of grid-fitting.  */
+         x = 0;
+         y = 0;
 
-             /* Set a flag which indicates that offsets must be
-                resolved from the child glyph after it is loaded, but
-                before it is incorporated into the parent glyph.  */
-             defer_offsets = true;
-           }
+         /* Set a flag which indicates that offsets must be resolved
+            from the child glyph after it is loaded, but before it is
+            incorporated into the parent glyph.  */
+         defer_offsets = true;
        }
 
       /* Obtain the glyph metrics.  If doing so fails, then cancel