commit 7f69e630cddbb54764c45278c6291f6590e5bfb1
parent 3c1a68e9e2a87847edd48345bb1bd16b85cd9394
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Sat, 26 Nov 2022 11:54:04 -0800
Create scratch pad for final font system
Diffstat:
| D | font.tex | | | 14 | -------------- |
| A | fontideas.tex | | | 123 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 123 insertions(+), 14 deletions(-)
diff --git a/font.tex b/font.tex
@@ -1,14 +0,0 @@
-\Fhsize \Ftsize \Fssize \Fzsize
-
-\newtoks\icomit \icomit={\\{.}\\{,}}
-
-An "H font set" is a list of optical sizes of the same font; each font in the
-list has an associated scale factor (times 1000) and arbitrary token list for
-initializing the font (e.g., skewchar, hyphenchar, fontdimens, etc.).
-We provide macros for deriving new font sets by scaling or adding code to the
-token list of existing font sets.
-An "M font set" is a tuple of three H font sets.
-(H = horizontal, M = math; we could call H fonts "text fonts", but that is too
-easily confusable with \textfont.)
-
-\protected\def\rm{\rminit \rmtext \rmmath}
diff --git a/fontideas.tex b/fontideas.tex
@@ -0,0 +1,123 @@
+\Fhsize \Ftsize \Fssize \Fzsize
+
+% \italcorr is like primitive \/, except it works with arbitrary intervening
+% glues, kerns, and penalties.
+% TODO: peek inside hboxes to insert italic correction
+\newbox\@icsave
+\def\italcorr{%
+ \ifvmode \errmessage{You can't use `\string\italcorr' in vertical mode}\fi
+ \setbox\@icsave=\hbox{}%
+ % while lastnodetype == glue|kern|penalty, save node in box
+ \loop\if1\ifcase\numexpr\lastnodetype-11\relax
+ 1% glue
+ \skipA=\lastskip \unskip
+ \setbox\@icsave=\hbox{\hskip\skipA \unhbox\@icsave}%
+ \or 1% kern
+ \dimenA=\lastkern \unkern
+ \setbox\@icsave=\hbox{\kern\dimenA \unhbox\@icsave}%
+ \or 1% penalty
+ \countA=\lastpenalty \unpenalty
+ \setbox\@icsave=\hbox{\penalty\countA \unhbox\@icsave}%
+ \else 0% other
+ \fi
+ \repeat
+ \/\unhbox\@icsave
+}
+
+\newtoks\icblacklist \icblacklist={\\.\\,}
+\newif\if@ic
+\def\tryitalcorr{\ifvmode \else \ea\@tryitalcorrA \fi}
+\def\@tryitalcorrA{\futurelet\@next\@tryitalcorrB}
+\def\@tryitalcorrB{%
+ \@ictrue
+ \def\\##1{\if##1\@next \@icfalse \fi}%
+ \the\icblacklist
+ \if@ic \italcorr \fi
+}
+
+\newcount\Fscale
+\def\@gobblesemi#1;{}
+\def\\#1:#2 {%
+ \afterassignment\@gobblesemi \dimenA=#1pt;%
+ \ifdim\size<\dimenA
+ \font\f=#2
+ \def\\#1:#2 {}
+ \fi
+}
+
+\def\bold{\fmix\bf}
+\def\ftoggle#1{}
+\def\fmix#1{}
+\def\stydef#1{%
+ \ea\newif\begcs ifsty\csstring#1\endcs
+ \ea\gdef\ea#1\ea{%
+ \begcs\csstring#1init\ea\endcs
+ \begcs\csstring#1text\ea\endcs
+ \begcs\csstring#1math\endcs
+ }
+}
+
+\propdef\it
+\propdef\bf
+\propdef\sc
+
+ROMAN CLASS
+rm
+bf
+it
+it bf
+sl
+sl bf
+sc
+sc bf
+
+SANS CLASS
+ss
+ss bf
+ss it
+ss it bf
+ss sl
+ss sl bf
+ss sc
+ss sc bf
+
+MONO CLASS
+tt
+...
+
+MATH CLASS ?
+rm var
+bf var
+bb
+frak
+cal
+scr
+
+
+\vardef=\FHcmr
+\vardef\it=\FHcmti
+\vardef\bf=\FHcmbx
+\vardef\it\bf=\FHcmbxti
+
+% Same thing:
+\stydef\bf\it...
+\stydef\it\bf...
+
+\def\FHcmr{\optical \\5.5:cmr5 \\6.5:cmr6 \\7.5:cmr7 ... \\*:cmr17 }
+
+\Foptical <5.5=cmr5 <6.5=cmr6 <
+
+An "H font set" is a list of optical sizes of the same font; each font in the
+list has an associated scale factor (times 1000) and arbitrary token list for
+initializing the font (e.g., skewchar, hyphenchar, fontdimens, etc.).
+We provide macros for deriving new font sets by scaling or adding code to the
+token list of existing font sets.
+An "M font set" is a tuple of three H font sets.
+(H = horizontal, M = math; we could call H fonts "text fonts", but that is too
+easily confusable with \textfont.)
+
+\begfont[eurm]
+\Flink[cal][eusm]
+\endfont
+
+\protected\def\rm{\rminit \rmtext \rmmath}