Commit 7e9503a3 authored by Vasudev Kamath's avatar Vasudev Kamath

Imported Upstream version 2.104~dfsg

parent f35225b9
......@@ -2,9 +2,8 @@
AUTOMAKE_OPTIONS = foreign check-news
SUBDIRS = liblcdf libefont @SELECTED_SUBDIRS@
DIST_SUBDIRS = liblcdf libefont cfftot1 mmafm mmpfb otfinfo otftotfm t1dotlessj t1lint t1rawafm t1reencode t1testpage ttftotype42
pkgdata_DATA = glyphlist.txt texglyphlist.txt 7t.enc
DIST_SUBDIRS = liblcdf libefont cfftot1 mmafm mmpfb otfinfo otftotfm \
t1dotlessj t1lint t1rawafm t1reencode t1testpage ttftotype42
EXTRA_DIST = \
ONEWS \
......@@ -63,21 +62,25 @@ EXTRA_DIST = \
texglyphlist-g2u.txt \
7t.enc
glyphlist_DATA = glyphlist.txt texglyphlist.txt
enc_DATA = 7t.enc
liblcdf libefont:
cd $@ && $(MAKE)
libefont: liblcdf
cfftot1 mmafm mmpfb otfinfo otftotfm t1dotlessj t1lint t1rawafm t1reencode t1testpage ttftotype42: liblcdf libefont
cfftot1 mmafm mmpfb otfinfo otftotfm t1dotlessj t1lint t1rawafm \
t1reencode t1testpage ttftotype42: liblcdf libefont
cd $@ && $(MAKE)
versionize:
perl -pi -e 's/^\.ds V.*/.ds V $(VERSION)/;' $(top_srcdir)/cfftot1/cfftot1.1 $(top_srcdir)/mmafm/mmafm.1 $(top_srcdir)/mmpfb/mmpfb.1 $(top_srcdir)/otfinfo/otfinfo.1 $(top_srcdir)/otftotfm/otftotfm.1 $(top_srcdir)/t1dotlessj/t1dotlessj.1 $(top_srcdir)/t1lint/t1lint.1 $(top_srcdir)/t1rawafm/t1rawafm.1 $(top_srcdir)/t1reencode/t1reencode.1 $(top_srcdir)/t1testpage/t1testpage.1 $(top_srcdir)/ttftotype42/ttftotype42.1
perl -pi -e 's/^(\U$(PACKAGE)\E) [\d.ab]+$$/$$1 $(VERSION)/;' $(top_srcdir)/README
perl -pi -e 's/^Version: [\d.ab]+$$/Version: $(VERSION)/;' $(top_srcdir)/lcdf-typetools.spec
perl -pi -e 's/^\.ds V.*/.ds V $(VERSION)/;' $(srcdir)/cfftot1/cfftot1.1 $(srcdir)/mmafm/mmafm.1 $(srcdir)/mmpfb/mmpfb.1 $(srcdir)/otfinfo/otfinfo.1 $(srcdir)/otftotfm/otftotfm.1 $(srcdir)/t1dotlessj/t1dotlessj.1 $(srcdir)/t1lint/t1lint.1 $(srcdir)/t1rawafm/t1rawafm.1 $(srcdir)/t1reencode/t1reencode.1 $(srcdir)/t1testpage/t1testpage.1 $(srcdir)/ttftotype42/ttftotype42.1
perl -pi -e 's/^(\U$(PACKAGE)\E) [\d.ab]+$$/$$1 $(VERSION)/;' $(srcdir)/README
perl -pi -e 's/^Version: [\d.ab]+$$/Version: $(VERSION)/;' $(srcdir)/lcdf-typetools.spec
dist-hook:
if test -f $(top_srcdir)/make-glyphtounicode.pl; then (cd $(top_srcdir); perl make-glyphtounicode.pl) > $(distdir)/glyphtounicode.tex; elif test -f $(top_srcdir)/glyphtounicode.tex; then cp $(top_srcdir)/glyphtounicode.tex $(distdir); fi
if test -f $(srcdir)/make-glyphtounicode.pl; then (cd $(srcdir); perl make-glyphtounicode.pl) > $(distdir)/glyphtounicode.tex; elif test -f $(srcdir)/glyphtounicode.tex; then cp $(srcdir)/glyphtounicode.tex $(distdir); fi
$(top_srcdir)/glyphtounicode.tex: $(top_srcdir)/glyphlist.txt $(top_srcdir)/texglyphlist.txt $(top_srcdir)/texglyphlist-g2u.txt $(top_srcdir)/make-glyphtounicode.pl
cd $(top_srcdir); perl make-glyphtounicode.pl > glyphtounicode.tex
$(srcdir)/glyphtounicode.tex: $(srcdir)/glyphlist.txt $(srcdir)/texglyphlist.txt $(srcdir)/texglyphlist-g2u.txt $(srcdir)/make-glyphtounicode.pl
cd $(srcdir); perl make-glyphtounicode.pl > glyphtounicode.tex
.PHONY: rpm liblcdf libefont cfftot1 mmafm mmpfb otfinfo otftotfm t1dotlessj t1lint t1rawafm t1reencode t1testpage ttftotype42
This diff is collapsed.
LCDF Typetools NEWS
Version 2.104 7.Jul.2014
* Fix a nit with format-1 chaining context substitutions.
Version 2.103 6.Jul.2014
* otftotfm: Address a problem experienced by Bob Tennent where a
ligature setting wasn't included in the output VPL.
Version 2.102 4.Jul.2014
* otftotfm: Fix the construction of multi-character secondary
replacements; they were given enormous widths. Reported by Wydra
Dennis.
Version 2.101 16.Jun.2014
* otftotfm: Handle fonts with unexpected transformation matrices,
such as CFF fonts with 2048 units per em.
* otftotfm: Add --x-height option.
* otftotfm: Handle more TrueType fonts by fixing otftotfm bugs and
compensating for some TTF bugs.
* Thanks to Bob Tennent and Marc Penninga.
Version 2.100 8.Jan.2014
* otftotfm: On some fonts, ligature handling could enter an infinite
loop. Fix this. Reported by Marc Penninga and Bob Tennent.
* Fix updmap runs.
* Build updates for C++11 and other compilers.
Version 2.99 13.Aug.2013
* cfftot1: Correct bug that rarely corrupted Type 1 output fonts.
Reported by Sebastian Schubert.
Version 2.98 10.Apr.2013
* Fix alignment bug that corrupted output fonts on some platforms
(MIPS especially). Reported by Norbert Preining.
Version 2.97 25.Oct.2012
* Same.
Version 2.96 25.Oct.2012
* Build improvements inspired by Peter Breitenlohner.
Version 2.95 21.Sep.2012
* Fix cfftot1: Don't crash on problematic fonts. Bob Tennent report.
Version 2.94 3.Aug.2012
* More compilation updates.
Version 2.93 23.Jul.2012
* Correct compilation problem reported by Dennis Veatch.
* Update OpenType feature, script, and language lists, and some other nits.
Version 2.92 14.Aug.2011
* Correct horrible x86-64 byte-order issue. Bug reported by Michael Ummels.
......
LCDF-TYPETOOLS 2.92
===================
LCDF-TYPETOOLS
==============
USAGE
-----
The LCDF Typetools package contains several programs for manipulating
PostScript Type 1, Type 1 multiple master, and PostScript-flavored OpenType
fonts. LCDF Typetools includes the mmafm and mmpfb programs, which were
formerly distributed as part of a different package (mminstance).
LCDF Typetools comprises several programs for manipulating
PostScript Type 1, Type 1 multiple master, and OpenType fonts.
Cfftot1 translates a Compact Font Format (CFF) font, or a PostScript-
flavored OpenType font, into PostScript Type 1 format. It correctly
handles subroutines and hints. See the manual page 'cfftot1/cfftot1.1' for
handles subroutines and hints. See the manual page `cfftot1/cfftot1.1` for
more information.
Mmafm creates an AFM file (font metrics) corresponding to an instance of
a multiple-master font. It reads the AMFM and AFM files distributed with
the font. See MMINSTANCE NOTES, below, and the manual page 'mmafm/mmafm.1'
the font. See MMAFM AND MMPFB, below, and the manual page `mmafm/mmafm.1`
for more information.
Mmpfb creates a normal, single-master font program which looks like an
instance of a multiple-master font. It reads the multiple master font
program in PFA or PFB format. See MMINSTANCE NOTES, below, and the manual
page 'mmpfb/mmpfb.1' for more information.
program in PFA or PFB format. See MMAFM AND MMPFB, below, and the manual
page `mmpfb/mmpfb.1` for more information.
Otfinfo reports information about OpenType fonts, such as the features
they support and the contents of their 'size' optical size features. See
the manual page 'otfinfo/otfinfo.1' for more information.
the manual page `otfinfo/otfinfo.1` for more information.
Otftotfm creates TeX font metrics and encodings that correspond to a
PostScript-flavored OpenType font. It will interpret glyph positionings,
substitutions, and ligatures as far as it is able. You can say which
OpenType features should be activated. See the manual page
'otftotfm/otftotfm.1' for more information.
Otftotfm creates TeX font metrics and encodings that correspond to
a OpenType font. It will interpret glyph positionings, substitutions,
and ligatures as far as it is able. You can say which OpenType
features should be activated. See the manual page
`otftotfm/otftotfm.1` for more information.
T1dotlessj reads a Type 1 font, then creates a new Type 1 font whose
only character is a dotless "j" matching the input font's design. See the
manual page 't1dotlessj/t1dotlessj.1' for more information.
manual page `t1dotlessj/t1dotlessj.1` for more information.
T1lint checks Type 1 fonts for correctness. It tests most of the
requirements listed in Adobe Systems' Black Book ("Adobe Type 1 Font
Format"), and some others. See the manual page 't1lint/t1lint.1' for more
Format"), and some others. See the manual page `t1lint/t1lint.1` for more
information.
T1reencode reencodes a Type 1 font, replacing its internal encoding with
one you specify. See the manual page 't1reencode/t1reencode.1' for more
one you specify. See the manual page `t1reencode/t1reencode.1` for more
information.
Ttftotype42 creates a Type 42 wrapper for a TrueType or
TrueType-flavored OpenType font. See the manual page
'ttftotype42/ttftotype42.1' for more information.
`ttftotype42/ttftotype42.1` for more information.
The final program is preliminary: t1testpage creates a PostScript test
page for a given font file. See the manual page 't1testpage/t1testpage.1'
for more information.
Finally, t1testpage creates a PostScript test page for a given font
file. See the manual page `t1testpage/t1testpage.1` for more
information.
Please write me with problems, patches, and suggestions at the address
below.
......@@ -61,28 +57,28 @@ below.
REQUIREMENTS
------------
UNIX; gmake; C & C++ compilers. To build, just run ./configure, then
gmake. See 'INSTALL' in this directory for more detailed information about
'./configure'.
gmake. See `INSTALL` in this directory for more detailed information about
`./configure`.
Some programs can link with additional libraries. Otftotfm can use the
Kpathsea TeX-related path searching library; if your kpathsea library is in
a nonstandard place, supply 'configure' with the '--with-kpathsea=PREFIX'
a nonstandard place, supply `./configure` with the `--with-kpathsea=PREFIX`
option to find it.
You can also disable individual programs by supplying 'configure' with
'--disable-PROGNAME' options. See './configure --help' for more
You can also disable individual programs by supplying `./configure` with
`--disable-PROGNAME` options. See `./configure --help` for more
information.
MMINSTANCE NOTES
----------------
MMAFM AND MMPFB
---------------
Examples
........
% mmafm MyriadMM.amfm --weight=300 --width=585 > MyriadMM_300_585_.afm
% mmpfb MyriadMM.pfb --weight=300 --width=585 > MyriadMM_300_585_.pfb
Run `mmafm --help' and `mmpfb --help' for a full option summary.
Run `mmafm --help` and `mmpfb --help` for a full option summary.
Running mmafm
.............
......@@ -94,38 +90,38 @@ automatically. For the automatic method, you must follow one of these 2
conventions:
1) The AFM files are in the same directory as the AMFM file. They are
named `FONTNAME.afm' -- `MyriadMM-LightCn.afm', for example.
named `FONTNAME.afm` -- `MyriadMM-LightCn.afm`, for example.
2) There is a `PSres.upr' file that lists the AFMs by font name, and the
`PSRESOURCEPATH' environment variable contains the directory with that
`PSres.upr' file. (`ps2pk' comes with a sample `PSres.upr' file.)
2) There is a `PSres.upr` file that lists the AFMs by font name, and the
`PSRESOURCEPATH` environment variable contains the directory with that
`PSres.upr` file. (`ps2pk` comes with a sample `PSres.upr` file.)
Intermediate masters
....................
Mmpfb can handle intermediate-master fonts transparently. If you use
`PSres.upr' files, as described above, mmafm will also work transparently
`PSres.upr` files, as described above, mmafm will also work transparently
on intermediate-master fonts: it'll call mmpfb to get the information it
needs. If you don't use `PSres.upr' files, you need to use mmpfb ahead of
needs. If you don't use `PSres.upr` files, you need to use mmpfb ahead of
time to set up some auxiliary files. Say you want to use an intermediate
master font `FONT', and FONT's AMFM file is in the `DIR' directory. Here's
master font `FONT`, and FONT's AMFM file is in the `DIR` directory. Here's
what you need to do:
% mmpfb FONT.pfb --amcp-info > DIR/FONT.amcp
When you run mmafm on 'DIR/FONT.amfm', it will automatically look for
'DIR/FONT.amcp'. An example using Adobe Jenson:
When you run mmafm on `DIR/FONT.amfm`, it will automatically look for
`DIR/FONT.amcp`. An example using Adobe Jenson:
% cd ~/Fonts/AJensonMM
% mmpfb AJensonMM.pfb --amcp-info > AJensonMM.amcp
Most multiple master fonts don't have intermediate masters, so you won't
usually need to make '.amcp' files. Mmafm will tell you if it is necessary
usually need to make `.amcp` files. Mmafm will tell you if it is necessary
for a particular font.
COPYRIGHT/LICENSE
-----------------
All source code is Copyright (c) 1997-2011 Eddie Kohler.
All source code is Copyright (c) 1997-2013 Eddie Kohler.
This code is distributed under the GNU General Public License, Version 2
(and only Version 2). The GNU General Public License is available via the
......@@ -135,10 +131,10 @@ this directory.
AUTHOR
------
Eddie Kohler, <kohler@cs.ucla.edu>
Eddie Kohler <ekohler@gmail.com>
http://www.lcdf.org/
The current version of the lcdf-typetools package is available on the
Web at 'http://www.lcdf.org/type/'.
Web at http://www.lcdf.org/type/
LCDF stands for Little Cambridgeport Design Factory.
This diff is collapsed.
/* autoconf.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Directory for glyphlist.txt files. */
#undef GLYPHLISTDIR
/* Define if the va_list type is addressable. */
#undef HAVE_ADDRESSABLE_VA_LIST
......@@ -30,6 +36,10 @@
/* Define to 1 if you have the `ctime' function. */
#undef HAVE_CTIME
/* Define to 1 if you have the declaration of `kpse_enc_format', and to 0 if
you don't. */
#undef HAVE_DECL_KPSE_ENC_FORMAT
/* Define to 1 if you have the declaration of `kpse_opentype_format', and to 0
if you don't. */
#undef HAVE_DECL_KPSE_OPENTYPE_FORMAT
......@@ -81,6 +91,9 @@
/* Define if PermStrings are available. */
#undef HAVE_PERMSTRING
/* Define to include precondition checking assertions. */
#undef HAVE_PRECONDITION_CHECKING
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
......@@ -168,21 +181,24 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* kpsewhich's $SELFAUTODIR variable */
#undef SELFAUTODIR
/* kpsewhich's $SELFAUTOGRANDPARENT variable */
#undef SELFAUTOGRANDPARENT
/* kpsewhich's $SELFAUTOLOC variable */
#undef SELFAUTOLOC
/* kpsewhich's $SELFAUTOPARENT variable */
#undef SELFAUTOPARENT
/* Data directory. */
#undef SHAREDIR
/* The size of `unsigned int', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_INT
......@@ -198,10 +214,17 @@
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/* Define to 1 if your processor stores words with the least significant byte
first (like Intel and VAX, unlike Motorola and SPARC). */
#undef WORDS_LITTLEENDIAN
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Define if WORDS_BIGENDIAN has been set. */
#undef WORDS_BIGENDIAN_SET
......@@ -9,7 +9,7 @@ cfftot1_SOURCES = cfftot1.cc \
cfftot1_LDADD = ../libefont/libefont.a ../liblcdf/liblcdf.a
INCLUDES = -I$(top_srcdir)/include
AM_CPPFLAGS = -I$(srcdir)/../include
CLEANFILES = @TEMPLATE_OBJS@
EXTRA_DIST = cfftot1.1
This diff is collapsed.
.ds V 2.92
.ds V 2.104
.de M
.BR "\\$1" "(\\$2)\\$3"
..
......
/* cfftot1.cc -- driver for translating CFF fonts to Type 1 fonts
*
* Copyright (c) 2002-2011 Eddie Kohler
* Copyright (c) 2002-2014 Eddie Kohler
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
......@@ -123,38 +123,43 @@ do_file(const char *infn, const char *outfn, PermString name, ErrorHandler *errh
if (c == EOF)
errh->fatal("%s: empty file", infn);
if (c == 1 || c == 'O') {
StringAccum sa(150000);
int amt;
do {
if (char *x = sa.reserve(32768)) {
amt = fread(x, 1, 32768, f);
sa.adjust_length(amt);
} else
amt = 0;
} while (amt != 0);
if (!feof(f) || ferror(f))
errh->lerror(infn, "%s", strerror(errno));
if (f != stdin)
fclose(f);
LandmarkErrorHandler cerrh(errh, infn);
String data = sa.take_string();
if (c == 'O')
data = Efont::OpenType::Font(data, &cerrh).table("CFF");
Cff *cff = new Cff(data, &cerrh);
Cff::FontParent *fp = cff->font(name, &cerrh);
if (errh->nerrors() == 0
&& !(font = dynamic_cast<Cff::Font *>(fp)))
errh->fatal("%s: CID-keyed fonts not supported", infn);
} else
if (c != 1 && c != 'O')
errh->fatal("%s: not a CFF or OpenType/CFF font", infn);
StringAccum sa(150000);
int amt;
do {
if (char *x = sa.reserve(32768)) {
amt = fread(x, 1, 32768, f);
sa.adjust_length(amt);
} else
amt = 0;
} while (amt != 0);
if (!feof(f) || ferror(f))
errh->lerror(infn, "%s", strerror(errno));
if (f != stdin)
fclose(f);
ContextErrorHandler cerrh(errh, "While processing %s:", infn);
cerrh.set_indent(0);
String data = sa.take_string();
unsigned units_per_em = 0;
if (c == 'O') {
Efont::OpenType::Font font(data, &cerrh);
data = font.table("CFF");
units_per_em = font.units_per_em();
}
Cff *cff = new Cff(data, units_per_em, &cerrh);
Cff::FontParent *fp = cff->font(name, &cerrh);
if (errh->nerrors() == 0
&& !(font = dynamic_cast<Cff::Font *>(fp)))
errh->fatal("%s: CID-keyed fonts not supported", infn);
if (errh->nerrors() > 0)
return;
Type1Font *font1 = create_type1_font(font, errh);
Type1Font *font1 = create_type1_font(font, &cerrh);
if (!outfn || strcmp(outfn, "-") == 0) {
f = stdout;
......@@ -216,7 +221,7 @@ main(int argc, char *argv[])
case VERSION_OPT:
printf("cfftot1 (LCDF typetools) %s\n", VERSION);
printf("Copyright (C) 2002-2011 Eddie Kohler\n\
printf("Copyright (C) 2002-2013 Eddie Kohler\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty, not even for merchantability or fitness for a\n\
particular purpose.\n");
......
/* maket1font.{cc,hh} -- translate CFF fonts to Type 1 fonts
*
* Copyright (c) 2002-2011 Eddie Kohler
* Copyright (c) 2002-2012 Eddie Kohler
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
......@@ -86,16 +86,20 @@ class MakeType1CharstringInterp::Subr { public:
Subr *subr;
int pos;
int len;
String s;
Caller(Subr *s, int p, int l) : subr(s), pos(p), len(l) { }
String charstring(MakeType1CharstringInterp *mcsi) const { return subr->charstring(mcsi)->substring(pos, len); }
Caller(Subr *s, int p, int l)
: subr(s), pos(p), len(l) {
}
String charstring(MakeType1CharstringInterp *mcsi) const {
Type1Charstring *t1cs = subr->charstring(mcsi);
return t1cs->substring(pos, len);
}
};
int ncallers() const { return _callers.size(); }
const Caller &caller(int i) const { return _callers[i]; }
void add_call(Subr *s) { _calls.push_back(s); }
void add_caller(Subr *, int, int);
void add_caller(Subr *s, int pos, int len);
int output_subrno() const { return _output_subrno; }
void set_output_subrno(int n) { _output_subrno = n; }
......@@ -104,8 +108,6 @@ class MakeType1CharstringInterp::Subr { public:
void change_callers(Subr *, int pos, int length, int new_length);
bool unify(MakeType1CharstringInterp *);
void caller_data(bool assign, MakeType1CharstringInterp *mcsi);
private:
CsRef _csr;
......@@ -204,7 +206,10 @@ MakeType1CharstringInterp::Subr::name(const MakeType1CharstringInterp *mcsi) con
case CSR_GSUBR:
return "gsubr" + String(n);
case CSR_GLYPH:
return mcsi->output()->glyph_name(n);
if (String name = mcsi->output()->glyph_name(n))
return name;
else
return "??glyph" + String(n) + "??";
default:
return "";
}
......@@ -263,36 +268,19 @@ MakeType1CharstringInterp::Subr::change_callers(Subr *caller, int pos, int lengt
/* nada */;
else if (pos <= c.pos && c.pos + c.len <= right) {
// erase
//fprintf(stderr, " ERASE caller %08x:%d+%d\n", c.subr->_csr, c.pos, c.len);
//if (c.debug) fprintf(stderr, " ERASE caller %08x:%d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, pos, length);
c.subr = 0;
} else if (right <= c.pos) {
//fprintf(stderr, " ADJUST caller %08x:%d+%d -> %d+%d\n", c.subr->_csr, c.pos, c.len, c.pos+delta, c.len);
//if (c.debug) fprintf(stderr, " ADJUST caller %08x:%d+%d -> %d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, c.pos+delta, c.len, pos, length);
c.pos += delta;
} else if (c.pos <= pos && right <= c.pos + c.len) {
//if (c.debug) fprintf(stderr, " ADJUST caller %08x:%d+%d -> %d+%d [%d+%d]\n", c.subr->_csr, c.pos, c.len, c.pos, c.len+delta, pos, length);
c.len += delta;
} else
c.subr = 0;
}
}
void
MakeType1CharstringInterp::Subr::caller_data(bool assign, MakeType1CharstringInterp *mcsi)
{
for (int i = 0; i < _callers.size(); i++) {
Caller &c = _callers[i];
if (!c.subr)
continue;
String s = c.subr->charstring(mcsi)->substring(c.pos, c.len);
if (assign)
c.s = s;
else if (c.s != s) {
//fprintf(stderr, "FAIL %08x caller %08x:%d+%d\n", _csr, c.subr->_csr, c.pos, c.len);
//assert(0);
}
assert(c.subr->has_call(this));
}
}
bool
MakeType1CharstringInterp::Subr::unify(MakeType1CharstringInterp *mcsi)
{
......@@ -308,7 +296,7 @@ MakeType1CharstringInterp::Subr::unify(MakeType1CharstringInterp *mcsi)
return false;
assert(!_calls.size()); // because this hasn't been unified yet
// Find the smallest shared substring.
// Find the smallest shared complete charstring.
String substr = _callers[0].charstring(mcsi);
int suboff = 0;
for (int i = 1; i < _callers.size(); i++) {
......@@ -317,7 +305,18 @@ MakeType1CharstringInterp::Subr::unify(MakeType1CharstringInterp *mcsi)
const char *dx = substr.data() + substr.length(), *d1x = d1 + substr1.length();
while (dx > d && d1x > d1 && dx[-1] == d1x[-1])
dx--, d1x--;
suboff = dx - substr.data();
if (d1x != d1) {
// 8.13.2013 -- We might have stopped in the middle of a number
// or command in d1 -- even if we absorbed all of d! For
// example, maybe d's version is "15 rlineto" (encoded "154 5"),
// and our version is "518 rlineto" (encoded "248 154 5")! So
// whenever we stop before the end of d1, we must adjust our
// position to the next caret in d1, which, in the example,
// would be after "248 154" and before "5".
int suboff1 = Type1Charstring(substr1).first_caret_after(d1x - d1);
dx += suboff1 - (d1x - d1);
}
suboff = dx - substr.data();
}
substr = substr.substring(Type1Charstring(substr).first_caret_after(suboff));
if (!substr.length())
......@@ -325,6 +324,7 @@ MakeType1CharstringInterp::Subr::unify(MakeType1CharstringInterp *mcsi)
for (int i = 0; i < _callers.size(); i++) {
Caller &c = _callers[i];
if (int delta = c.len - substr.length()) {
//if (c.debug) fprintf(stderr, " PREFIX caller %08x:%d+%d -> %d+%d [%s]\n", c.subr->_csr, c.pos, c.len, c.pos+delta, c.len+delta, CharstringUnparser::unparse(Type1Charstring(substr)).c_str());
c.pos += delta;
c.len -= delta;
}
......@@ -433,12 +433,22 @@ MakeType1CharstringInterp::run(const CharstringProgram *program, Type1Font *outp
run(program->glyph_context(i), receptacle, errh);
#if 0
PermString n = program->glyph_name(i);
if (n == "integral.disp") {
fprintf(stderr, "%s was %s\n", n.c_str(), CharstringUnparser::unparse(*program->glyph(i)).c_str());
fprintf(stderr, "%s == %s\n", n.c_str(), CharstringUnparser::unparse(receptacle).c_str());
if (i == 408 || i == 20) {
fprintf(stderr, "%d: %s was %s\n", i, n.c_str(), CharstringUnparser::unparse(*program->glyph(i)).c_str());
fprintf(stderr, " now %s\n", CharstringUnparser::unparse(receptacle).c_str());
fprintf(stderr, " *** %d.%d: %s\n", 134, 30, CharstringUnparser::unparse(Type1Charstring(receptacle.data_string().substring(134, 30))).c_str());
}
#endif
output->add_glyph(Type1Subr::make_glyph(program->glyph_name(i), receptacle, glyph_definer));
PermString name = program->glyph_name(i);
if (output->glyph(name)) {
errh->warning("glyph %<%s%> defined more than once", name.c_str());
int i = 1;
do {
name = program->glyph_name(i) + String(".") + String(i);
++i;
} while (output->glyph(name));
}
output->add_glyph(Type1Subr::make_glyph(name, receptacle, glyph_definer));
}
// unify Subrs
......
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files