aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2023-08-23 12:09:08 +0800
committerPo Lu2023-08-23 12:09:27 +0800
commit81fc5d83fe71ef218f59d65040474bf4b5d2228e (patch)
treec0cbbfd4c693af25b253d2ebefbb71a3996657c2 /src
parent45555c1b789c547cdb5e5daf657a90b5ba431792 (diff)
downloademacs-81fc5d83fe71ef218f59d65040474bf4b5d2228e.tar.gz
emacs-81fc5d83fe71ef218f59d65040474bf4b5d2228e.zip
Repair displaying compound glyph components with anchor points
* src/sfnt.c (sfnt_interpret_compound_glyph_1): Move initialization of x and y out of conditional.
Diffstat (limited to 'src')
-rw-r--r--src/sfnt.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/sfnt.c b/src/sfnt.c
index bf55e9302b0..c987ec42441 100644
--- a/src/sfnt.c
+++ b/src/sfnt.c
@@ -11891,7 +11891,7 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
11891 /* The offset is determined by matching a point location in 11891 /* The offset is determined by matching a point location in
11892 a preceeding component with a point location in the 11892 a preceeding component with a point location in the
11893 current component. The index of the point in the 11893 current component. The index of the point in the
11894 previous component can be determined by adding 11894 previous component is established by adding
11895 component->argument1.a or component->argument1.c to 11895 component->argument1.a or component->argument1.c to
11896 point. argument2 contains the index of the point in the 11896 point. argument2 contains the index of the point in the
11897 current component. */ 11897 current component. */
@@ -11920,30 +11920,29 @@ sfnt_interpret_compound_glyph_1 (struct sfnt_glyph *glyph,
11920 11920
11921 if (!subglyph->compound) 11921 if (!subglyph->compound)
11922 { 11922 {
11923 /* Detect invalid child anchor points within simple
11924 glyphs in advance. */
11925
11923 if (point2 >= subglyph->simple->number_of_points + 2) 11926 if (point2 >= subglyph->simple->number_of_points + 2)
11924 { 11927 {
11925 /* If POINT2 is placed within a phantom point, use
11926 that. */
11927
11928 if (need_free) 11928 if (need_free)
11929 free_glyph (subglyph, dcontext); 11929 free_glyph (subglyph, dcontext);
11930 11930
11931 return "Invalid component anchor point"; 11931 return "Invalid component anchor point";
11932 } 11932 }
11933 }
11933 11934
11934 /* First, set offsets to 0, because it is not yet 11935 /* First, set offsets to 0, because it is not yet possible
11935 possible to ascertain the position of the anchor 11936 to ascertain the position of the anchor point in the
11936 point in the child. That position cannot be 11937 child. That position cannot be established prior to the
11937 established prior to the completion of 11938 completion of grid-fitting. */
11938 grid-fitting. */ 11939 x = 0;
11939 x = 0; 11940 y = 0;
11940 y = 0;
11941 11941
11942 /* Set a flag which indicates that offsets must be 11942 /* Set a flag which indicates that offsets must be resolved
11943 resolved from the child glyph after it is loaded, but 11943 from the child glyph after it is loaded, but before it is
11944 before it is incorporated into the parent glyph. */ 11944 incorporated into the parent glyph. */
11945 defer_offsets = true; 11945 defer_offsets = true;
11946 }
11947 } 11946 }
11948 11947
11949 /* Obtain the glyph metrics. If doing so fails, then cancel 11948 /* Obtain the glyph metrics. If doing so fails, then cancel