summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-11-02 13:11:06 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-11-02 13:11:06 +0000
commit0e062025f7e9c23d64f503985b1326171f6392cb (patch)
tree3fabb31e6097b127d0835e5b27e813ee1cc79be8 /Build
parent723a2828c03409a8800d084db1ad14a98f0b9693 (diff)
ttf2pk2: Use data from Postscript table
git-svn-id: svn://tug.org/texlive/trunk@24455 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/ttf2pk2/ChangeLog3
-rw-r--r--Build/source/texk/ttf2pk2/ttfaux.c20
2 files changed, 14 insertions, 9 deletions
diff --git a/Build/source/texk/ttf2pk2/ChangeLog b/Build/source/texk/ttf2pk2/ChangeLog
index 5ad94e6e1d2..6aa529ff144 100644
--- a/Build/source/texk/ttf2pk2/ChangeLog
+++ b/Build/source/texk/ttf2pk2/ChangeLog
@@ -3,6 +3,9 @@
* ttf2pk.c (main): Bug fix: mapfiles is malloc()ed, so do not
realloc() mapfiles+offset.
+ * ttfaux.c (readttf): Do not overwrite fnt->xheight.
+ Use `fixedpitch' and `italicangle' from Postscript table.
+
2011-10-27 Peter Breitenlohner <peb@mppmu.mpg.de>
* data/HKSCS.sfd: New file copied from Master (r3283).
diff --git a/Build/source/texk/ttf2pk2/ttfaux.c b/Build/source/texk/ttf2pk2/ttfaux.c
index 802fc15dc5d..60d9c45030e 100644
--- a/Build/source/texk/ttf2pk2/ttfaux.c
+++ b/Build/source/texk/ttf2pk2/ttfaux.c
@@ -16,6 +16,7 @@
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_TYPE1_TABLES_H
+#include FT_TRUETYPE_TABLES_H
#include FT_BBOX_H
#include "ttf2tfm.h"
@@ -63,9 +64,8 @@ FT_Face_Properties properties;
#endif
FT_BBox bbox;
+TT_Postscript *postscript;
#if 0
-FT_Post post;
-
TTO_GSUBHeader gsub_;
TTO_GSUBHeader *gsub;
#endif
@@ -228,6 +228,13 @@ readttf(Font *fnt, Boolean quiet, Boolean only_range)
#endif
/*
+ * Get the Postscript table.
+ */
+
+ if ((postscript = FT_Get_Sfnt_Table(face, ft_sfnt_post)) == NULL)
+ oops("Cannot find Postscript table for `%s'.", real_ttfname);
+
+ /*
* We use a dummy glyph size of 10pt.
*/
@@ -268,13 +275,8 @@ readttf(Font *fnt, Boolean quiet, Boolean only_range)
#endif
fnt->units_per_em = face->units_per_EM;
-
- //fnt->fixedpitch = properties.postscript->isFixedPitch;
- fnt->fixedpitch = FT_IS_FIXED_WIDTH(face);
- //fnt->italicangle = properties.postscript->italicAngle / 65536.0;
- fnt->italicangle = 0.0;
- //fnt->xheight = properties.os2->sxHeight * 1000 / fnt->units_per_em;
- fnt->xheight = face->height * 1000 / fnt->units_per_em;
+ fnt->fixedpitch = postscript->isFixedPitch;
+ fnt->italicangle = postscript->italicAngle / 65536.0;
if (fnt->PSnames != Only)
{