From owner-FreeBSD-users-jp@jp.FreeBSD.org Mon Jul 15 11:00:04 2013
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id r6F204D75518;
	Mon, 15 Jul 2013 11:00:04 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com [2607:f8b0:400e:c02::22f])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with ESMTP/inet6 id r6F203975513
	for <FreeBSD-users-jp@jp.freebsd.org>; Mon, 15 Jul 2013 11:00:03 +0900 (JST)
	(envelope-from ttmtko@gmail.com)
Received: by mail-pd0-f175.google.com with SMTP id 4so10279864pdd.34
        for <FreeBSD-users-jp@jp.freebsd.org>; Sun, 14 Jul 2013 18:59:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=to:subject:from:mime-version:content-type:content-transfer-encoding
         :message-id:date:x-dispatcher:lines:x-antivirus:x-antivirus-status;
        bh=NzW9t5b1cW+FEKXYAMAaNAzPUfc2zcOlJNJudkiaGy4=;
        b=yt9aXWjjDV4Bqd9NrxH/Rk82KDhDcGveO56KQL7eGDlxxBnNgipJPgiEvm48MMxN6s
         lrRWmPl+yaceDKmnLBgRkw7Xu/wYDmu45oe+gVI1zWaDWfIEQ2dBnPM2gdS9CSk1Mb6i
         kBW6w4nlqCeL0C0kLSISqXqXP/FKZhmpHxC+qEUkBUpEYrjWYr4EsonY9IKaY17yJXmp
         x39zcIqs4cu6glPTTZNONNuu16i/Axa0i2AiNxVClITphsGyGbUJChMT3MkV6g6DUgGW
         9TE10pGvqog+VFtWS4t/YpobEHzMdoMtGuJRn+c9/HlgFCdQAS/eozNl+sHqmXeNu9W9
         27Vg==
X-Received: by 10.68.224.66 with SMTP id ra2mr19512187pbc.41.1373853597221;
        Sun, 14 Jul 2013 18:59:57 -0700 (PDT)
Received: from tt.decode.waseda.ac.jp (z160147.dynamic.ppp.asahi-net.or.jp. [110.4.160.147])
        by mx.google.com with ESMTPSA id ib9sm57857646pbc.43.2013.07.14.18.59.55
        for <FreeBSD-users-jp@jp.freebsd.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 14 Jul 2013 18:59:56 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
	by tt.decode.waseda.ac.jp (Postfix) with ESMTP id 85A0E3C04F
	for <FreeBSD-users-jp@jp.FreeBSD.org>; Mon, 15 Jul 2013 10:59:51 +0900 (JST)
To: FreeBSD-users-jp@jp.FreeBSD.org
From: =?iso-2022-jp?B?GyRCQyQ4Sj5mSVcbKEI=?= <ttmtko@gmail.com>
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <20130715105951G.tatsumi@qed.decode.waseda.ac.jp>
X-Dispatcher: imput version 20110525(IM151)
Lines: 49
X-Antivirus: avast! (VPS 130714-1, 2013/07/15), Outbound message
X-Antivirus-Status: Clean
Reply-To: FreeBSD-users-jp@jp.FreeBSD.org
Precedence: list
Date: Mon, 15 Jul 2013 10:59:51 +0900
X-Sequence: FreeBSD-users-jp 94222
Subject: [FreeBSD-users-jp 94222] DVIPDFMX =?ISO-2022-JP?B?GyRCJEcbKEI=?=
 =?ISO-2022-JP?B?GyRCJE4bKEI=?= OTF
 =?ISO-2022-JP?B?GyRCJVUlKSVzJUgkTktkJGE5fiRfJEtJVSQkJEYbKEI=?=
Sender: owner-FreeBSD-users-jp@jp.FreeBSD.org
X-Originator: ttmtko@gmail.com
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+060209

$BC$8J$H$$$&$N$G$9!#(B

9.1-R$B$r;H$C$F$$$^$9!#(B ports $B$+$i%$%s%9%H!<%k$7$?(B dvipdfmx-20110311 $B$G!"(B
IPAex$B%U%)%s%H$N(B otf $B$NKd$a9~$_$,$G$-$J$+$C$?$N$G!"$$$m$$$mD4$Y$F$_$?$H(B
$B$3$m!"(B

  http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?dvipdfmx#z5173081

$B$N@h$K$"$k5-;vFbMF$r$*CN$i$;$7$FD:$-$^$7$?!#$3$NBP1~$G$&$^$/F0$/$h$&$K(B
$B$J$j$^$7$?!#(B

$B$=$l$G!"%Q%C%A$r:n$C$?$s$G$9$,!"$3$l$C$F!"$I$&$d$C$F%a%$%s%F%J!<$5$s$K(B
$B$*CN$i$;$9$l$P$$$$$s$G$7$?$C$1!)(B

--$B$3$3$+$i(B--
--- ./work/dvipdfmx-20110311/src/tt_post.c.orig 2011-03-06 12:14:15.000000000 +0900
+++ ./work/dvipdfmx-20110311/src/tt_post.c      2013-07-14 12:55:46.000000000 +0900
@@ -42,2 +42,3 @@
   int    len;
+  int maxidx = 257;
 
@@ -51,7 +52,20 @@
     if (idx >= 258) {
+      if (idx > maxidx)
+       maxidx = idx;
       if (idx > 32767) {
-       WARN("TrueTypes post table name index %u > 32767", idx);
+       /* Although this is strictly speaking out of spec, it seems to work
+          and there are real-life fonts that use it.
+          We show a warning only once, instead of thousands of times */
+       static char warning_issued = 0;
+       if (!warning_issued) {
+         WARN("TrueTypes post table name index %u > 32767", idx);
+         warning_issued = 1;
+         }
+       /* In a real-life large font, (x)dvipdfmx crashes if we use
+          nonvanishing idx in the case of idx > 32767.
+          If we set idx = 0, (x)dvipdfmx works fine for the font and
+          created pdf seems fine. The post table may not be important
+          in such a case */
        idx = 0;
       }
-      post->count++;
     }
@@ -59,2 +73,3 @@
   }
+  post->count = maxidx - 257;
 
--$B$3$3$^$G(B--
