summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/dvi.c
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2015-02-21 15:05:44 +0000
committerKhaled Hosny <khaledhosny@eglug.org>2015-02-21 15:05:44 +0000
commite1848ff4fc059d06cfaa165a91621d017515b524 (patch)
treeaf729a137eb20509cb1ee32794ce470f0aeba1a6 /Build/source/texk/dvipdfm-x/dvi.c
parent43ccbde90e57c6af87ebda0b8f02bd32fdc5b5aa (diff)
Correctly load vertical glyph metrics
git-svn-id: svn://tug.org/texlive/trunk@36338 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dvi.c')
-rw-r--r--Build/source/texk/dvipdfm-x/dvi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c
index e5f260d1e20..beb8e70478f 100644
--- a/Build/source/texk/dvipdfm-x/dvi.c
+++ b/Build/source/texk/dvipdfm-x/dvi.c
@@ -972,12 +972,19 @@ dvi_locate_native_font (const char *filename, uint32_t index,
head = tt_read_head_table(sfont);
maxp = tt_read_maxp_table(sfont);
hhea = tt_read_hhea_table(sfont);
- sfnt_locate_table(sfont, layout_dir == 0 ? "hmtx" : "vmtx");
loaded_fonts[cur_id].ascent = hhea->ascent;
loaded_fonts[cur_id].descent = hhea->descent;
loaded_fonts[cur_id].unitsPerEm = head->unitsPerEm;
loaded_fonts[cur_id].numGlyphs = maxp->numGlyphs;
- loaded_fonts[cur_id].hvmt = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numOfLongHorMetrics, hhea->numOfExSideBearings);
+ if (layout_dir == 1 && sfnt_find_table_pos(sfont, "vmtx") > 0) {
+ struct tt_vhea_table *vhea = tt_read_vhea_table(sfont);
+ sfnt_locate_table(sfont, "vmtx");
+ loaded_fonts[cur_id].hvmt = tt_read_longMetrics(sfont, maxp->numGlyphs, vhea->numOfLongVerMetrics, vhea->numOfExSideBearings);
+ RELEASE(vhea);
+ } else {
+ sfnt_locate_table(sfont, "hmtx");
+ loaded_fonts[cur_id].hvmt = tt_read_longMetrics(sfont, maxp->numGlyphs, hhea->numOfLongHorMetrics, hhea->numOfExSideBearings);
+ }
RELEASE(hhea);
RELEASE(maxp);
RELEASE(head);