diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/lucold |
Initial commit
Diffstat (limited to 'macros/latex/contrib/lucold')
20 files changed, 987 insertions, 0 deletions
diff --git a/macros/latex/contrib/lucold/README b/macros/latex/contrib/lucold/README new file mode 100644 index 0000000000..42e25ba4fd --- /dev/null +++ b/macros/latex/contrib/lucold/README @@ -0,0 +1,235 @@ +This is a package to automatically use old-style digits with the +Lucida fonts; process the file "note.tex" to obtain the +documentation. Included are: + +- a style file; +- shell command procedures and awk programs to automatically generate + .fd, .tfm and .vf files from the original ones; +- the generated .fd, .tfm and .vf files; +- a small test program, "test.tex". + +This package 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. The text of GNU GPL version 2 follows: + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/macros/latex/contrib/lucold/hlob7t.tfm b/macros/latex/contrib/lucold/hlob7t.tfm Binary files differnew file mode 100644 index 0000000000..02af82cbbd --- /dev/null +++ b/macros/latex/contrib/lucold/hlob7t.tfm diff --git a/macros/latex/contrib/lucold/hlob7t.vf b/macros/latex/contrib/lucold/hlob7t.vf Binary files differnew file mode 100644 index 0000000000..decb4e918b --- /dev/null +++ b/macros/latex/contrib/lucold/hlob7t.vf diff --git a/macros/latex/contrib/lucold/hlob8t.tfm b/macros/latex/contrib/lucold/hlob8t.tfm Binary files differnew file mode 100644 index 0000000000..b58e24110a --- /dev/null +++ b/macros/latex/contrib/lucold/hlob8t.tfm diff --git a/macros/latex/contrib/lucold/hlob8t.vf b/macros/latex/contrib/lucold/hlob8t.vf Binary files differnew file mode 100644 index 0000000000..f7cb77ea8a --- /dev/null +++ b/macros/latex/contrib/lucold/hlob8t.vf diff --git a/macros/latex/contrib/lucold/hlor7t.tfm b/macros/latex/contrib/lucold/hlor7t.tfm Binary files differnew file mode 100644 index 0000000000..0c7bb5579c --- /dev/null +++ b/macros/latex/contrib/lucold/hlor7t.tfm diff --git a/macros/latex/contrib/lucold/hlor7t.vf b/macros/latex/contrib/lucold/hlor7t.vf Binary files differnew file mode 100644 index 0000000000..53e57fc86a --- /dev/null +++ b/macros/latex/contrib/lucold/hlor7t.vf diff --git a/macros/latex/contrib/lucold/hlor8t.tfm b/macros/latex/contrib/lucold/hlor8t.tfm Binary files differnew file mode 100644 index 0000000000..7e0a7906ae --- /dev/null +++ b/macros/latex/contrib/lucold/hlor8t.tfm diff --git a/macros/latex/contrib/lucold/hlor8t.vf b/macros/latex/contrib/lucold/hlor8t.vf Binary files differnew file mode 100644 index 0000000000..a87c018b6a --- /dev/null +++ b/macros/latex/contrib/lucold/hlor8t.vf diff --git a/macros/latex/contrib/lucold/lucold.sty b/macros/latex/contrib/lucold/lucold.sty new file mode 100644 index 0000000000..1426b8cbe4 --- /dev/null +++ b/macros/latex/contrib/lucold/lucold.sty @@ -0,0 +1,62 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{lucold}[1999/05/25 Old-Style Digits for Lucida fonts] + +% Author: Maurizio Loreti, aka MLO or (HAM) I3NOO +% Work: University of Padova - Department of Physics +% Via F. Marzolo, 8 - 35131 PADOVA - Italy +% Phone: +39 (049) 827-7216 FAX: +39 (049) 827-7102 +% EMail: loreti@padova.infn.it +% WWW: http://wwwcdf.pd.infn.it/~loreti/mlo.html +% +% $Id: lucold.sty,v 1.1 1999/05/25 12:16:26 loreti Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Options for \usepackage{lucold} : +% +% text (notext) : switch (do not switch) all text numerals to +% old-style digits; +% math (nomath) : switch (do not switch) all math numerals +% to old-style digits. +% +% The default: \usepackage{lucold} is equivalent to +% \usepackage[text,nomath]{lucold} . +% +% Since I think that it has no sense to require old-style +% digits in math and not in text, with [notext,math] a +% warning is printed and the setup is changed to [text,math]. + +\newif\ifluc@ldtext +\newif\ifluc@ldmath + +\DeclareOption{text}{\luc@ldtexttrue} +\DeclareOption{notext}{\luc@ldtextfalse} +\DeclareOption{math}{\luc@ldmathtrue} +\DeclareOption{nomath}{\luc@ldmathfalse} + +\ExecuteOptions{text,nomath} +\ProcessOptions + +\ifluc@ldmath +\ifluc@ldtext\relax\else% + \luc@ldtexttrue\PackageWarningNoLine{lucold}{Old style + digits in math and not in text? Ugh!\MessageBreak + Also the `text' option has been set}\fi + +\DeclareMathSymbol{0}{\mathalpha}{letters}{'060} +\DeclareMathSymbol{1}{\mathalpha}{letters}{'061} +\DeclareMathSymbol{2}{\mathalpha}{letters}{'062} +\DeclareMathSymbol{3}{\mathalpha}{letters}{'063} +\DeclareMathSymbol{4}{\mathalpha}{letters}{'064} +\DeclareMathSymbol{5}{\mathalpha}{letters}{'065} +\DeclareMathSymbol{6}{\mathalpha}{letters}{'066} +\DeclareMathSymbol{7}{\mathalpha}{letters}{'067} +\DeclareMathSymbol{8}{\mathalpha}{letters}{'070} +\DeclareMathSymbol{9}{\mathalpha}{letters}{'071} +\fi + +\ifluc@ldtext +\renewcommand{\rmdefault}{hlos} +\fi + +\endinput diff --git a/macros/latex/contrib/lucold/makefd b/macros/latex/contrib/lucold/makefd new file mode 100644 index 0000000000..b9dc1834dc --- /dev/null +++ b/macros/latex/contrib/lucold/makefd @@ -0,0 +1,12 @@ +#! /bin/bash + +# $Id: makefd,v 1.1 1999/05/25 12:16:26 loreti Exp $ + +cp $TETEXDIR/texmf/tex/latex/lucidabr/*t1hlh.fd . + +for infile in *.fd + do outfile="${infile%h.fd}os.fd" + awk >$outfile -f makefd.awk -v infile=$infile +done + +rm *t1hlh.fd diff --git a/macros/latex/contrib/lucold/makefd.awk b/macros/latex/contrib/lucold/makefd.awk new file mode 100644 index 0000000000..ccfbbc3792 --- /dev/null +++ b/macros/latex/contrib/lucold/makefd.awk @@ -0,0 +1,79 @@ +# File: makefd.awk +# $Id: makefd.awk,v 1.1 1999/05/25 12:16:26 loreti Exp $ +# +# Author: Maurizio Loreti, aka MLO or (HAM) I3NOO +# Work: University of Padova - Department of Physics +# Via F. Marzolo, 8 - 35131 PADOVA - Italy +# Phone: +39 (049) 827-7216 FAX: +39 (049) 827-7102 +# EMail: loreti@padova.infn.it +# WWW: http://wwwcdf.pd.infn.it/~loreti/mlo.html + +BEGIN { + FS="[{ ]"; + OFS="{"; + + # Converts the input file name to the output file name; + # e.g. t1hlh.fd --> t1hlos.fd . + + out = tolower(infile); + sub("hlh", "hlos", out); + + while (getline <infile >0) { + if ($1 == "%Filename:") { + + # The first record: just a comment with the file name. + + print "%Filename: " out; + continue; + } else if ($1 == "%Created") { + + # Second and third records: comments, skipped. + + continue; + } else if ($1 == "\\ProvidesFile") { + + # The original (splitted in two lines) \ProvidesFile command + # is converted to an hard-wired one-line equivalent. + + print "\\ProvidesFile{" out "}[Lucida Bright with Old Style numerals]"; + if (getline <infile >0) { + continue; + } else { + print >/dev/stderr "Corrupted file, " infile; + exit; + } + } else if ($1 == "\\DeclareFontFamily") { + + # The \DeclareFontFamily command: just convert "hlh" --> "hlos". + + $3 = "hlos}"; + } else if ($1 == "\\DeclareLucidaFontShape") { + + # In the \DeclareLucidaFontShape commands, in addition to the + # conversion "hlh" --> "hlos", we must change the file name --- + # but only for the upright shapes ("n"). I think it has no sense + # a conversion for italic or smallcaps numerals to Old Style ... + + $3 = "hlos}"; + flag = ($5 == "n}"); + print; + if (getline <infile >0) { + if (flag) sub("hlh", "hlo"); + } else { + print >/dev/stderr "Corrupted file, " infile; + exit; + } + } else if ($1 == "\\DeclareFontShape") { + + # \DeclareFontShape: "hlh" --> "hlos"; hlh/b/n and hlh/bx/n are + # mapped to hlos/b/n and hlos/bx/n . + + if ($5 == "n}" && ($4 == "b}" || $4 == "bx}")) { + gsub("hlh", "hlos"); + } else { + sub("hlh", "hlos"); + } + } + print; + } +} diff --git a/macros/latex/contrib/lucold/maketfm b/macros/latex/contrib/lucold/maketfm new file mode 100644 index 0000000000..2c4da27ea3 --- /dev/null +++ b/macros/latex/contrib/lucold/maketfm @@ -0,0 +1,26 @@ +#! /bin/bash + +# $Id: maketfm,v 1.1 1999/05/25 12:16:26 loreti Exp $ + +cp $TETEXDIR/texmf/fonts/tfm/bh/lubright/hlh??t.tfm . +cp $TETEXDIR/texmf/fonts/tfm/bh/lumath/hlc?im*.tfm . + +for file in *.tfm + do tftopl $file ${file%tfm}pl +done + +awk >hlor7t.pl -f maketfm.awk \ + -v infile1=hlhr7t.pl -v infile2=hlcrima.pl +awk >hlob7t.pl -f maketfm.awk \ + -v infile1=hlhb7t.pl -v infile2=hlcdima.pl +awk >hlor8t.pl -f maketfm.awk \ + -v infile1=hlhr8t.pl -v infile2=hlcrima.pl +awk >hlob8t.pl -f maketfm.awk \ + -v infile1=hlhb8t.pl -v infile2=hlcdima.pl + +pltotf hlor7t.pl hlor7t.tfm +pltotf hlob7t.pl hlob7t.tfm +pltotf hlor8t.pl hlor8t.tfm +pltotf hlob8t.pl hlob8t.tfm + +rm hl???t.pl hlc?im*.tfm diff --git a/macros/latex/contrib/lucold/maketfm.awk b/macros/latex/contrib/lucold/maketfm.awk new file mode 100644 index 0000000000..a02d5d68f6 --- /dev/null +++ b/macros/latex/contrib/lucold/maketfm.awk @@ -0,0 +1,40 @@ +# File: maketfm.awk +# $Id: maketfm.awk,v 1.1 1999/05/25 12:16:26 loreti Exp $ +# +# Author: Maurizio Loreti, aka MLO or (HAM) I3NOO +# Work: University of Padova - Department of Physics +# Via F. Marzolo, 8 - 35131 PADOVA - Italy +# Phone: +39 (049) 827-7216 FAX: +39 (049) 827-7102 +# EMail: loreti@padova.infn.it +# WWW: http://wwwcdf.pd.infn.it/~loreti/mlo.html +# +######################################################################### +# +# This awk procedure relies on the sequence (CHARACTER C 0 ...) ... +# (CHARACTER C 9 ...) being contiguous, and immediately followed by +# (CHARACTER O 72 ...) in every .pl file. It just reads from "infile1" +# until (CHARACTER C 0 ...), inserts the sequence (CHARACTER C 0 ...) ... +# (CHARACTER C 9 ...) from "infile2", then what follows starting from +# (CHARACTER O 72 ...) still from "infile1". + +BEGIN { + out = 1; + + while (getline <infile1 >0) { + if ($1 == "(CHARACTER" && $2 == "O" && $3 == "72") out = 1; + if ($1 == "(CHARACTER" && $2 == "C" && $3 == "0") { + out = 0; + while (getline <infile2 >0) { + if ($1 == "(CHARACTER" && $2 == "C" && $3 == "0") out = 1; + if ($1 == "(CHARACTER" && $2 == "O" && $3 == "72") { + close(infile2); + out = 0; + break; + } + if (out) print; + } + } + if (out) print; + } + close(infile1); +} diff --git a/macros/latex/contrib/lucold/makevf b/macros/latex/contrib/lucold/makevf new file mode 100644 index 0000000000..6b40e0a49b --- /dev/null +++ b/macros/latex/contrib/lucold/makevf @@ -0,0 +1,42 @@ +#! /bin/bash + +# $Id: makevf,v 1.1 1999/05/25 12:16:26 loreti Exp $ + +cp $TETEXDIR/texmf/fonts/vf/bh/lubright/hlh??t.vf . + +for file in hlh??t.vf + do base="${file%vf}" + vftovp ${base}vf ${base}tfm ${base}vpl +done + +to="hlor7t"; from="hlhr7t.vpl"; mft="hlcrima" +ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" +awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl +awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck +vptovf ${to}.vpl ${to}.vf ${to}.tfm +rm tmp + +to="hlob7t"; from="hlhb7t.vpl"; mft="hlcdima" +ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" +awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl +awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck +vptovf ${to}.vpl ${to}.vf ${to}.tfm +rm tmp + +to="hlor8t"; from="hlhr8t.vpl"; mft="hlcrima" +ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" +awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl +awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck +vptovf ${to}.vpl ${to}.vf ${to}.tfm +rm tmp + +to="hlob8t"; from="hlhb8t.vpl"; mft="hlcdima" +ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" +awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl +awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck +vptovf ${to}.vpl ${to}.vf ${to}.tfm +rm tmp *.pl *.vpl hlh*.tfm hlh*.vf diff --git a/macros/latex/contrib/lucold/makevf.awk b/macros/latex/contrib/lucold/makevf.awk new file mode 100644 index 0000000000..9ad3ab8ed5 --- /dev/null +++ b/macros/latex/contrib/lucold/makevf.awk @@ -0,0 +1,71 @@ +# File: maketfm.awk +# $Id: makevf.awk,v 1.1 1999/05/25 12:16:26 loreti Exp $ +# +# Author: Maurizio Loreti, aka MLO or (HAM) I3NOO +# Work: University of Padova - Department of Physics +# Via F. Marzolo, 8 - 35131 PADOVA - Italy +# Phone: +39 (049) 827-7216 FAX: +39 (049) 827-7102 +# EMail: loreti@padova.infn.it +# WWW: http://wwwcdf.pd.infn.it/~loreti/mlo.html +# +######################################################################### +# +# This awk procedure relies on the sequence (CHARACTER C 0 ...) ... +# (CHARACTER C 9 ...) being contiguous and immediately followed by +# (CHARACTER O 72 ...) in every .vpl file. This GNU-awk program +# copies the .vpl file "infile" to stdout, remapping the numerical +# characters to another font: namely the file "mft" with checksum +# "ck". + +BEGIN { + numbers = "0123456789"; + + while (getline <infile >0) { + if ($1 == "(VTITLE") { + print "(VTITLE )"; + } else if ($1 == "(LIGTABLE") { + + # Insert MAPFONT 1 before LIGTABLE (and after MAPFONT 0) + + print "(MAPFONT D 1"; + print " (FONTNAME " mft ")"; + print " (FONTCHECKSUM O " ck ")"; + print " (FONTAT R 1.0)"; + print " (FONTDSIZE R 10.0)"; + print " )"; + print; + } else if ($1 == "(CHARACTER" && + $2 == "C" && + index(numbers, $3) != 0) { + + # Switch all numerical characters to MAPFONT 1: skips to the + # closing parenthesis of the record, and insert an appropriate + # couple of SELECTFONT/SETCHAR statements before. The input + # has been processed from "maketfm.awk", and all the mapping + # information is missing (only for these characters). + + paren = 0; + save3 = $3; + while (1) { + for (i=1; i<=length(); i++) { + c = substr($0, i, 1); + if (c == "(") paren++; + if (c == ")") paren--; + } + if (paren == 0) break; + print; + if (getline <infile <=0) { + print >/dev/stderr "Corrupted file, " infile; + exit; + } + } + print " (MAP"; + print " (SELECTFONT D 1)"; + print " (SETCHAR C " save3 ")"; + print " )"; + print; + } else { + print; + } + } +} diff --git a/macros/latex/contrib/lucold/note.tex b/macros/latex/contrib/lucold/note.tex new file mode 100644 index 0000000000..d04538a15e --- /dev/null +++ b/macros/latex/contrib/lucold/note.tex @@ -0,0 +1,304 @@ +% $Id: note.tex,v 1.2 1999/06/10 05:51:53 loreti Exp $ + +\documentclass[a4paper]{article} +\usepackage{verbatim} + +\newdimen\boxfigwidth +\newenvironment{bigbox} +{\begingroup\boxfigwidth=\hsize% + \advance\boxfigwidth by -2\fboxrule% + \advance\boxfigwidth by -2\fboxsep% + \setbox4=\vbox\bgroup\hsize\boxfigwidth% + \hrule height0pt width\boxfigwidth\par\bigskip% + \linewidth=\boxfigwidth% +}{\smallskip\egroup\fbox{\box4}\endgroup} + +\makeatletter +\renewcommand{\fnum@figure}{\textsc{\figurename~\thefigure}} +\renewcommand{\section}{\@startsection {section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\normalfont\Large\sffamily\bfseries}} +\makeatother + +\begin{document} +\title{\scshape How to use ``Old-Style Digits''\\ + with the Lucida fonts} +\author{\textsc{Maurizio Loreti}\thanks{ + EMail: \texttt{loreti@pd.infn.it}}} +\date{Rev.\ 1.2\quad--\quad 1999-06-10} +\maketitle +\noindent As a system administrator and local \TeX pert, I +have been asked by an user to build a style file to +automagically switch all the occurrences of a digit in the +printed text to the so-called \emph{old-style digits}. + +Although I do not share the aesthetic preferences of this +user, I have solved the problem satisfactorily; the main +difficulty has been to understand how to define a +\emph{virtual font}, because guidelines and examples were +difficult to find. +Here follows a short description of what I have done, hoping +that other people wishing to define a virtual font will find +it useful; I want to excuse myself for my bad english, and +to thank Mr.\ Allin Cottrell, whose examples for Computer +Modern have been an important starting point\/\footnote{They + may be found under his web page in + \texttt{http://www.wfu.edu/\textasciitilde cottrell}.}. + +A couple of notes: the old-style digits are in the +LucidaNewMath-AltItalic font (normal weight) and in the +LucidaNewMath-AltDemiItalic font (DemiBold weight); the +latter is in the ``Lucida Expert'' font package, that is +\emph{required} in order to obtain \emph{bold} old-style +digits. + +All the \verb|.fd|, \verb|.tfm| and \verb|.vf| auxilliary +files are built with Unix command procedures for the +\verb|bash| shell, freely available from the Free Software +Foundation\/\footnote{By anonymous ftp from + \texttt{prep.ai.mit.edu} (and its mirrors) in + \texttt{/pub/gnu}; download \texttt{/pub/gnu/GNUinfo/FTP} + for a list of the mirror sites.}; the only used features +missing from the usual Bourne shell environment +(\verb|/bin/sh|) are: +\begin{itemize} +\item The parameter expansion commands like + \texttt{\$\{par\%word\}} and \texttt{\$\{par\#word\}}: + they first expand ``word'' to a pattern, and then remove + from the end (the former) or from the beginning (the + latter) of the expansion of the environment variable + ``par'' the substring matching that pattern (in a Bourne + shell environment they may be easily simulated with + \verb|sed| pipes). +\item The command substitution syntax: \verb|$(command)| is + the \verb|bash| equivalent of the Bourne shell construct + \verb|`command`|. +\end{itemize} + +All the file manipulation is done with \verb|awk| programs; +in our installation, the \verb|GNU| version of \verb|awk| +comes first in the path: but the \verb|GNU| extensions to +the language are not used, and any \verb|awk| flavour should +understand these programs. + +\section{The style file} +\verb|lucold.sty| is the style file; it has two options, +\verb|text| (or \verb|notext|) and \verb|math| (or +\verb|nomath|), to select (or, respectively, deselect) +old-style digits in the text mode and in the math mode. +The default options are \verb|[text,nomath]|; when +\verb|notext| and \verb|math| are both explicitely selected, +a warning is printed and \verb|notext| changed to +\verb|text|: since having old-style digits in the +mathematics and not in the text has poor meaning (in my +opinion, of course). + +\verb|lucold.sty| is straightforward, being just a wrapper +around the single command that remaps the text default font +family to \verb|hlos| (in the current encoding), and the +additional commands that remap the math-mode digits to the +text font; the style file for Lucida, \verb|lucidabr.sty|, +normally uses \verb|hlh| as default text font family. + +\section{The font definition files} +The second step is the creation of the \verb|.fd| files for +\verb|hlos| in the needed encodings; the \verb|OT1| (or +Knuth) encoding is the default, but here in Italy we mainly +use the \verb|T1| (or Cork) encoding. + +\begin{figure}[htbp] + \begin{bigbox} +\begin{verbatim} + #! /bin/bash + + cp $TETEXDIR/texmf/tex/latex/lucidabr/*t1hlh.fd . + + for infile in *.fd + do outfile="${infile%h.fd}os.fd" + awk >$outfile -f makefd.awk -v infile=$infile + done + + rm *t1hlh.fd +\end{verbatim} + \end{bigbox} + \caption{the \texttt{makefd} shell procedure.} + \label{fig:fd} +\end{figure} + +The two font definition files \verb|ot1hlos.fd| and +\verb|t1hlos.fd| are easily obtained using +\verb|[o]t1hlh.fd| as a template; the shell procedure in +figure \ref{fig:fd} does exactly that. +The \verb|awk| program \verb|makefd.awk| remaps all the +upright fonts of the \verb|hlos| family to a new set of +(virtual) fonts, called +\begin{center} + \begin{tabular}{|c|c||c|c|} + \hline + & & New & Original \\ + Encoding & Weight & Font & Font \\ + \hline \hline + \verb|OT1| & Normal & \verb|hlor7t| & \verb|hlhr7t| \\ + \verb|OT1| & Bold & \verb|hlob7t| & \verb|hlhb7t| \\ + \verb|T1| & Normal & \verb|hlor8t| & \verb|hlhr8t| \\ + \verb|T1| & Bold & \verb|hlob8t| & \verb|hlhb8t| \\ + \hline + \end{tabular} +\end{center} +using as a template the input file given as a parameter in +the \verb|-v| command option. +All the other variants (italic, slanted, \ldots) of the +\verb|hlos| family are left mapped to the same fonts used in +the original \verb|.fd| files. + +\section{The \TeX\ font metric files} +The third step is the creation of the \verb|.tfm| files: +essentially, the shell procedure of figure \ref{fig:tfm} +copies some of the metric files of the original fonts of the +\verb|hlh| family to the current directory; then converts +them to an human-readable form (\verb|.pl| files) using +\verb|tftopl|; then, using \verb|maketfm.awk|, substitutes +the section describing the digits with the corresponding +section taken from the \verb|.tfm| files of the fonts with +the old-style digits, i.e.\ \verb|hlcrima| (normal weight) +and \verb|hlcdima| (boldface). + +\begin{figure}[htbp] + \begin{bigbox} +\begin{verbatim} + #! /bin/bash + + cp $TETEXDIR/texmf/fonts/tfm/bh/lubright/hlh??t.tfm . + cp $TETEXDIR/texmf/fonts/tfm/bh/lumath/hlc?im*.tfm . + + for file in *.tfm + do tftopl $file ${file%tfm}pl + done + + awk >hlor7t.pl -f maketfm.awk \ + -v infile1=hlhr7t.pl -v infile2=hlcrima.pl + awk >hlob7t.pl -f maketfm.awk \ + -v infile1=hlhb7t.pl -v infile2=hlcdima.pl + awk >hlor8t.pl -f maketfm.awk \ + -v infile1=hlhr8t.pl -v infile2=hlcrima.pl + awk >hlob8t.pl -f maketfm.awk \ + -v infile1=hlhb8t.pl -v infile2=hlcdima.pl + + pltotf hlor7t.pl hlor7t.tfm + pltotf hlob7t.pl hlob7t.tfm + pltotf hlor8t.pl hlor8t.tfm + pltotf hlob8t.pl hlob8t.tfm + + rm hl???t.pl hlc?im*.tfm +\end{verbatim} + \end{bigbox} + \caption{the \texttt{maketfm} shell procedure.} + \label{fig:tfm} +\end{figure} + +Next, the merged \verb|.pl| files are converted to binary +\verb|.tfm| files with \verb|pltotf|; and, finally, the few +files that are no more needed are removed. + +\section{The virtual font files} +\begin{figure}[htbp] + \begin{bigbox} +\begin{verbatim} + #! /bin/bash + + cp $TETEXDIR/texmf/fonts/vf/bh/lubright/hlh??t.vf . + + for file in hlh??t.vf + do base="${file%vf}" + vftovp ${base}vf ${base}tfm ${base}vpl + done + + to="hlor7t"; from="hlhr7t.vpl"; mft="hlcrima" + ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" + awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl + awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck + vptovf ${to}.vpl ${to}.vf ${to}.tfm + rm tmp + + to="hlob7t"; from="hlhb7t.vpl"; mft="hlcdima" + ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" + awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl + awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck + vptovf ${to}.vpl ${to}.vf ${to}.tfm + rm tmp + + to="hlor8t"; from="hlhr8t.vpl"; mft="hlcrima" + ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" + awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl + awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck + vptovf ${to}.vpl ${to}.vf ${to}.tfm + rm tmp + + to="hlob8t"; from="hlhb8t.vpl"; mft="hlcdima" + ck="$(grep CHECKSUM ${mft}.pl | cut -d" " -f3 | sed 's/)//')" + awk >tmp -f maketfm.awk -v infile1=$from -v infile2=${mft}.pl + awk >${to}.vpl -f makevf.awk -v infile=tmp \ + -v mft=$mft -v ck=$ck + vptovf ${to}.vpl ${to}.vf ${to}.tfm + rm tmp *.pl *.vpl hlh*.tfm hlh*.vf +\end{verbatim} + \end{bigbox} + \caption{the \texttt{makevf} shell procedure.} + \label{fig:vf} +\end{figure} + +The last step is the generation of the \verb|.vf| files; +their human-readable form (the \verb|.vpl| files) are +essentially \verb|.pl| files, with the addition of some +sections: a \verb|VTITLE|, one or more \verb|MAPFONT| records +describing the real fonts, and a \verb|MAP| entry in the +record of every character describing how to obtain it from +a real font. +In the figure \ref{fig:vf}, the shell procedure that +builds the \verb|.vf| files is listed; it performs the +following steps: +\begin{itemize} +\item The \verb|.vf| files for the original fonts are copied + to the current directory, and converted to \verb|.vpl| + files using \verb|vftovp|; +\item The checksum of the \verb|.tfm| file from which the + old-style digits are taken is extracted from the + corresponding \verb|.pl| file, and stored in the \verb|ck| + environment variable; +\item The program \verb|maketfm.awk| is executed, to + substitute the section of every \verb|.vpl| file + describing digits with the corresponding section for the + old-style digits (taken from the relevant \verb|.pl| + file): note that in that step the \verb|MAP| entry for + every digit is lost; +\item The program \verb|makevf.awk|, that adds + to the \verb|.vpl| file a valid \verb|MAPFONT| record and + valid \verb|MAP| entries for every digit, is executed; +\item The \verb|.vpl| files are converted to binary using + \verb|vptovf|, and a final cleanup is performed. +\end{itemize} + +What is left is simply to move the \verb|*.sty|, +\verb|*.fd|, \verb|*.tfm| and \verb|*.vf| files to the right +directory of the \TeX\ tree. + +\section{History and Copyright} +The first version of this package (1.0) has been updated +because the font names in the default Lucida files +distributed with the \LaTeX\ PSNFSS package have changed; +the second version (1.1) stated in an improper way the +license conditions. + +This package is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public +License (GPL) as published by the Free Software Foundation; +either version 2, or (at your option) any later version. The +text of the GNU GPL\footnote{Version 2, June 1991. + Copyright \copyright\ 1989--1991 Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, + USA.} is included in the file README of this distribution. +\end{document} diff --git a/macros/latex/contrib/lucold/ot1hlos.fd b/macros/latex/contrib/lucold/ot1hlos.fd new file mode 100644 index 0000000000..b6ecb79b7a --- /dev/null +++ b/macros/latex/contrib/lucold/ot1hlos.fd @@ -0,0 +1,51 @@ +%Filename: ot1hlos.fd + +%THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY + +\ProvidesFile{ot1hlos.fd}[Lucida Bright with Old Style numerals] + +\@ifundefined{DeclareLucidaFontShape}{% +\def\DeclareLucidaFontShape#1#2#3#4#5#6{% +\DeclareFontShape{#1}{#2}{#3}{#4}{<->#5}{#6}}}{} +\DeclareFontFamily{OT1}{hlos}{} + +\DeclareLucidaFontShape{OT1}{hlos}{m}{n}{ +hlor7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{m}{sc}{ +hlhrc7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{m}{sl}{ +hlhro7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{m}{it}{ +hlhri7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{b}{n}{ +hlob7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{b}{sc}{ +hlhbc7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{b}{sl}{ +hlhbo7t +}{} + +\DeclareLucidaFontShape{OT1}{hlos}{b}{it}{ +hlhbi7t +}{} + +\DeclareFontShape{OT1}{hlos}{bx}{n}{<->ssub * hlos/b/n}{} +\DeclareFontShape{OT1}{hlos}{bx}{sc}{<->ssub * hlh/b/sc}{} +\DeclareFontShape{OT1}{hlos}{bx}{sl}{<->ssub * hlh/b/sl}{} +\DeclareFontShape{OT1}{hlos}{bx}{it}{<->ssub * hlh/b/it}{} + +\DeclareFontShape{OT1}{hlos}{m}{ui}{<->ssub * hlh/m/it}{} +\DeclareFontShape{OT1}{hlos}{b}{ui}{<->ssub * hlh/b/it}{} +\endinput diff --git a/macros/latex/contrib/lucold/t1hlos.fd b/macros/latex/contrib/lucold/t1hlos.fd new file mode 100644 index 0000000000..621748875b --- /dev/null +++ b/macros/latex/contrib/lucold/t1hlos.fd @@ -0,0 +1,49 @@ +%Filename: t1hlos.fd + +%THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY + +\ProvidesFile{t1hlos.fd}[Lucida Bright with Old Style numerals] + +\@ifundefined{DeclareLucidaFontShape}{% +\def\DeclareLucidaFontShape#1#2#3#4#5#6{% +\DeclareFontShape{#1}{#2}{#3}{#4}{<->#5}{#6}}}{} +\DeclareFontFamily{T1}{hlos}{} + +\DeclareLucidaFontShape{T1}{hlos}{m}{n}{ +hlor8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{m}{sc}{ +hlhrc8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{m}{sl}{ +hlhro8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{m}{it}{ +hlhri8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{b}{n}{ +hlob8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{b}{sc}{ +hlhbc8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{b}{sl}{ +hlhbo8t +}{} + +\DeclareLucidaFontShape{T1}{hlos}{b}{it}{ +hlhbi8t +}{} + +\DeclareFontShape{T1}{hlos}{bx}{n}{<->ssub * hlos/b/n}{} +\DeclareFontShape{T1}{hlos}{bx}{sc}{<->ssub * hlh/b/sc}{} +\DeclareFontShape{T1}{hlos}{bx}{sl}{<->ssub * hlh/b/sl}{} +\DeclareFontShape{T1}{hlos}{bx}{it}{<->ssub * hlh/b/it}{} + +\endinput diff --git a/macros/latex/contrib/lucold/test.tex b/macros/latex/contrib/lucold/test.tex new file mode 100644 index 0000000000..c128cab337 --- /dev/null +++ b/macros/latex/contrib/lucold/test.tex @@ -0,0 +1,16 @@ +% $Id: test.tex,v 1.1 1999/05/25 12:16:26 loreti Exp $ + +\documentclass{article} +\usepackage[OT1]{fontenc} +\usepackage[expert]{lucidabr} +\usepackage[text,nomath]{lucold} + +\setcounter{page}{123} + +\begin{document} +\noindent +Testing normal text: 1234567890; normal math: $z = 1234567890$. +\par\vspace{1cm}\noindent +Testing bold text: \textbf{1234567890}; bold math: +{\boldmath $z = 1234567890$}. +\end{document} |