summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lucold/makefd.awk
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/lucold/makefd.awk
Initial commit
Diffstat (limited to 'macros/latex/contrib/lucold/makefd.awk')
-rw-r--r--macros/latex/contrib/lucold/makefd.awk79
1 files changed, 79 insertions, 0 deletions
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;
+ }
+}