diff options
author | Karl Berry <karl@freefriends.org> | 2008-02-17 19:29:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-02-17 19:29:39 +0000 |
commit | fc3b5d4d4f684baa6216685a0696efb853141529 (patch) | |
tree | 0694ed01c09b3c97fcd64453e2c1f647a3fb31ad /Build/source/texk/lcdf-typetools/cfftot1 | |
parent | 5fc0a693ca037d37d815b00c49660c138b332224 (diff) |
move lcdf-typetools to texk and update to 2.66
git-svn-id: svn://tug.org/texlive/trunk@6662 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/lcdf-typetools/cfftot1')
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/Makefile.am | 15 | ||||
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/Makefile.in | 472 | ||||
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/cfftot1.1 | 87 | ||||
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/cfftot1.cc | 257 | ||||
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/maket1font.cc | 569 | ||||
-rw-r--r-- | Build/source/texk/lcdf-typetools/cfftot1/maket1font.hh | 10 |
6 files changed, 1410 insertions, 0 deletions
diff --git a/Build/source/texk/lcdf-typetools/cfftot1/Makefile.am b/Build/source/texk/lcdf-typetools/cfftot1/Makefile.am new file mode 100644 index 00000000000..6bfd3a37b6c --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/Makefile.am @@ -0,0 +1,15 @@ +## Process this file with automake to produce Makefile.in +AUTOMAKE_OPTIONS = foreign + +bin_PROGRAMS = cfftot1 +man_MANS = cfftot1.1 + +cfftot1_SOURCES = cfftot1.cc \ + maket1font.cc maket1font.hh + +cfftot1_LDADD = ../libefont/libefont.a ../liblcdf/liblcdf.a + +INCLUDES = -I$(top_srcdir)/include +CLEANFILES = @TEMPLATE_OBJS@ + +EXTRA_DIST = cfftot1.1 diff --git a/Build/source/texk/lcdf-typetools/cfftot1/Makefile.in b/Build/source/texk/lcdf-typetools/cfftot1/Makefile.in new file mode 100644 index 00000000000..11e6827e9d7 --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/Makefile.in @@ -0,0 +1,472 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = cfftot1$(EXEEXT) +subdir = cfftot1 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_cfftot1_OBJECTS = cfftot1.$(OBJEXT) maket1font.$(OBJEXT) +cfftot1_OBJECTS = $(am_cfftot1_OBJECTS) +cfftot1_DEPENDENCIES = ../libefont/libefont.a ../liblcdf/liblcdf.a +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(cfftot1_SOURCES) +DIST_SOURCES = $(cfftot1_SOURCES) +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FIXLIBC_O = @FIXLIBC_O@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +KPSEINTERFACE_O = @KPSEINTERFACE_O@ +LDFLAGS = @LDFLAGS@ +LIBKPATHSEA = @LIBKPATHSEA@ +LIBKPATHSEA_DEP = @LIBKPATHSEA_DEP@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SELECTED_SUBDIRS = @SELECTED_SUBDIRS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TEMPLATE_OBJS = @TEMPLATE_OBJS@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +AUTOMAKE_OPTIONS = foreign +man_MANS = cfftot1.1 +cfftot1_SOURCES = cfftot1.cc \ + maket1font.cc maket1font.hh + +cfftot1_LDADD = ../libefont/libefont.a ../liblcdf/liblcdf.a +INCLUDES = -I$(top_srcdir)/include +CLEANFILES = @TEMPLATE_OBJS@ +EXTRA_DIST = cfftot1.1 +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cfftot1/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign cfftot1/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +cfftot1$(EXEEXT): $(cfftot1_OBJECTS) $(cfftot1_DEPENDENCIES) + @rm -f cfftot1$(EXEEXT) + $(CXXLINK) $(cfftot1_LDFLAGS) $(cfftot1_OBJECTS) $(cfftot1_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfftot1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maket1font.Po@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +uninstall-info-am: +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: install-man1 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-man1 \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-info-am uninstall-man uninstall-man1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.1 b/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.1 new file mode 100644 index 00000000000..f2c2036dfcb --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.1 @@ -0,0 +1,87 @@ +.ds V 2.66 +.de M +.BR "\\$1" "(\\$2)\\$3" +.. +.de Sp +.if n .sp +.if t .sp 0.4 +.. +.TH CFFTOT1 1 "LCDF Typetools" "Version \*V" +.SH NAME +cfftot1 \- convert PostScript font from CFF to Type 1 +.SH SYNOPSIS +.B cfftot1 +\%[\fB\-a\fR] +\%[\fIinput\fR [\fIoutput\fR]] +.SH DESCRIPTION +.BR Cfftot1 +converts PostScript font programs in the Compact Font Format (CFF) into +Type 1 font programs in PFB or PFA format, preserving all hints that can be +represented in Type 1. The input file should be a raw CFF file or a +PostScript-flavored OpenType font. If the file +.I output +is not specified output goes to the standard output. +If the file +.I input +is not specified input comes from the standard input. +' +.SH OPTIONS +.PD 0 +.TP 5 +.BI \-a "\fR, " \-\-pfa +Output font in ASCII PFA format. +' +.Sp +.TP 5 +.BI \-b "\fR, " \-\-pfb +Output font in binary PFB format. This is the default. +' +.Sp +.TP 5 +.BI \-n " name\fR, " \-\-name " name" +Output the CFF's component font named +.IR name . +CFF files can contain more than one font, although few do. Use this option +to select a particular font from a multi-font collection. By default +cfftot1 chooses the collection's first font. +' +.Sp +.TP 5 +.BI \-o " file\fR, " \-\-output " file" +Write output font to +.IR file +instead of the standard output. +' +.Sp +.TP 5 +.BR \-q ", " \-\-quiet +Do not generate any error messages. +' +.Sp +.TP 5 +.BR \-h ", " \-\-help +Print usage information and exit. +' +.Sp +.TP 5 +.BR \-v ", " \-\-version +Print the version number and some short non-warranty information and exit. +.PD +' +.SH "SEE ALSO" +.LP +.M t1binary 1 , +.M t1ascii 1 +.LP +.I "Adobe Type 1 Font Format" +.LP +Adobe Technical Notes #5176, +.IR "The Compact Font Format Specification" , +and #5177, +.I "The Type 2 Charstring Format" +.LP +.IR "OpenType Specification" , +Version 1.4 +' +.SH AUTHOR +Eddie Kohler (kohler@cs.ucla.edu) diff --git a/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.cc b/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.cc new file mode 100644 index 00000000000..4f43d15742c --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/cfftot1.cc @@ -0,0 +1,257 @@ +/* cfftot1.cc -- driver for translating CFF fonts to Type 1 fonts + * + * Copyright (c) 2002-2006 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 + * Software Foundation; either version 2 of the License, 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. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +#include <efont/t1rw.hh> +#include <efont/t1font.hh> +#include <efont/t1item.hh> +#include <lcdf/clp.h> +#include <lcdf/error.hh> +#include "maket1font.hh" +#include <efont/cff.hh> +#include <efont/otf.hh> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <stdarg.h> +#include <ctype.h> +#include <errno.h> +#ifdef HAVE_CTIME +# include <time.h> +#endif +#if defined(_MSDOS) || defined(_WIN32) +# include <fcntl.h> +# include <io.h> +#endif + +using namespace Efont; + +#define VERSION_OPT 301 +#define HELP_OPT 302 +#define QUIET_OPT 303 +#define PFB_OPT 304 +#define PFA_OPT 305 +#define OUTPUT_OPT 306 +#define NAME_OPT 307 + +Clp_Option options[] = { + { "ascii", 'a', PFA_OPT, 0, 0 }, + { "binary", 'b', PFB_OPT, 0, 0 }, + { "help", 'h', HELP_OPT, 0, 0 }, + { "name", 'n', NAME_OPT, Clp_ArgString, 0 }, + { "output", 'o', OUTPUT_OPT, Clp_ArgString, 0 }, + { "pfa", 'a', PFA_OPT, 0, 0 }, + { "pfb", 'b', PFB_OPT, 0, 0 }, + { "quiet", 'q', QUIET_OPT, 0, Clp_Negate }, + { "version", 'v', VERSION_OPT, 0, 0 }, +}; + + +static const char *program_name; +static bool binary = true; + + +void +usage_error(ErrorHandler *errh, const char *error_message, ...) +{ + va_list val; + va_start(val, error_message); + if (!error_message) + errh->message("Usage: %s [OPTIONS] [FONTFILE [OUTPUTFILE]]", program_name); + else + errh->verror(ErrorHandler::ERR_ERROR, String(), error_message, val); + errh->message("Type %s --help for more information.", program_name); + exit(1); +} + +void +usage() +{ + printf("\ +'Cfftot1' translates a PostScript font from the Compact Font Format (CFF) to\n\ +the usual Type 1 format. The input file should be either a raw CFF font or a\n\ +PostScript-flavored OpenType font. The result, which is usually written to the\n\ +standard output, is written in PFB or PFA format.\n\ +\n\ +Usage: %s [OPTIONS] [FONTFILE [OUTPUTFILE]]\n\ +\n\ +Options:\n\ + -a, --pfa Output PFA font.\n\ + -b, --pfb Output PFB font. This is the default.\n\ + -n, --name=NAME Select font NAME from CFF.\n\ + -o, --output=FILE Write output to FILE.\n\ + -q, --quiet Do not generate any error messages.\n\ + -h, --help Print this message and exit.\n\ + -v, --version Print version number and exit.\n\ +\n\ +Report bugs to <kohler@cs.ucla.edu>.\n", program_name); +} + + +// MAIN + +static void +do_file(const char *infn, const char *outfn, PermString name, ErrorHandler *errh) +{ + FILE *f; + if (!infn || strcmp(infn, "-") == 0) { + f = stdin; + infn = "<stdin>"; +#if defined(_MSDOS) || defined(_WIN32) + _setmode(_fileno(f), _O_BINARY); +#endif + } else if (!(f = fopen(infn, "rb"))) + errh->fatal("%s: %s", infn, strerror(errno)); + + int c = getc(f); + ungetc(c, f); + + Cff::Font *font = 0; + + if (c == EOF) + errh->fatal("%s: empty file", infn); + if (c == 1 || c == 'O') { + StringAccum sa(150000); + while (!feof(f)) { + int forward = fread(sa.reserve(32768), 1, 32768, f); + sa.forward(forward); + } + 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 + errh->fatal("%s: not a CFF or OpenType/CFF font", infn); + + if (errh->nerrors() > 0) + return; + + Type1Font *font1 = create_type1_font(font, errh); + + if (!outfn || strcmp(outfn, "-") == 0) { + f = stdout; + outfn = "<stdout>"; + } else if (!(f = fopen(outfn, "wb"))) + errh->fatal("%s: %s", outfn, strerror(errno)); + + if (binary) { +#if defined(_MSDOS) || defined(_WIN32) + _setmode(_fileno(f), _O_BINARY); +#endif + Type1PFBWriter t1w(f); + font1->write(t1w); + } else { + Type1PFAWriter t1w(f); + font1->write(t1w); + } + + if (f != stdout) + fclose(f); +} + +int +main(int argc, char *argv[]) +{ + Clp_Parser *clp = + Clp_NewParser(argc, (const char * const *)argv, sizeof(options) / sizeof(options[0]), options); + program_name = Clp_ProgramName(clp); + + ErrorHandler *errh = ErrorHandler::static_initialize(new FileErrorHandler(stderr, String(program_name) + ": ")); + const char *input_file = 0; + const char *output_file = 0; + const char *font_name = 0; + + while (1) { + int opt = Clp_Next(clp); + switch (opt) { + + case PFA_OPT: + binary = false; + break; + + case PFB_OPT: + binary = true; + break; + + case NAME_OPT: + if (font_name) + usage_error(errh, "font name specified twice"); + font_name = clp->arg; + break; + + case QUIET_OPT: + if (clp->negated) + errh = ErrorHandler::default_handler(); + else + errh = new SilentErrorHandler; + break; + + case VERSION_OPT: + printf("cfftot1 (LCDF typetools) %s\n", VERSION); + printf("Copyright (C) 2002-2006 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"); + exit(0); + break; + + case HELP_OPT: + usage(); + exit(0); + break; + + case OUTPUT_OPT: + output_file: + if (output_file) + usage_error(errh, "output file specified twice"); + output_file = clp->arg; + break; + + case Clp_NotOption: + if (input_file && output_file) + usage_error(errh, "too many arguments"); + else if (input_file) + goto output_file; + else + input_file = clp->arg; + break; + + case Clp_Done: + goto done; + + case Clp_BadOption: + usage_error(errh, 0); + break; + + default: + break; + + } + } + + done: + do_file(input_file, output_file, font_name, errh); + + return (errh->nerrors() == 0 ? 0 : 1); +} diff --git a/Build/source/texk/lcdf-typetools/cfftot1/maket1font.cc b/Build/source/texk/lcdf-typetools/cfftot1/maket1font.cc new file mode 100644 index 00000000000..f693ce8b0ba --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/maket1font.cc @@ -0,0 +1,569 @@ +/* maket1font.{cc,hh} -- translate CFF fonts to Type 1 fonts + * + * Copyright (c) 2002-2006 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 + * Software Foundation; either version 2 of the License, 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. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +#include "maket1font.hh" +#include <efont/t1interp.hh> +#include <efont/t1csgen.hh> +#include <lcdf/point.hh> +#include <lcdf/error.hh> +#include <efont/t1font.hh> +#include <efont/t1item.hh> +#include <efont/t1unparser.hh> + +using namespace Efont; + +typedef unsigned CsRef; +enum { CSR_GLYPH = 0x00000000, CSR_SUBR = 0x80000000, + CSR_GSUBR = 0xC0000000, + CSR_TYPE = 0xC0000000, CSR_NUM = 0x3FFFFFFF }; + +class MakeType1CharstringInterp : public Type1CharstringGenInterp { public: + + MakeType1CharstringInterp(int precision = 5); + ~MakeType1CharstringInterp(); + + Type1Font *output() const { return _output; } + + void run(const CharstringProgram *, Type1Font *, PermString glyph_definer, ErrorHandler *); + void run(const CharstringContext &, Type1Charstring &, ErrorHandler *); + + bool type2_command(int, const uint8_t *, int *); + + String landmark() const; + + class Subr; + + private: + + // output + Type1Font *_output; + bool _flex_message; + + // subroutines + int _subr_bias; + int _gsubr_bias; + mutable Vector<Subr *> _glyphs; + mutable Vector<Subr *> _subrs; + mutable Vector<Subr *> _gsubrs; + + Subr *_cur_subr; + int _cur_glyph; + + Subr *csr_subr(CsRef, bool force) const; + Type1Charstring *csr_charstring(CsRef) const; + +}; + +class MakeType1CharstringInterp::Subr { public: + + Subr(CsRef csr) : _csr(csr), _output_subrno(-1), _stamp(0) { } + + bool up_to_date() const { return _stamp == max_stamp; } + void update() { _stamp = max_stamp; } + static void bump_date() { max_stamp++; } + + //String name(const MakeType1CharstringInterp *) const; + Type1Charstring *charstring(const MakeType1CharstringInterp *) const; + + int ncalls() const { return _calls.size(); } + Subr *call(int i) const { return _calls[i]; } + bool has_call(Subr *) const; + + struct Caller { + 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); } + }; + + 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); + + int output_subrno() const { return _output_subrno; } + void set_output_subrno(int n) { _output_subrno = n; } + + void transfer_nested_calls(int pos, int length, Subr *new_caller) const; + void change_callers(Subr *, int pos, int length, int new_length); + bool unify(MakeType1CharstringInterp *); + + void caller_data(bool assign, MakeType1CharstringInterp *mcsi); + + private: + + CsRef _csr; + Vector<Subr *> _calls; + Vector<Caller> _callers; + + int _output_subrno; + int _stamp; + + static int max_stamp; + + friend class MakeType1CharstringInterp; + +}; + +int MakeType1CharstringInterp::Subr::max_stamp = 1; + +inline void +MakeType1CharstringInterp::Subr::add_caller(Subr *s, int pos, int len) +{ + _callers.push_back(Caller(s, pos, len)); +} + +bool +MakeType1CharstringInterp::Subr::has_call(Subr *s) const +{ + for (int i = 0; i < _calls.size(); i++) + if (_calls[i] == s) + return true; + return false; +} + + +/***** + * MakeType1CharstringInterp + **/ + +MakeType1CharstringInterp::MakeType1CharstringInterp(int precision) + : Type1CharstringGenInterp(precision), _flex_message(false) +{ +} + +MakeType1CharstringInterp::~MakeType1CharstringInterp() +{ + for (int i = 0; i < _glyphs.size(); i++) + delete _glyphs[i]; + for (int i = 0; i < _subrs.size(); i++) + delete _subrs[i]; + for (int i = 0; i < _gsubrs.size(); i++) + delete _gsubrs[i]; +} + +String +MakeType1CharstringInterp::landmark() const +{ + if (_cur_glyph >= 0 && _cur_glyph < program()->nglyphs()) + return String("glyph '") + program()->glyph_name(_cur_glyph) + "'"; + else + return String(); +} + + +// subroutines + +MakeType1CharstringInterp::Subr * +MakeType1CharstringInterp::csr_subr(CsRef csr, bool force) const +{ + Vector<Subr *> *vp; + if ((csr & CSR_TYPE) == CSR_SUBR) + vp = &_subrs; + else if ((csr & CSR_TYPE) == CSR_GSUBR) + vp = &_gsubrs; + else if ((csr & CSR_TYPE) == CSR_GLYPH) + vp = &_glyphs; + else + return 0; + + int n = (csr & CSR_NUM); + if (n >= vp->size()) + return 0; + + Subr *&what = (*vp)[n]; + if (!what && force) + what = new Subr(csr); + return what; +} + +#if 0 +String +MakeType1CharstringInterp::Subr::name(const MakeType1CharstringInterp *mcsi) const +{ + int n = (_csr & CSR_NUM); + switch (_csr & CSR_TYPE) { + case CSR_SUBR: + return "subr" + String(n); + case CSR_GSUBR: + return "gsubr" + String(n); + case CSR_GLYPH: + return mcsi->output()->glyph_name(n); + default: + return ""; + } +} +#endif + +Type1Charstring * +MakeType1CharstringInterp::Subr::charstring(const MakeType1CharstringInterp *mcsi) const +{ + int n = (_csr & CSR_NUM); + switch (_csr & CSR_TYPE) { + case CSR_SUBR: + case CSR_GSUBR: + if (_output_subrno >= 0) + return static_cast<Type1Charstring *>(mcsi->output()->subr(_output_subrno)); + return 0; + case CSR_GLYPH: + return static_cast<Type1Charstring *>(mcsi->output()->glyph(n)); + default: + return 0; + } +} + +void +MakeType1CharstringInterp::Subr::transfer_nested_calls(int pos, int length, Subr *new_caller) const +{ + int right = pos + length; + for (int i = 0; i < _calls.size(); i++) { + Subr *cs = _calls[i]; + // 11.Jul.2006 - remember not to shift the new caller's records! (Michael Zedler) + if (cs != new_caller) + for (int j = 0; j < cs->_callers.size(); j++) { + Caller &c = cs->_callers[j]; + if (c.subr == this && pos <= c.pos && c.pos + c.len <= right) { + // shift caller to point at the subroutine + c.subr = new_caller; + c.pos -= pos; + new_caller->add_call(cs); + } + } + } +} + +void +MakeType1CharstringInterp::Subr::change_callers(Subr *caller, int pos, int length, int new_length) +{ + if (up_to_date()) + return; + update(); + + int right = pos + length; + int delta = new_length - length; + for (int i = 0; i < _callers.size(); i++) { + Caller &c = _callers[i]; + if (c.subr != caller) + /* 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); + 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); + c.pos += delta; + } else if (c.pos <= pos && right <= c.pos + c.len) { + 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) +{ + // clean up caller list + for (int i = 0; i < _callers.size(); i++) + if (!_callers[i].subr) { + _callers[i] = _callers.back(); + _callers.pop_back(); + i--; + } + + if (!_callers.size()) + return false; + assert(!_calls.size()); // because this hasn't been unified yet + + // Find the smallest shared substring. + String substr = _callers[0].charstring(mcsi); + int suboff = 0; + for (int i = 1; i < _callers.size(); i++) { + String substr1 = _callers[i].charstring(mcsi); + const char *d = substr.data() + suboff, *d1 = substr1.data(); + 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(); + } + substr = substr.substring(Type1Charstring(substr).first_caret_after(suboff)); + if (!substr.length()) + return false; + for (int i = 0; i < _callers.size(); i++) { + Caller &c = _callers[i]; + if (int delta = c.len - substr.length()) { + c.pos += delta; + c.len -= delta; + } + } + + // otherwise, success + _output_subrno = mcsi->output()->nsubrs(); + mcsi->output()->set_subr(_output_subrno, Type1Charstring(substr + "\013")); + + // This subr has become real, so it is suitable for later unifications. + // Mark it as having called any subroutines contained completely within itself. + // How to do this? Look at one caller, and go over all its calls. + _callers[0].subr->transfer_nested_calls(_callers[0].pos, _callers[0].len, this); + + // adapt callers + String callsubr_string = Type1CharstringGen::callsubr_string(_output_subrno); + + for (int i = 0; i < _callers.size(); i++) + // 13.Jun.2003 - must check whether _callers[i].subr exists: if we + // called a subroutine more than once, change_callers() might have + // zeroed it out. + if (_callers[i].subr && _callers[i].subr != this) { + Subr::Caller c = _callers[i]; + c.subr->charstring(mcsi)->assign_substring(c.pos, c.len, callsubr_string); + Subr::bump_date(); + for (int j = 0; j < c.subr->ncalls(); j++) + c.subr->call(j)->change_callers(c.subr, c.pos, c.len, callsubr_string.length()); + assert(!_callers[i].subr); + } + + // this subr is no longer "called"/interpolated from anywhere + _callers.clear(); + + //fprintf(stderr, "Succeeded %x\n", _csr); + return true; +} + + +// running + +bool +MakeType1CharstringInterp::type2_command(int cmd, const uint8_t *data, int *left) +{ + switch (cmd) { + + case Cs::cCallsubr: + case Cs::cCallgsubr: + if (subr_depth() < MAX_SUBR_DEPTH && size() == 1) { + //fprintf(stderr, "succeeded %d\n", (int) top()); + bool g = (cmd == Cs::cCallgsubr); + CsRef csref = ((int)top() + program()->xsubr_bias(g)) | (g ? CSR_GSUBR : CSR_SUBR); + Subr *callee = csr_subr(csref, true); + if (callee) + _cur_subr->add_call(callee); + + int left = csgen().length(); + + bool more = callxsubr_command(g); + + int right = csgen().length(); + if (error() >= 0 && callee) + callee->add_caller(_cur_subr, left, right - left); + return more; + } else { + //fprintf(stderr, "failed %d\n", (int) top()); + goto normal; + } + + normal: + default: + return CharstringInterp::type2_command(cmd, data, left); + + } +} + +void +MakeType1CharstringInterp::run(const CharstringContext &g, Type1Charstring &out, ErrorHandler *errh) +{ + Type1CharstringGenInterp::run(g, out); + + if (Type1CharstringGenInterp::bad_flex() && !_flex_message) { + errh->lwarning(landmark(), "complex flex hint replaced with curves"); + errh->message("(This Type 2 format font contains flex hints prohibited by Type 1.\nI've safely replaced them with ordinary curves.)"); + _flex_message = true; + } +} + +void +MakeType1CharstringInterp::run(const CharstringProgram *program, Type1Font *output, PermString glyph_definer, ErrorHandler *errh) +{ + _output = output; + set_hint_replacement_storage(output); + + _glyphs.assign(program->nglyphs(), 0); + _subrs.assign(program->nsubrs(), 0); + _subr_bias = program->subr_bias(); + _gsubrs.assign(program->ngsubrs(), 0); + _gsubr_bias = program->gsubr_bias(); + + // run over the glyphs + int nglyphs = program->nglyphs(); + Type1Charstring receptacle; + for (int i = 0; i < nglyphs; i++) { + _cur_subr = _glyphs[i] = new Subr(CSR_GLYPH | i); + _cur_glyph = i; + 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()); + } +#endif + output->add_glyph(Type1Subr::make_glyph(program->glyph_name(i), receptacle, glyph_definer)); + } + + // unify Subrs + for (int i = 0; i < _subrs.size(); i++) + if (_subrs[i]) + _subrs[i]->unify(this); + + for (int i = 0; i < _gsubrs.size(); i++) + if (_gsubrs[i]) + _gsubrs[i]->unify(this); +} + + +/***** + * main + **/ + +static void +add_number_def(Type1Font *output, int dict, PermString name, const Cff::Font *font, Cff::DictOperator op) +{ + double v; + if (font->dict_value(op, &v)) + output->add_definition(dict, Type1Definition::make(name, v, "def")); +} + +static void +add_delta_def(Type1Font *output, int dict, PermString name, const Cff::Font *font, Cff::DictOperator op) +{ + Vector<double> vec; + if (font->dict_value(op, vec)) { + for (int i = 1; i < vec.size(); i++) + vec[i] += vec[i - 1]; + StringAccum sa; + for (int i = 0; i < vec.size(); i++) + sa << (i ? ' ' : '[') << vec[i]; + sa << ']'; + output->add_definition(dict, Type1Definition::make_literal(name, sa.take_string(), (dict == Type1Font::dP ? "|-" : "readonly def"))); + } +} + +Type1Font * +create_type1_font(Cff::Font *font, ErrorHandler *errh) +{ + String version = font->dict_string(Cff::oVersion); + Type1Font *output = Type1Font::skeleton_make(font->font_name(), version); + output->skeleton_comments_end(); + StringAccum sa; + + // FontInfo dictionary + if (version) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("version", version, "readonly def")); + if (String s = font->dict_string(Cff::oNotice)) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("Notice", s, "readonly def")); + if (String s = font->dict_string(Cff::oCopyright)) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("Copyright", s, "readonly def")); + if (String s = font->dict_string(Cff::oFullName)) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("FullName", s, "readonly def")); + if (String s = font->dict_string(Cff::oFamilyName)) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("FamilyName", s, "readonly def")); + if (String s = font->dict_string(Cff::oWeight)) + output->add_definition(Type1Font::dFI, Type1Definition::make_string("Weight", s, "readonly def")); + double v; + if (font->dict_value(Cff::oIsFixedPitch, &v)) + output->add_definition(Type1Font::dFI, Type1Definition::make_literal("isFixedPitch", (v ? "true" : "false"), "def")); + add_number_def(output, Type1Font::dFI, "ItalicAngle", font, Cff::oItalicAngle); + add_number_def(output, Type1Font::dFI, "UnderlinePosition", font, Cff::oUnderlinePosition); + add_number_def(output, Type1Font::dFI, "UnderlineThickness", font, Cff::oUnderlineThickness); + output->skeleton_fontinfo_end(); + + // Encoding, other font dictionary entries + output->add_item(font->type1_encoding_copy()); + font->dict_value(Cff::oPaintType, &v); + output->add_definition(Type1Font::dF, Type1Definition::make("PaintType", v, "def")); + output->add_definition(Type1Font::dF, Type1Definition::make("FontType", 1.0, "def")); + Vector<double> vec; + if (font->dict_value(Cff::oFontMatrix, vec) && vec.size() == 6) { + sa << '[' << vec[0] << ' ' << vec[1] << ' ' << vec[2] << ' ' << vec[3] << ' ' << vec[4] << ' ' << vec[5] << ']'; + output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontMatrix", sa.take_string(), "readonly def")); + } else + output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontMatrix", "[0.001 0 0 0.001 0 0]", "readonly def")); + add_number_def(output, Type1Font::dF, "StrokeWidth", font, Cff::oStrokeWidth); + add_number_def(output, Type1Font::dF, "UniqueID", font, Cff::oUniqueID); + if (font->dict_value(Cff::oXUID, vec) && vec.size()) { + for (int i = 0; i < vec.size(); i++) + sa << (i ? ' ' : '[') << vec[i]; + sa << ']'; + output->add_definition(Type1Font::dF, Type1Definition::make_literal("XUID", sa.take_string(), "readonly def")); + } + if (font->dict_value(Cff::oFontBBox, vec) && vec.size() == 4) { + sa << '{' << vec[0] << ' ' << vec[1] << ' ' << vec[2] << ' ' << vec[3] << '}'; + output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontBBox", sa.take_string(), "readonly def")); + } else + output->add_definition(Type1Font::dF, Type1Definition::make_literal("FontBBox", "{0 0 0 0}", "readonly def")); + output->skeleton_fontdict_end(); + + // Private dictionary + add_delta_def(output, Type1Font::dP, "BlueValues", font, Cff::oBlueValues); + add_delta_def(output, Type1Font::dP, "OtherBlues", font, Cff::oOtherBlues); + add_delta_def(output, Type1Font::dP, "FamilyBlues", font, Cff::oFamilyBlues); + add_delta_def(output, Type1Font::dP, "FamilyOtherBlues", font, Cff::oFamilyOtherBlues); + add_number_def(output, Type1Font::dP, "BlueScale", font, Cff::oBlueScale); + add_number_def(output, Type1Font::dP, "BlueShift", font, Cff::oBlueShift); + add_number_def(output, Type1Font::dP, "BlueFuzz", font, Cff::oBlueFuzz); + if (font->dict_value(Cff::oStdHW, &v)) + output->add_definition(Type1Font::dP, Type1Definition::make_literal("StdHW", String("[") + String(v) + "]", "|-")); + if (font->dict_value(Cff::oStdVW, &v)) + output->add_definition(Type1Font::dP, Type1Definition::make_literal("StdVW", String("[") + String(v) + "]", "|-")); + add_delta_def(output, Type1Font::dP, "StemSnapH", font, Cff::oStemSnapH); + add_delta_def(output, Type1Font::dP, "StemSnapV", font, Cff::oStemSnapV); + if (font->dict_value(Cff::oForceBold, &v)) + output->add_definition(Type1Font::dP, Type1Definition::make_literal("ForceBold", (v ? "true" : "false"), "def")); + add_number_def(output, Type1Font::dP, "LanguageGroup", font, Cff::oLanguageGroup); + add_number_def(output, Type1Font::dP, "ExpansionFactor", font, Cff::oExpansionFactor); + add_number_def(output, Type1Font::dP, "UniqueID", font, Cff::oUniqueID); + output->add_definition(Type1Font::dP, Type1Definition::make_literal("MinFeature", "{16 16}", "|-")); + output->add_definition(Type1Font::dP, Type1Definition::make_literal("password", "5839", "def")); + output->add_definition(Type1Font::dP, Type1Definition::make_literal("lenIV", "0", "def")); + output->skeleton_private_end(); + output->skeleton_common_subrs(); + + // add glyphs + MakeType1CharstringInterp maker(5); + maker.run(font, output, " |-", errh); + + return output; +} + +#include <lcdf/vector.cc> diff --git a/Build/source/texk/lcdf-typetools/cfftot1/maket1font.hh b/Build/source/texk/lcdf-typetools/cfftot1/maket1font.hh new file mode 100644 index 00000000000..75f2527897f --- /dev/null +++ b/Build/source/texk/lcdf-typetools/cfftot1/maket1font.hh @@ -0,0 +1,10 @@ +#ifndef EFONT_MAKET1FONT_HH +#define EFONT_MAKET1FONT_HH +#include <efont/cff.hh> +namespace Efont { +class Type1Font; +} + +Efont::Type1Font *create_type1_font(Efont::Cff::Font *, ErrorHandler *); + +#endif |