[From nobody Sat May 2 12:48:57 2009 Date: Sat, 2 May 2009 12:39:52 +0200 From: Tomas Janousek <tomi@nomi.cz> To: dvipdfmx@ktug.or.kr Subject: [PATCH] Fix computation of numOfExSideBearings in tt_read_{h,v}hea_table Message-ID: <20090502103952.GA28462@notes.lisk.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.18 (2008-05-17) --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, I'm attaching a patch fixing the problem desribed at [1]. Yes, I use xdvipdfmx, but the code in dvipdfmx is wrong as well and you should probably fix it. [1] http://thread.gmane.org/gmane.comp.tex.xetex/10782 The following line, as I understand it, computes the number of extra side bearings as a number of extra shorts after the initial numOfLongHorMetrics pairs in the hmtx table. Then, well, the len variable should hold the size of the hmtx table, not hhea. table->numOfExSideBearings = (USHORT)((len - table->numOfLongHorMetrics * 4) / 2); Regards, -- Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/ --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="xdvipdfmx-numOfExSideBearings.patch" Index: src/tt_table.c =================================================================== --- src/tt_table.c (revision 920) +++ src/tt_table.c (working copy) @@ -189,7 +189,7 @@ ULONG len; struct tt_hhea_table *table = NULL; - len = sfnt_find_table_len(sfont, "hhea"); + len = sfnt_find_table_len(sfont, "hmtx"); sfnt_locate_table(sfont, "hhea"); table = NEW(1, struct tt_hhea_table); @@ -252,7 +252,7 @@ table = NEW(1, struct tt_vhea_table); - len = sfnt_find_table_len(sfont, "vhea"); + len = sfnt_find_table_len(sfont, "vmtx"); sfnt_locate_table(sfont, "vhea"); table->version = sfnt_get_ulong(sfont); table->vertTypoAscender = sfnt_get_short (sfont); --yrj/dFKFPuw6o+aM-- ]