From c4d697be7f7089aae27a093fcd55aa734f43d753 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 18 Sep 2012 17:09:10 +0000 Subject: psutils: Install getafm and showchar as linked scripts Adapt to W32TeX (from Akira Kakuto) git-svn-id: svn://tug.org/texlive/trunk@27690 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/psutils/ChangeLog | 4 + Build/source/utils/psutils/Makefile.am | 15 +- Build/source/utils/psutils/Makefile.in | 95 +++--- .../utils/psutils/psutils-1.17-PATCHES/ChangeLog | 5 + .../utils/psutils/psutils-1.17-PATCHES/TL-Changes | 6 +- .../psutils/psutils-1.17-PATCHES/patch-01-WIN32 | 12 +- .../psutils/psutils-1.17-PATCHES/patch-06-MINGW | 15 - Build/source/utils/psutils/psutils-1.17/config.h | 5 +- Build/source/utils/psutils/psutils-1.17/getafm | 358 --------------------- Build/source/utils/psutils/psutils-1.17/getafm.sh | 358 +++++++++++++++++++++ Build/source/utils/psutils/psutils-1.17/showchar | 118 ------- .../source/utils/psutils/psutils-1.17/showchar.sh | 118 +++++++ 12 files changed, 553 insertions(+), 556 deletions(-) delete mode 100644 Build/source/utils/psutils/psutils-1.17-PATCHES/patch-06-MINGW delete mode 100644 Build/source/utils/psutils/psutils-1.17/getafm create mode 100755 Build/source/utils/psutils/psutils-1.17/getafm.sh delete mode 100644 Build/source/utils/psutils/psutils-1.17/showchar create mode 100755 Build/source/utils/psutils/psutils-1.17/showchar.sh diff --git a/Build/source/utils/psutils/ChangeLog b/Build/source/utils/psutils/ChangeLog index 6aeeb1e40f4..1eb67797323 100644 --- a/Build/source/utils/psutils/ChangeLog +++ b/Build/source/utils/psutils/ChangeLog @@ -1,3 +1,7 @@ +2012-08-31 Peter Breitenlohner + + * Makefile.am: Install getafm and showchar as linked scripts. + 2011-12-06 Peter Breitenlohner * Makefile.am: Replace ${prefix}/texmf => $(datarootdir)/texmf. diff --git a/Build/source/utils/psutils/Makefile.am b/Build/source/utils/psutils/Makefile.am index 684ce2397de..77efce26186 100644 --- a/Build/source/utils/psutils/Makefile.am +++ b/Build/source/utils/psutils/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the TeX Live subdirectory utils/psutils/ ## -## Copyright (C) 2009-2011 Peter Breitenlohner +## Copyright (C) 2009-2012 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## ACLOCAL_AMFLAGS = -I ../../m4 @@ -90,8 +90,8 @@ perl_scripts = \ psmerge sh_scripts = \ - $(PSUTILS_TREE)/getafm \ - $(PSUTILS_TREE)/showchar + getafm \ + showchar scriptsdir = texmf/scripts/psutils nodist_bin_SCRIPTS = @@ -100,12 +100,11 @@ include $(srcdir)/../../texk/am/script_links.am texmfdir = $(datarootdir)/$(scriptsdir) nodist_texmf_SCRIPTS = $(perl_scripts:=.pl) +texmf_SCRIPTS = \ + $(PSUTILS_TREE)/getafm.sh \ + $(PSUTILS_TREE)/showchar.sh -if !WIN32 -bin_SCRIPTS = $(sh_scripts) -endif !WIN32 - -install-data-hook: install-perl-links +install-data-hook: install-perl-links install-sh-links uninstall-hook: uninstall-links diff --git a/Build/source/utils/psutils/Makefile.in b/Build/source/utils/psutils/Makefile.in index 63f5f535d8b..343d1bfffb7 100644 --- a/Build/source/utils/psutils/Makefile.in +++ b/Build/source/utils/psutils/Makefile.in @@ -75,7 +75,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = patchlev.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" \ + "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(texmfdir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_epsffit_OBJECTS = epsffit.$(OBJEXT) pserror.$(OBJEXT) @@ -128,7 +128,8 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -SCRIPTS = $(bin_SCRIPTS) $(nodist_bin_SCRIPTS) $(nodist_texmf_SCRIPTS) +SCRIPTS = $(nodist_bin_SCRIPTS) $(nodist_texmf_SCRIPTS) \ + $(texmf_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp am__depfiles_maybe = depfiles @@ -337,8 +338,8 @@ perl_scripts = \ psmerge sh_scripts = \ - $(PSUTILS_TREE)/getafm \ - $(PSUTILS_TREE)/showchar + getafm \ + showchar scriptsdir = texmf/scripts/psutils nodist_bin_SCRIPTS = $(am__append_1) @@ -347,7 +348,10 @@ all_scripts = $(lua_scripts) $(perl_scripts) $(shell_scripts) @WIN32_TRUE@@WIN32_WRAP_TRUE@runscript = $(top_srcdir)/../../texk/texlive/w32_wrapper/runscript.exe texmfdir = $(datarootdir)/$(scriptsdir) nodist_texmf_SCRIPTS = $(perl_scripts:=.pl) -@WIN32_FALSE@bin_SCRIPTS = $(sh_scripts) +texmf_SCRIPTS = \ + $(PSUTILS_TREE)/getafm.sh \ + $(PSUTILS_TREE)/showchar.sh + nodist_man1_MANS = \ $(bin_PROGRAMS:$(EXEEXT)=.1) \ $(perl_scripts:=.1) \ @@ -457,9 +461,9 @@ psselect$(EXEEXT): $(psselect_OBJECTS) $(psselect_DEPENDENCIES) $(EXTRA_psselect pstops$(EXEEXT): $(pstops_OBJECTS) $(pstops_DEPENDENCIES) $(EXTRA_pstops_DEPENDENCIES) @rm -f pstops$(EXEEXT) $(LINK) $(pstops_OBJECTS) $(pstops_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) +install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS) @$(NORMAL_INSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ @@ -486,18 +490,18 @@ install-binSCRIPTS: $(bin_SCRIPTS) } \ ; done -uninstall-binSCRIPTS: +uninstall-nodist_binSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) -install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS) +install-nodist_texmfSCRIPTS: $(nodist_texmf_SCRIPTS) @$(NORMAL_INSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + echo " $(MKDIR_P) '$(DESTDIR)$(texmfdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(texmfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ @@ -516,20 +520,20 @@ install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS) while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(texmfdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texmfdir)$$dir" || exit $$?; \ } \ ; done -uninstall-nodist_binSCRIPTS: +uninstall-nodist_texmfSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) -install-nodist_texmfSCRIPTS: $(nodist_texmf_SCRIPTS) + dir='$(DESTDIR)$(texmfdir)'; $(am__uninstall_files_from_dir) +install-texmfSCRIPTS: $(texmf_SCRIPTS) @$(NORMAL_INSTALL) - @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ + @list='$(texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(texmfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(texmfdir)" || exit 1; \ @@ -556,9 +560,9 @@ install-nodist_texmfSCRIPTS: $(nodist_texmf_SCRIPTS) } \ ; done -uninstall-nodist_texmfSCRIPTS: +uninstall-texmfSCRIPTS: @$(NORMAL_UNINSTALL) - @list='$(nodist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ + @list='$(texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(texmfdir)'; $(am__uninstall_files_from_dir) @@ -1106,7 +1110,7 @@ check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1164,15 +1168,15 @@ info: info-am info-am: -install-data-am: install-man install-nodist_texmfSCRIPTS +install-data-am: install-man install-nodist_texmfSCRIPTS \ + install-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-nodist_binSCRIPTS +install-exec-am: install-binPROGRAMS install-nodist_binSCRIPTS install-html: install-html-am @@ -1213,8 +1217,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man \ - uninstall-nodist_binSCRIPTS uninstall-nodist_texmfSCRIPTS +uninstall-am: uninstall-binPROGRAMS uninstall-man \ + uninstall-nodist_binSCRIPTS uninstall-nodist_texmfSCRIPTS \ + uninstall-texmfSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 @@ -1228,25 +1233,24 @@ uninstall-man: uninstall-man1 distclean distclean-compile distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-data install-data-am \ - install-data-hook install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 \ - install-nodist_binSCRIPTS install-nodist_texmfSCRIPTS \ - install-pdf install-pdf-am install-ps install-ps-am \ - 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-binSCRIPTS uninstall-hook uninstall-man \ - uninstall-man1 uninstall-nodist_binSCRIPTS \ - uninstall-nodist_texmfSCRIPTS + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-nodist_binSCRIPTS \ + install-nodist_texmfSCRIPTS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip install-texmfSCRIPTS \ + 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-hook \ + uninstall-man uninstall-man1 uninstall-nodist_binSCRIPTS \ + uninstall-nodist_texmfSCRIPTS uninstall-texmfSCRIPTS # in case of an SVN repository dist-hook: rm -rf `find $(distdir) -name .svn` -.PHONY: install-lua-links install-perl-links install-shell-links \ +.PHONY: install-lua-links install-perl-links install-shell-links install-sh-links \ install-links uninstall-links @WIN32_TRUE@@WIN32_WRAP_TRUE@$(wrappers): $(runscript) @WIN32_TRUE@@WIN32_WRAP_TRUE@ $(LN_S) $(runscript) $@ @@ -1260,6 +1264,9 @@ install-perl-links: install-shell-links: @WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=shell EXT=sh install-links +install-sh-links: +@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=sh EXT=sh install-links + # We support native builds, multiplatform or not, as well as distro builds. install-links: @REL=`$(SHELL) $(srcdir)/../../build-aux/relpath '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \ @@ -1275,12 +1282,12 @@ install-links: done uninstall-links: -@WIN32_FALSE@ @for f in $(all_scripts); do \ +@WIN32_FALSE@ @for f in $(all_scripts) $(sh_scripts); do \ @WIN32_FALSE@ echo "rm -f '$(DESTDIR)$(bindir)/$$f'"; \ @WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \ @WIN32_FALSE@ done -install-data-hook: install-perl-links +install-data-hook: install-perl-links install-sh-links uninstall-hook: uninstall-links diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog b/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog index 4c1555011c5..3236283e03e 100644 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog +++ b/Build/source/utils/psutils/psutils-1.17-PATCHES/ChangeLog @@ -1,3 +1,8 @@ +2012-08-26 Peter Breitenlohner + + * patch-01-WIN32: Adapt to W32TeX (from Akira Kakuto). + * patch-06-MINGW (removed): Obsolete. + 2012-03-29 Peter Breitenlohner * patch-11-extern (new): Remove extern decls from *.c files. diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes b/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes index 4e4827836d4..19ab64a7cda 100644 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes +++ b/Build/source/utils/psutils/psutils-1.17-PATCHES/TL-Changes @@ -7,6 +7,8 @@ Remove non-free files: Rename: patchlev.h -> patchlev.h.in - getafm.sh -> getafm - showchar.sh -> showchar + +Add execute permissions: + getafm.sh + showchar.sh diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 index fe2f4afab44..056fb4852dc 100644 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 +++ b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-01-WIN32 @@ -1,26 +1,24 @@ diff -ur psutils-1.17.orig/config.h psutils-1.17/config.h --- psutils-1.17.orig/config.h 1997-03-11 23:52:52.000000000 +0100 -+++ psutils-1.17/config.h 2006-01-17 22:16:42.000000000 +0100 -@@ -4,13 +4,16 @@ ++++ psutils-1.17/config.h 2012-08-26 15:44:12.000000000 +0200 +@@ -4,13 +4,13 @@ * OS specific configuration for PSUtils */ -#if defined(MSDOS) || defined(WINNT) +-#define TMPDIR "\\tmp" +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) - #define TMPDIR "\\tmp" ++#define TMPDIR "." #define OPEN_READ "rb" #define OPEN_WRITE "wb" #include #include -#else /* ! MSDOS && ! WINNT */ -+#if defined(WIN32) -+#include -+#endif /* WIN32 */ +#else /* ! MSDOS && ! WINNT && ! WIN32 */ #if defined(OS2) #define TMPDIR "." #define OPEN_READ "rb" -@@ -26,5 +29,5 @@ +@@ -26,5 +26,5 @@ #define TMPDIR "/tmp" #endif /* ! VMS */ #endif /* ! OS2 */ diff --git a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-06-MINGW b/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-06-MINGW deleted file mode 100644 index f44490351db..00000000000 --- a/Build/source/utils/psutils/psutils-1.17-PATCHES/patch-06-MINGW +++ /dev/null @@ -1,15 +0,0 @@ -diff -ur psutils-1.17.orig/config.h psutils-1.17/config.h ---- psutils-1.17.orig/config.h 2006-01-17 22:16:42.000000000 +0100 -+++ psutils-1.17/config.h 2010-02-20 12:23:30.000000000 +0100 -@@ -10,9 +10,9 @@ - #define OPEN_WRITE "wb" - #include - #include --#if defined(WIN32) -+#if defined(WIN32) && !defined(__MINGW32__) - #include --#endif /* WIN32 */ -+#endif /* WIN32 && !__MINGW32__ */ - #else /* ! MSDOS && ! WINNT && ! WIN32 */ - #if defined(OS2) - #define TMPDIR "." diff --git a/Build/source/utils/psutils/psutils-1.17/config.h b/Build/source/utils/psutils/psutils-1.17/config.h index 88af01a9027..5f6b398e055 100644 --- a/Build/source/utils/psutils/psutils-1.17/config.h +++ b/Build/source/utils/psutils/psutils-1.17/config.h @@ -5,14 +5,11 @@ */ #if defined(MSDOS) || defined(WINNT) || defined(WIN32) -#define TMPDIR "\\tmp" +#define TMPDIR "." #define OPEN_READ "rb" #define OPEN_WRITE "wb" #include #include -#if defined(WIN32) && !defined(__MINGW32__) -#include -#endif /* WIN32 && !__MINGW32__ */ #else /* ! MSDOS && ! WINNT && ! WIN32 */ #if defined(OS2) #define TMPDIR "." diff --git a/Build/source/utils/psutils/psutils-1.17/getafm b/Build/source/utils/psutils/psutils-1.17/getafm deleted file mode 100644 index 1c6cd21cf77..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/getafm +++ /dev/null @@ -1,358 +0,0 @@ -#!/bin/sh - -if [ $# -ne 1 ]; then - echo "usage: $0 font-name | gsnd - >font-name.afm" >&2 - exit 1 -fi - -cat << EOF -%! -% produce .afm for $1 -% (c) 1993 by Robert Joop -% inspired by two other versions of this theme which are -% getafm 1.00 (c) AJCD -% and getafm.ps by an unknown author, -% modified by J. Daniel Smith - -% Metrics dictionary code added by AJCD, 7/6/93 - -/getafmdict 100 dict dup begin - - /buf 256 string def - /buf2 16 string def - - /prany % dict dictname printname -> dict - { - 2 index 2 index cvn known - { - print % printname - ( ) print - 1 index exch cvn get = - } - { - (Comment /FontInfo contains no /) print - 2 copy eq - { - = % printname - pop % dictname - } - { - exch - print % dictname - (, therefore no ) print - = % printname - } - ifelse - } - ifelse - } - bind def - - /printfontname - { - (FontName)dup prany - } - bind def - - /printfontinfo - { - dup /FontInfo known - { - dup /FontInfo get - (FullName)dup prany - (FamilyName)dup prany - (Weight)dup prany - (ItalicAngle)dup prany - (isFixedPitch)(IsFixedPitch) prany - (UnderlinePosition)dup prany - (UnderlineThickness)dup prany - (Version)(version) prany - (Notice)dup prany - pop - } - { - (Comment Font lacks a /FontInfo!)= - } - ifelse - } - bind def - - /prbbox % llx lly urx ury -> - - { - 4 1 roll 3 1 roll exch % swap top 4 elements - 4 { ( ) print buf cvs print } repeat - } - bind def - - /getbbox % fontdict chardict character -> fontdict chardict llx lly urx ury - { - gsave - 2 index setfont 0 0 moveto - false charpath flattenpath pathbbox - grestore - } - bind def - - /printmiscinfo - { - dup /FontBBox known - { - (FontBBox) print - dup /FontBBox get aload pop prbbox ()= - } - { - (Comment missing required /FontBBox)= - quit - } - ifelse - 2 copy exch get - dup /H known - 1 index /x known and - 1 index /d known and - 1 index /p known and - dup /looksRoman exch def - { - (CapHeight ) print - (H) getbbox - ceiling cvi = pop pop pop - (XHeight ) print - (x) getbbox - ceiling cvi = pop pop pop - (Ascender ) print - (d) getbbox - ceiling cvi = pop pop pop - (Descender ) print - (p) getbbox - pop pop floor cvi = pop - } - { - (Comment font doesn't contain H, x, d and p; therefore no CapHeight, XHeight, Ascender and Descender)= - } - ifelse - pop - dup /Encoding get - [ - [ (ISOLatin1Encoding) /ISOLatin1Encoding ] - [ (AdobeStandardEncoding) /StandardEncoding ] - ] - { - aload pop dup where - { - exch get 2 index eq - { - (EncodingScheme ) print - buf cvs = - } - { - pop - } - ifelse - } - { - pop pop - } - ifelse - } - forall - pop - } - bind def - - /printcharmetric - { - % chardictname fontdict charnamedict encoding charindex charname - - 4 index dup length dict dup begin exch - { - 1 index /FID ne - 2 index /UniqueID ne - and - { - 1 index /Encoding eq { 256 array copy } if - def - } - { pop pop } - ifelse - } - forall - end - dup /Encoding get 32 3 index put - /f2 exch definefont - setfont - - (C ) print - 1 index buf cvs print - - ( ; WX ) print -% Metrics entries are: -% 1 number: which is the character width -% an array of 2 numbers: which are the left sidebearing and width -% an array of 4 numbers: x & y left sidebearing, width and height - dup 5 index % /charname fontdict - dup /Metrics known { - /Metrics get exch 2 copy known { - get dup type /arraytype eq { - dup length 2 eq - {1 get} {2 get} ifelse - } if - round cvi buf cvs print - } { - pop pop ( ) stringwidth pop round cvi buf cvs print - } ifelse - } { - pop pop ( ) stringwidth pop round cvi buf cvs print - } ifelse - - ( ; N ) print - dup buf cvs print - - ( ; B) print - gsave - newpath 0 0 moveto - ( ) true charpath flattenpath pathbbox - grestore - 2 { ceiling cvi 4 1 roll } repeat - 2 { floor cvi 4 1 roll } repeat - prbbox - - looksRoman - { - [ - [ /f [ /i /f /l ] ] - [ /ff [ /i /l ] ] - ] - { - aload pop 1 index 3 index eq - { - { - 1 index buf cvs - length - 1 index buf2 cvs dup length - 2 index add - buf - 4 2 roll putinterval - buf 0 - 3 -1 roll getinterval - dup cvn - 7 index - exch known - { - exch - ( ; L ) print - buf2 cvs print - ( ) print - print - } - { - pop pop - } - ifelse - } - forall - pop - } - { - pop pop - } - ifelse - } - forall - } - if - pop - - ( ;)= - } - bind def - - /printcharmetrics - { - (StartCharMetrics ) print - 2 copy exch get length 1 sub buf cvs = - - 256 dict dup begin - 1 index /Encoding get - { null def } - forall - end - % chardictname fontdict charnamedict - 1 index /Encoding get - 0 1 255 - { - % encoding index - 2 copy get - dup /.notdef eq { pop } { printcharmetric } ifelse - pop % index - } for - - -1 - 3 index 5 index get - { - pop - dup /.notdef eq - { pop } - { - % chardictname fontdict charnamedict encoding charindex charname - dup 4 index exch known - { pop } - { printcharmetric } - ifelse - } - ifelse - } - forall - % charnamedict encoding index - pop pop pop - - (EndCharMetrics)= - } - bind def - - /printfontmetrics - { - (StartFontMetrics 3.0)= - (Comment Produced by getafm 3.0 (which is by rj@rainbow.in-berlin.de))= - - printfontname - printfontinfo - printmiscinfo - printcharmetrics - - (EndFontMetrics)= - } - bind def - -end def - -/getafm -{ - getafmdict begin - save exch - findfont 1000 scalefont - - null - [ /CharDefs /CharData /CharProcs /CharStrings ] - { - 2 index 1 index known { exch } if - pop - } - forall - dup null eq - { - (can't find dictionary with character data!)= - quit - } - if - exch % dictname fontdict - - printfontmetrics - - pop pop - restore - end -} -bind def - -/$1 getafm - -EOF diff --git a/Build/source/utils/psutils/psutils-1.17/getafm.sh b/Build/source/utils/psutils/psutils-1.17/getafm.sh new file mode 100755 index 00000000000..1c6cd21cf77 --- /dev/null +++ b/Build/source/utils/psutils/psutils-1.17/getafm.sh @@ -0,0 +1,358 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "usage: $0 font-name | gsnd - >font-name.afm" >&2 + exit 1 +fi + +cat << EOF +%! +% produce .afm for $1 +% (c) 1993 by Robert Joop +% inspired by two other versions of this theme which are +% getafm 1.00 (c) AJCD +% and getafm.ps by an unknown author, +% modified by J. Daniel Smith + +% Metrics dictionary code added by AJCD, 7/6/93 + +/getafmdict 100 dict dup begin + + /buf 256 string def + /buf2 16 string def + + /prany % dict dictname printname -> dict + { + 2 index 2 index cvn known + { + print % printname + ( ) print + 1 index exch cvn get = + } + { + (Comment /FontInfo contains no /) print + 2 copy eq + { + = % printname + pop % dictname + } + { + exch + print % dictname + (, therefore no ) print + = % printname + } + ifelse + } + ifelse + } + bind def + + /printfontname + { + (FontName)dup prany + } + bind def + + /printfontinfo + { + dup /FontInfo known + { + dup /FontInfo get + (FullName)dup prany + (FamilyName)dup prany + (Weight)dup prany + (ItalicAngle)dup prany + (isFixedPitch)(IsFixedPitch) prany + (UnderlinePosition)dup prany + (UnderlineThickness)dup prany + (Version)(version) prany + (Notice)dup prany + pop + } + { + (Comment Font lacks a /FontInfo!)= + } + ifelse + } + bind def + + /prbbox % llx lly urx ury -> - + { + 4 1 roll 3 1 roll exch % swap top 4 elements + 4 { ( ) print buf cvs print } repeat + } + bind def + + /getbbox % fontdict chardict character -> fontdict chardict llx lly urx ury + { + gsave + 2 index setfont 0 0 moveto + false charpath flattenpath pathbbox + grestore + } + bind def + + /printmiscinfo + { + dup /FontBBox known + { + (FontBBox) print + dup /FontBBox get aload pop prbbox ()= + } + { + (Comment missing required /FontBBox)= + quit + } + ifelse + 2 copy exch get + dup /H known + 1 index /x known and + 1 index /d known and + 1 index /p known and + dup /looksRoman exch def + { + (CapHeight ) print + (H) getbbox + ceiling cvi = pop pop pop + (XHeight ) print + (x) getbbox + ceiling cvi = pop pop pop + (Ascender ) print + (d) getbbox + ceiling cvi = pop pop pop + (Descender ) print + (p) getbbox + pop pop floor cvi = pop + } + { + (Comment font doesn't contain H, x, d and p; therefore no CapHeight, XHeight, Ascender and Descender)= + } + ifelse + pop + dup /Encoding get + [ + [ (ISOLatin1Encoding) /ISOLatin1Encoding ] + [ (AdobeStandardEncoding) /StandardEncoding ] + ] + { + aload pop dup where + { + exch get 2 index eq + { + (EncodingScheme ) print + buf cvs = + } + { + pop + } + ifelse + } + { + pop pop + } + ifelse + } + forall + pop + } + bind def + + /printcharmetric + { + % chardictname fontdict charnamedict encoding charindex charname + + 4 index dup length dict dup begin exch + { + 1 index /FID ne + 2 index /UniqueID ne + and + { + 1 index /Encoding eq { 256 array copy } if + def + } + { pop pop } + ifelse + } + forall + end + dup /Encoding get 32 3 index put + /f2 exch definefont + setfont + + (C ) print + 1 index buf cvs print + + ( ; WX ) print +% Metrics entries are: +% 1 number: which is the character width +% an array of 2 numbers: which are the left sidebearing and width +% an array of 4 numbers: x & y left sidebearing, width and height + dup 5 index % /charname fontdict + dup /Metrics known { + /Metrics get exch 2 copy known { + get dup type /arraytype eq { + dup length 2 eq + {1 get} {2 get} ifelse + } if + round cvi buf cvs print + } { + pop pop ( ) stringwidth pop round cvi buf cvs print + } ifelse + } { + pop pop ( ) stringwidth pop round cvi buf cvs print + } ifelse + + ( ; N ) print + dup buf cvs print + + ( ; B) print + gsave + newpath 0 0 moveto + ( ) true charpath flattenpath pathbbox + grestore + 2 { ceiling cvi 4 1 roll } repeat + 2 { floor cvi 4 1 roll } repeat + prbbox + + looksRoman + { + [ + [ /f [ /i /f /l ] ] + [ /ff [ /i /l ] ] + ] + { + aload pop 1 index 3 index eq + { + { + 1 index buf cvs + length + 1 index buf2 cvs dup length + 2 index add + buf + 4 2 roll putinterval + buf 0 + 3 -1 roll getinterval + dup cvn + 7 index + exch known + { + exch + ( ; L ) print + buf2 cvs print + ( ) print + print + } + { + pop pop + } + ifelse + } + forall + pop + } + { + pop pop + } + ifelse + } + forall + } + if + pop + + ( ;)= + } + bind def + + /printcharmetrics + { + (StartCharMetrics ) print + 2 copy exch get length 1 sub buf cvs = + + 256 dict dup begin + 1 index /Encoding get + { null def } + forall + end + % chardictname fontdict charnamedict + 1 index /Encoding get + 0 1 255 + { + % encoding index + 2 copy get + dup /.notdef eq { pop } { printcharmetric } ifelse + pop % index + } for + + -1 + 3 index 5 index get + { + pop + dup /.notdef eq + { pop } + { + % chardictname fontdict charnamedict encoding charindex charname + dup 4 index exch known + { pop } + { printcharmetric } + ifelse + } + ifelse + } + forall + % charnamedict encoding index + pop pop pop + + (EndCharMetrics)= + } + bind def + + /printfontmetrics + { + (StartFontMetrics 3.0)= + (Comment Produced by getafm 3.0 (which is by rj@rainbow.in-berlin.de))= + + printfontname + printfontinfo + printmiscinfo + printcharmetrics + + (EndFontMetrics)= + } + bind def + +end def + +/getafm +{ + getafmdict begin + save exch + findfont 1000 scalefont + + null + [ /CharDefs /CharData /CharProcs /CharStrings ] + { + 2 index 1 index known { exch } if + pop + } + forall + dup null eq + { + (can't find dictionary with character data!)= + quit + } + if + exch % dictname fontdict + + printfontmetrics + + pop pop + restore + end +} +bind def + +/$1 getafm + +EOF diff --git a/Build/source/utils/psutils/psutils-1.17/showchar b/Build/source/utils/psutils/psutils-1.17/showchar deleted file mode 100644 index e685e99ae8c..00000000000 --- a/Build/source/utils/psutils/psutils-1.17/showchar +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -# showchar: show character with information -# usage: -# showchar Font-Name Char-Name | lpr -Pprinter - -if [ $# != 2 ]; then - echo "Usage: `basename $0` Font-Name Char-Name" >&2 - exit 1 -fi - -cat <&2 + exit 1 +fi + +cat <