summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2021-05-27 11:38:56 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-05-27 11:38:56 -0400
commit28eee3636caa8b933aaaccf47102bd2e698f29f6 (patch)
tree4caaa3e6223dfa826eaf71bc98a067bce7c03d3b
parent0d1c306e51aeda3e51bc54fcaa1e41f34c387a4b (diff)
downloadfreetype2-28eee3636caa8b933aaaccf47102bd2e698f29f6.tar.gz
[type42] Fix auto-hinting.
The autohinter could not access the base (unscaled) outline in the child TrueType glyph slot. We now share the internal parts between the parent and child glyph slots. Fixes #1057. * src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts of `T42_GlyphSlot' and replace it with the child TrueType structure. (T42_GlyphSlot_Done): Updated accordingly.
-rw-r--r--ChangeLog12
-rw-r--r--src/type42/t42objs.c7
2 files changed, 19 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 01c4d701c..cecb207d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-05-27 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [type42] Fix auto-hinting.
+
+ The autohinter could not access the base (unscaled) outline in the
+ child TrueType glyph slot. We now share the internal parts between
+ the parent and child glyph slots. Fixes #1057.
+
+ * src/type42/t42objs.c (T42_GlyphSlot_Init): Remove the internal parts
+ of `T42_GlyphSlot' and replace it with the child TrueType structure.
+ (T42_GlyphSlot_Done): Updated accordingly.
+
2021-05-25 Werner Lemberg <wl@gnu.org>
[psaux] Guard and trace AFM kern data allocation.
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 59b6540fe..dd23e73fa 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -583,6 +583,7 @@
FT_Face face = t42slot->face;
T42_Face t42face = (T42_Face)face;
FT_GlyphSlot ttslot;
+ FT_Memory memory = face->memory;
FT_Error error = FT_Err_Ok;
@@ -598,6 +599,11 @@
slot->ttslot = ttslot;
}
+ /* share the loader so that the autohinter can see it */
+ FT_GlyphLoader_Done( t42slot->internal->loader );
+ FT_FREE( t42slot->internal );
+ t42slot->internal = slot->ttslot->internal;
+
return error;
}
@@ -609,6 +615,7 @@
FT_Done_GlyphSlot( slot->ttslot );
+ t42slot->internal = NULL;
}