Package: freetype1-tools
Version: 1.4pre.20030402-1.1
Severity: important
Tags: patch
Please update freetype1-tools to make it work with tetex-3.0
Two patches have to be applied to ttf2pk and the directory structure
of texmf have to be changed.
This patch contains two required patches. Applying this patch makes
patches directory and places two files there, and modifies debian/rules
file to fix the directory structure and apply the patches before build
the package.
If you don't have time to fix the package, I could NMU it.
Thanks.
diff -uNr freetype1-1.4pre.20030402/debian/control
freetype1-1.4pre.20030402/debian/control
--- freetype1-1.4pre.20030402/debian/control 2005-12-23 02:45:24.000000000
+0900
+++ freetype1-1.4pre.20030402/debian/control 2005-12-23 02:45:55.000000000
+0900
@@ -1,5 +1,5 @@
Source: freetype1
-Build-Depends: debhelper (>= 4.0.0), libtool (>= 1.3.4-1), gettext (>=
0.10.36-2), libkpathsea-dev, tetex-base, xlibs-dev
+Build-Depends: debhelper (>= 4.0.0), libtool (>= 1.3.4-1), gettext (>=
0.10.36-2), libkpathsea4-dev, tetex-base, xlibs-dev
Section: oldlibs
Priority: optional
Maintainer: Anthony Fok <[EMAIL PROTECTED]>
diff -uNr freetype1-1.4pre.20030402/debian/rules
freetype1-1.4pre.20030402/debian/rules
--- freetype1-1.4pre.20030402/debian/rules 2005-12-23 02:45:24.000000000
+0900
+++ freetype1-1.4pre.20030402/debian/rules 2005-12-23 02:45:55.000000000
+0900
@@ -18,8 +18,8 @@
dummypkg = freetype2
docdir = usr/share/doc
-TTF2PKINPUTS = usr/share/texmf/ttf2pk
-TTF2TFMINPUTS = usr/share/texmf/ttf2tfm
+SFDFONTS = usr/share/texmf/fonts/sfd
+TTF2PKINPUTS = usr/share/texmf/ttf2pk/base
VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
# Uncomment this to turn on verbose mode.
@@ -35,6 +35,9 @@
build-stamp:
dh_testdir
+ patch -b -p0 < patches/01_ttf2pk-1.5-omega.patch
+ patch -b -p0 < patches/02_ttf2pk-1.5-kpathsea.patch
+
./configure --prefix=/usr \
--with-locale-dir='$${prefix}/share/locale' --enable-static
$(MAKE)
@@ -61,9 +64,8 @@
dh_testroot
rm -f build-stamp
-$(MAKE) distclean
- -for i in ttf2bdf ttf2pfb ttf2pk ttfbanner; do \
- $(MAKE) -C contrib/$$i distclean; \
- done
+ -for i in ttf2bdf ttf2pfb ttf2pk ttfbanner; do $(MAKE) -C contrib/$$i
distclean; done
+ -for i in `ls contrib/ttf2pk/*.orig`; do mv $$i $${i%.orig}; done
dh_clean
install: DH_OPTIONS=
@@ -169,7 +171,7 @@
dh_testroot
dh_installdirs $(docdir)/$(libpkg)/ttf2pk \
- $(TTF2PKINPUTS) $(TTF2TFMINPUTS) etc/ttf2pk \
+ $(SFDFONTS) $(TTF2PKINPUTS) etc/texmf/ttf2pk \
$(docdir)/$(libpkg)/ttf2bdf \
$(docdir)/$(libpkg)/ttf2pfb \
$(docdir)/$(libpkg)/ttfbanner
@@ -185,13 +187,12 @@
mv t1asm t1asm-freetype && \
mv getafm getafm-freetype )
- # ttf2tfm and ttf2pk both need the *.sfd, *.enc and *.rpl
+ # ttf2pk needs the *.sfd, *.enc and *.rpl
# in their own directory. (?) Hmm...
- cp -av contrib/ttf2pk/data/*.{sfd,enc,rpl}
debian/$(binpkg)/$(TTF2PKINPUTS)
- ln debian/$(binpkg)/$(TTF2PKINPUTS)/*.{sfd,enc,rpl}
debian/$(binpkg)/$(TTF2TFMINPUTS)
-
- cp -av contrib/ttf2pk/data/ttfonts.map debian/$(binpkg)/etc/ttf2pk
- ln -s /etc/ttf2pk/ttfonts.map debian/$(binpkg)/$(TTF2PKINPUTS)
+ cp -av contrib/ttf2pk/data/*.sfd debian/$(binpkg)/$(SFDFONTS)
+ cp -av contrib/ttf2pk/data/*.{enc,rpl} debian/$(binpkg)/$(TTF2PKINPUTS)
+ cp -av contrib/ttf2pk/data/*.{cfg,map} debian/$(binpkg)/etc/texmf/ttf2pk
+ ln -s /etc/texmf/ttf2pk/*.{cfg,map} debian/$(binpkg)/$(TTF2PKINPUTS)
dh_installdocs
@@ -211,6 +212,8 @@
# ftzoom.1 ftstring.1 ftstrpnm.1 fterror.1 \
# ttf2pfb.1 ttfbanner.1
# dh_installchangelogs
+ dh_link etc/texmf/ttf2pk/ttf2pk.cfg
usr/share/texmf/ttf2pk/base/ttf2pk.cfg
+ dh_link etc/texmf/ttf2pk/ttfonts.map
usr/share/texmf/ttf2pk/base/ttfonts.map
dh_strip
dh_link
dh_compress
diff -uNr freetype1-1.4pre.20030402/patches/01_ttf2pk-1.5-omega.patch
freetype1-1.4pre.20030402/patches/01_ttf2pk-1.5-omega.patch
--- freetype1-1.4pre.20030402/patches/01_ttf2pk-1.5-omega.patch 1970-01-01
09:00:00.000000000 +0900
+++ freetype1-1.4pre.20030402/patches/01_ttf2pk-1.5-omega.patch 2005-12-23
02:45:55.000000000 +0900
@@ -0,0 +1,398 @@
+diff -uNr contrib/ttf2pk/newobj.c contrib/ttf2pk/newobj.c
+--- contrib/ttf2pk/newobj.c 2002-06-21 02:34:37.000000000 +0900
++++ contrib/ttf2pk/newobj.c 2005-12-22 16:48:25.000000000 +0900
+@@ -202,6 +202,8 @@
+ ti->dptr = 0;
+ ti->iptr = 0;
+
++ ti->fntnum = -1;
++
+ fnt->charlist = ti;
+
+ return ti;
+@@ -313,6 +315,10 @@
+ fnt->codingscheme = default_codingscheme;
+ fnt->titlebuf = NULL;
+
++ fnt->cksum = 0;
++ fnt->subfont_num = 0;
++ fnt->subfont_list = NULL;
++
+ fnt->units_per_em = 0;
+ fnt->italicangle = 0.0;
+ fnt->fixedpitch = 0;
+diff -uNr contrib/ttf2pk/subfont.c contrib/ttf2pk/subfont.c
+--- contrib/ttf2pk/subfont.c 2002-03-15 10:33:52.000000000 +0900
++++ contrib/ttf2pk/subfont.c 2005-12-22 16:48:25.000000000 +0900
+@@ -35,7 +35,7 @@
+ static realsubfont *
+ really_init_sfd(char *name, Boolean fatal);
+ static Boolean
+-really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf);
++really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf, Boolean new_sfd);
+ static void
+ really_close_sfd(realsubfont *real_name);
+
+@@ -163,14 +163,14 @@
+ Boolean get_sfd(Font *fnt, Boolean is_sfd)
+ {
+ if (is_sfd)
+- return really_get_sfd(fnt, False, real_sfd_name);
++ return really_get_sfd(fnt, False, real_sfd_name, True);
+ else
+- return really_get_sfd(fnt, False, real_lig_name);
++ return really_get_sfd(fnt, False, real_lig_name, False);
+ }
+
+
+ static Boolean
+-really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf)
++really_get_sfd(Font *fnt, Boolean next, realsubfont *rsf, Boolean new_sfd)
+ {
+ long i, offset;
+ long begin, end = -1;
+@@ -229,7 +229,7 @@
+ if (*bufp == '\0')
+ oops("Invalid subfont entry in `%s'.", rsf->name);
+
+- if (next)
++ if (next || !new_sfd)
+ {
+ if (strcmp(fnt->subfont_name, buffer))
+ goto again;
+@@ -309,7 +309,7 @@
+
+ if (!next)
+ while ((rsf = rsf->next))
+- (void)really_get_sfd(fnt, True, rsf);
++ (void)really_get_sfd(fnt, True, rsf, new_sfd);
+
+ return True;
+ }
+diff -uNr contrib/ttf2pk/tfmaux.c contrib/ttf2pk/tfmaux.c
+--- contrib/ttf2pk/tfmaux.c 2002-01-08 21:48:27.000000000 +0900
++++ contrib/ttf2pk/tfmaux.c 2005-12-22 16:48:26.000000000 +0900
+@@ -283,7 +283,6 @@
+ register int i, j;
+ register ttfinfo *ti;
+ int byte1, old_byte1, byte2;
+- long cksum;
+ double Slant;
+ char buffer[256];
+ struct sf sf_array[256];
+@@ -366,8 +365,8 @@
+ }
+
+ header = (long *)mymalloc(40000L);
+- cksum = checksum(fnt->inencptrs);
+- header[0] = cksum;
++ fnt->cksum = checksum(fnt->inencptrs);
++ header[0] = fnt->cksum;
+ header[1] = 0xA00000; /* 10pt design size */
+
+ (void)makebcpl(header + 2, fnt->codingscheme, 39);
+@@ -510,7 +509,8 @@
+ old_byte1 = byte1;
+ nl++;
+ }
+- ligkern[nl - 1] |= 0x80000000L;
++ if (nl > 0)
++ ligkern[nl - 1] |= 0x80000000L;
+ }
+
+ kerns = ligkern + nl;
+diff -uNr contrib/ttf2pk/ttf2tfm.c contrib/ttf2pk/ttf2tfm.c
+--- contrib/ttf2pk/ttf2tfm.c 2002-06-21 02:34:37.000000000 +0900
++++ contrib/ttf2pk/ttf2tfm.c 2005-12-22 16:48:26.000000000 +0900
+@@ -235,6 +235,37 @@
+ }
+
+
++#define MAX_SFLIST 10
++static void
++add_subfont_list(Font *fnt)
++{
++ if (fnt->subfont_list == NULL)
++ fnt->subfont_list = (sflist *)mymalloc(MAX_SFLIST * sizeof(sflist));
++ else if (fnt->subfont_num % MAX_SFLIST == 0)
++ fnt->subfont_list = (sflist *)myrealloc(fnt->subfont_list,
++ (fnt->subfont_num / MAX_SFLIST + 1) * MAX_SFLIST * sizeof(sflist));
++
++ (fnt->subfont_list[fnt->subfont_num]).name =
++ (char *)mymalloc(strlen(fnt->fullname)+1);
++ strcpy((fnt->subfont_list[fnt->subfont_num]).name, fnt->fullname);
++ (fnt->subfont_list[fnt->subfont_num]).cksum = fnt->cksum;
++
++ fnt->subfont_num++;
++}
++
++
++static void
++release_subfont_list(Font *fnt)
++{
++ register int i;
++
++ for (i = 0; i < fnt->subfont_num; i++)
++ free((fnt->subfont_list[i]).name);
++
++ free(fnt->subfont_list);
++}
++
++
+ #define VERSION "\
+ Copyright (C) 1997-1999, 2000, 2002 Frederic Loyer and Werner Lemberg.\n\
+ There is NO warranty. You may redistribute this software\n\
+@@ -251,6 +282,7 @@
+ David Turner, Robert Wilhelm, and Werner Lemberg.\n\
+ "
+
++
+ static void
+ version(void)
+ {
+@@ -272,6 +304,7 @@
+ -L LIGFILE[.sfd] create 1st/2nd byte ligatures in subfonts using LIGFILE\n\
+ -n use PS names of TrueType font\n\
+ -N use only PS names and no cmap\n\
++-o FILE[.ovp] make an OVP file for conversion to OVF and OFM\n\
+ -O use octal for all character codes in the vpl file\n\
+ -p ENCFILE[.enc] read ENCFILE for the TTF->raw TeX mapping\n\
+ -P INT select INT as the TTF platform ID [3]\n\
+@@ -528,6 +561,15 @@
+ arginc = 1;
+ break;
+
++ case 'o':
++ if (argc <= 3)
++ oops("Missing parameter for -o option.");
++ if (vpl_name)
++ free(vpl_name);
++ vpl_name = newstring(argv[3]);
++ handle_extension(&vpl_name, ".ovp");
++ break;
++
+ default:
+ if (argc <= 3 || argv[3][0] == '-')
+ {
+@@ -664,6 +706,9 @@
+ warning("Ignoring `-v' and `-V' switches for subfonts.");
+ makevpl = 0;
+ }
++ if (vpl_name)
++ if ((fnt->vplout = fopen(vpl_name, "wt")) == NULL)
++ oops("Cannot open ovp output file.");
+ if (have_capheight)
+ warning("Ignoring `-c' switch for subfonts.");
+ if (fnt->inencname || fnt->outencname)
+@@ -890,10 +935,19 @@
+ writetfm(&font);
+ if (font.write_enc)
+ writeenc(&font);
++ if (font.vplout)
++ add_subfont_list(&font);
+ }
+ }
+
+ close_sfd();
++
++ if (font.vplout)
++ {
++ writeovp(&font);
++ fclose(font.vplout);
++ release_subfont_list(&font);
++ }
+ }
+ else
+ {
+diff -uNr contrib/ttf2pk/ttf2tfm.h contrib/ttf2pk/ttf2tfm.h
+--- contrib/ttf2pk/ttf2tfm.h 2002-01-08 21:48:27.000000000 +0900
++++ contrib/ttf2pk/ttf2tfm.h 2005-12-22 16:48:26.000000000 +0900
+@@ -54,7 +54,8 @@
+ typedef struct _pcc pcc;
+ struct _stringlist;
+ typedef struct _stringlist stringlist;
+-
++struct _sflist;
++typedef struct _sflist sflist;
+
+
+ struct _ttfinfo
+@@ -77,6 +78,8 @@
+ pcc *pccs; /* we use the composite feature for */
+ /* `germandbls' <--> `SS' only */
+ unsigned char wptr, hptr, dptr, iptr;
++
++ short fntnum;
+ };
+
+
+@@ -120,6 +123,13 @@
+ };
+
+
++struct _sflist
++{
++ char *name;
++ long cksum;
++};
++
++
+ struct _Font
+ {
+ char *ttfname;
+@@ -187,6 +197,11 @@
+ char *codingscheme; /* coding scheme for TeX */
+ char *titlebuf;
+
++ long cksum;
++
++ short subfont_num;
++ sflist *subfont_list;
++
+ /*
+ * The name of the subfont definition file.
+ */
+diff -uNr contrib/ttf2pk/ttfaux.c contrib/ttf2pk/ttfaux.c
+--- contrib/ttf2pk/ttfaux.c 2003-11-05 21:19:02.000000000 +0900
++++ contrib/ttf2pk/ttfaux.c 2005-12-22 16:48:26.000000000 +0900
+@@ -562,6 +562,8 @@
+ ti->urx = bbox.xMax * 1000 / fnt->units_per_em;
+ ti->ury = bbox.yMax * 1000 / fnt->units_per_em;
+
++ ti->fntnum = fnt->subfont_num;
++
+ /*
+ * We must now shift the rotated character both horizontally
+ * and vertically. The vertical amount is 25% by default.
+diff -uNr contrib/ttf2pk/vplaux.c contrib/ttf2pk/vplaux.c
+--- contrib/ttf2pk/vplaux.c 2002-11-15 18:41:24.000000000 +0900
++++ contrib/ttf2pk/vplaux.c 2005-12-22 16:48:26.000000000 +0900
+@@ -568,4 +568,117 @@
+ }
+
+
++void
++writeovp(Font *fnt)
++{
++ register int i;
++ register ttfinfo *ti;
++ long bc, ec;
++ char header[256];
++ float Slant;
++ ttfinfo *ofm_array[65536];
++
++
++ out = fnt->vplout;
++
++ header[0] = '\0';
++ strncat(header, "Created by `", 12);
++ strncat(header, fnt->titlebuf, 255 - 12 - 1);
++ strncat(header, "'", 1);
++
++ voutln2("(VTITLE %s)", header);
++ voutln("(COMMENT Please change VTITLE if you edit this file)");
++
++ voutln("(OFMLEVEL H 1)");
++ voutln("(FONTDIR TL)");
++ voutln2("(FAMILY %s)", fnt->outname);
++ voutln("(FACE F MRR)");
++ voutln("(CODINGSCHEME UNSPECIFIED)");
++ voutln("(DESIGNSIZE R 10.0)");
++ voutln("(DESIGNUNITS R 1000)");
++ voutln("(COMMENT DESIGNSIZE (1 em) IS IN POINTS)");
++ voutln("(COMMENT OTHER DIMENSIONS ARE MULTIPLES OF DESIGNSIZE/1000)");
++
++#if 0
++ /* Let vptovf compute the checksum. */
++ voutln2("(CHECKSUM O %lo)", cksum ^ 0xFFFFFFFF);
++#endif
++
++ vleft(&level);
++ voutln("FONTDIMEN");
++
++ Slant = fnt->slant - fnt->efactor * tan(fnt->italicangle * (PI / 180.0));
++
++ if (Slant)
++ voutln2("(SLANT R %f)", Slant);
++ voutln2("(SPACE D %d)", fnt->fontspace);
++ if (!fnt->fixedpitch)
++ {
++ voutln2("(STRETCH D %d)", transform(200, 0, fnt->efactor, fnt->slant));
++ voutln2("(SHRINK D %d)", transform(100, 0, fnt->efactor, fnt->slant));
++ }
++ voutln2("(XHEIGHT D %d)", fnt->xheight);
++ voutln2("(QUAD D %d)", transform(1000, 0, fnt->efactor, fnt->slant));
++ voutln2("(EXTRASPACE D %d)",
++ fnt->fixedpitch ? fnt->fontspace :
++ transform(111, 0, fnt->efactor, fnt->slant));
++ vright(&level);
++
++ for (i = 0; i < fnt->subfont_num; i++)
++ {
++ vleft(&level);
++ voutln2("MAPFONT D %d", i);
++ voutln2("(FONTNAME %s)", (fnt->subfont_list[i]).name);
++ voutln2("(FONTCHECKSUM O %lo)", (fnt->subfont_list[i]).cksum);
++ vright(&level);
++ }
++
++ for (i = 0; i <= 0xFFFF; i++)
++ ofm_array[i] = NULL;
++
++ for (ti = fnt->charlist; ti != NULL; ti = ti->next)
++ if (ti->charcode >= 0 && ti->charcode <= 0xFFFF)
++ ofm_array[ti->charcode] = ti;
++
++ for (i = 0; i <= 0xFFFF && ofm_array[i] == NULL; i++)
++ ;
++ bc = i;
++ for (i = 0xFFFF; i >= 0 && ofm_array[i] == NULL; i--)
++ ;
++ ec = i;
++
++ if (ec < bc)
++ oops("No TTF characters.");
++
++ for (i = bc; i <= ec; i++)
++ {
++ if ((ti = ofm_array[i]) == NULL) continue;
++
++ vleft(&level);
++ fprintf(out, "CHARACTER H %X\n ", ti->charcode);
++
++ voutln2("(CHARWD R %d)", ti->width);
++ if (ti->ury)
++ voutln2("(CHARHT R %d)", ti->ury);
++ if (ti->lly)
++ voutln2("(CHARDP R %d)", -ti->lly);
++ if (ti->urx > ti->width)
++ voutln2("(CHARIC R %d)", ti->urx - ti->width);
++
++ vleft(&level);
++ voutln("MAP");
++ if (ti->fntnum)
++ voutln2("(SELECTFONT D %d)", ti->fntnum);
++
++ voutln2("(SETCHAR H %X)", (unsigned)ti->incode);
++ vright(&level);
++
++ vright(&level);
++ }
++
++ if (level)
++ oops("I forgot to match the parentheses.");
++}
++
++
+ /* end */
+diff -uNr contrib/ttf2pk/vplaux.h contrib/ttf2pk/vplaux.h
+--- contrib/ttf2pk/vplaux.h 2002-01-08 21:48:27.000000000 +0900
++++ contrib/ttf2pk/vplaux.h 2005-12-22 16:48:26.000000000 +0900
+@@ -16,6 +16,7 @@
+
+ void writevpl(Font *fnt, char makevpl, Boolean forceoctal);
+ void upmap(Font *fnt);
++void writeovp(Font *fnt);
+
+ #endif /* VPLAUX_H */
+
diff -uNr freetype1-1.4pre.20030402/patches/02_ttf2pk-1.5-kpathsea.patch
freetype1-1.4pre.20030402/patches/02_ttf2pk-1.5-kpathsea.patch
--- freetype1-1.4pre.20030402/patches/02_ttf2pk-1.5-kpathsea.patch
1970-01-01 09:00:00.000000000 +0900
+++ freetype1-1.4pre.20030402/patches/02_ttf2pk-1.5-kpathsea.patch
2005-12-23 02:45:55.000000000 +0900
@@ -0,0 +1,47 @@
+diff -uNr contrib/ttf2pk/filesrch.c contrib/ttf2pk/filesrch.c
+--- contrib/ttf2pk/filesrch.c 2002-01-08 21:48:27.000000000 +0900
++++ contrib/ttf2pk/filesrch.c 2005-12-22 17:08:03.000000000 +0900
+@@ -96,7 +96,7 @@
+ return kpse_find_file(*name, kpse_tex_ps_header_format, True);
+ #endif
+ #else
+- return kpse_find_file(*name, kpse_program_text_format, True);
++ return kpse_find_file(*name, kpse_enc_format, True);
+ #endif
+ }
+
+@@ -130,7 +130,7 @@
+ return kpse_find_file(*name, kpse_tex_ps_header_format, True);
+ #endif
+ #else
+- return kpse_find_file(*name, kpse_program_text_format, True);
++ return kpse_find_file(*name, kpse_sfd_format, True);
+ #endif
+ }
+
+@@ -147,7 +147,7 @@
+ return kpse_find_file(*name, kpse_tex_ps_header_format, True);
+ #endif
+ #else
+- return kpse_find_file(*name, kpse_program_text_format, True);
++ return kpse_find_file(*name, kpse_fontmap_format, True);
+ #endif
+ }
+
+@@ -196,10 +196,15 @@
+ return real_name;
+
+ #else /* OLD_KPATHSEA */
++ char* real_name;
+
+ /* no extra extension handling necessary */
+
+- return kpse_find_file(*name, kpse_truetype_format, True);
++ real_name= kpse_find_file(*name, kpse_truetype_format, True);
++ if (!real_name)
++ real_name= kpse_find_file(*name, kpse_program_binary_format, True);
++
++ return real_name;
+
+ #endif
+ }