source: trunk/dports/tex/texlive/patch-texk_xdvipdfmx_src_tt_cmap_c @ 30880

Last change on this file since 30880 was 30880, checked in by milosh@…, 13 years ago

A tentative texlive port.

File size: 1.4 KB
Line 
1$OpenBSD: patch-texk_xdvipdfmx_src_tt_cmap_c,v 1.1.1.1 2007/07/17 21:53:34 jasper Exp $
2--- texk/xdvipdfmx/src/tt_cmap.c.orig   Fri Sep 29 16:15:10 2006
3+++ texk/xdvipdfmx/src/tt_cmap.c        Tue Jun 26 14:53:54 2007
4@@ -303,6 +303,9 @@ lookup_cmap4 (struct cmap4 *map, USHORT cc)
5     if (cc >= map->startCount[i]) {
6       if (map->idRangeOffset[i] == 0) {
7        gid = (cc + map->idDelta[i]) & 0xffff;
8+      } else if (cc == 0xffff && map->idRangeOffset[i] == 0xffff) {
9+       /* this is for protection against some old broken fonts... */
10+       gid = 0;
11       } else {
12        j  = map->idRangeOffset[i] - (segCount - i) * 2;
13        j  = (cc - map->startCount[i]) + (j / 2);
14@@ -630,6 +633,9 @@ load_cmap4 (struct cmap4 *map,
15       ch = c0 + j;
16       if (map->idRangeOffset[i] == 0) {
17        gid = (ch + map->idDelta[i]) & 0xffff;
18+      } else if (c0 == 0xffff && c1 == 0xffff && map->idRangeOffset[i] == 0xffff) {
19+       /* this is for protection against some old broken fonts... */
20+       gid = 0;
21       } else {
22        gid = (map->glyphIndexArray[j+d] +
23               map->idDelta[i]) & 0xffff;
24@@ -952,6 +958,9 @@ create_ToUnicode_cmap4 (struct cmap4 *map,
25       ch = c0 + j;
26       if (map->idRangeOffset[i] == 0) {
27        gid = (ch + map->idDelta[i]) & 0xffff;
28+      } else if (c0 == 0xffff && c1 == 0xffff && map->idRangeOffset[i] == 0xffff) {
29+       /* this is for protection against some old broken fonts... */
30+       gid = 0;
31       } else {
32        gid = (map->glyphIndexArray[j+d] +
33               map->idDelta[i]) & 0xffff;
Note: See TracBrowser for help on using the repository browser.