summaryrefslogtreecommitdiff
path: root/macros/luatex/optex/base/fonts-resize.opm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/optex/base/fonts-resize.opm')
-rw-r--r--macros/luatex/optex/base/fonts-resize.opm86
1 files changed, 43 insertions, 43 deletions
diff --git a/macros/luatex/optex/base/fonts-resize.opm b/macros/luatex/optex/base/fonts-resize.opm
index 9dcd6a03e8..ac0064df10 100644
--- a/macros/luatex/optex/base/fonts-resize.opm
+++ b/macros/luatex/optex/base/fonts-resize.opm
@@ -1,13 +1,13 @@
-%% This is part of OpTeX project, see http://petr.olsak.net/optex
+%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \setfontsize {Font resizing macros <2020-04-17>} % preloaded in format
+\_codedecl \setfontsize {Font resizing macros <2020-04-17>} % preloaded in format
\_doc -----------------------------
The \`\setfontsize` `{<sizespec>}` saves the `<sizespec>` to the \`\_sizespec` macro.
- The \`\_optsize` value is calculated from the `<sizespec>`.
+ The \`\_optsize` value is calculated from the `<sizespec>`.
If the `<sizepec>` is in the `mag<number>` format then the contents of
- the `\_sizespec` macro is re-calculated to the `at<dimen>` format using
- previous `\_optsize` value.
+ the `\_sizespec` macro is re-calculated to the `at<dimen>` format using
+ previous `\_optsize` value.
\par \goodbreak
\_cod -----------------------------
@@ -26,17 +26,17 @@
\_def\_setoptsizeB scaled#1\_relax{\_optsize=\_defaultoptsize\_relax} % scaled<scalenum>
\_def\_setoptsizeC mag#1\_relax{%
\_ifdim\_lastmagsize>\_zo \_optsize=\_lastmagsize \_else \_optsize=\_pdffontsize\_font \_fi
- \_optsize=#1\_optsize
+ \_optsize=#1\_optsize
\_lastmagsize=\_optsize
\_edef\_sizespec{at\_the\_optsize}%
}
\_public \setfontsize \defaultoptsize ;
\_doc -----------------------------
- \`\_resizefont` `{<variant-name>}\<font switch>`,
+ \`\_resizefont` `{<variant-name>}\<font switch>`,
for example `\resizefont{bf}\_tenbf` resizes the font given by the
variant. The variant `XX` have its font switch `\_tenXX`.
- The \`\_doresizefont``\fontswitch` is used. It works in
+ The \`\_doresizefont``\fontswitch` is used. It works in
TFM mode (\`\_doresizetfmfont`) or OTF mode (\^`\_doresizeunifont`).
In both modes, it does
\begtt \catcode`\<=13
@@ -44,9 +44,9 @@
\endtt
The `<fontname>` is generated by the `\fontname` \TeX/ primitive where
\`\_rfontskipat` removes the `at<dimen>` part of the `\_fontname` output.
- The `<fontname>` is generated differently in OTF mode, see
+ The `<fontname>` is generated differently in OTF mode, see
\^`\_doresizeunifont` macro.\nl
- The \`\_whatresize` is defined as `<variant-name>`.
+ The \`\_whatresize` is defined as `<variant-name>`.
\_cod -----------------------------
\_def\_resizefont#1#2{%
@@ -57,14 +57,14 @@
\_slet{_tryload#1}{_relax}%
}
\_def\_doresizetfmfont#1{\_logfont{#1}%
- \_ea\_font\_ea#1\_ea\_rfontskipat
+ \_ea\_font\_ea#1\_ea\_rfontskipat
\_fontname \_cs{_ten\_whatresize} \_relax\_space \_sizespec \_relax
}
\_let\_doresizefont=\_doresizetfmfont
-\_def\_logfont#1{} % default is no logging of used fonts
+\_def\_logfont#1{} % default is no logging of used fonts
\_def\_rfontskipat#1{\_ifx#1"\_ea\_rfskipatX \_else\_ea\_rfskipatN\_ea#1\_fi}
-\_def\_rfskipatX #1" #2\_relax{"\_whichtfm{#1}"}
+\_def\_rfskipatX #1" #2\_relax{"\_whichtfm{#1}"}
\_def\_rfskipatN #1 #2\_relax{\_whichtfm{#1}}
\_doc -----------------------------
@@ -73,13 +73,13 @@
The font switch `#1` saved in the \`\_fontselector` macro is re-declared
because the variant selector runs the \^`\_resizefont`. Now, we need to
keep the current meaning of the font switch `#1` but we must leave the
- opened group. This is done by the \`\_keepmeaning` macro.
+ opened group. This is done by the \`\_keepmeaning` macro.
\nl
\`\fontlet` `<font switch A> <font switch B> <size spec>` does
\begtt \catcode`\<=13
- \font <font switch A> = <fontname> <sizespec>
+ \font <font switch A> = <fontname> <sizespec>
\endtt
- The `<fontname>` is extracted using the primitive command `\_fontname <font switch B>`.
+ The `<fontname>` is extracted using the primitive command `\_fontname <font switch B>`.
\_cod -----------------------------
\_def \_fontdef #1#2{\_begingroup
@@ -114,7 +114,7 @@
}
\_protected\_def \_resizethefont{\_newcurrfontsize\_sizespec}
- \_public \newcurrfontsize \resizethefont ;
+ \_public \newcurrfontsize \resizethefont ;
\_doc -----------------------------
The variant selector is defined by `\protected\def\XX{\_tryloadXX \_tenXX}`
@@ -138,8 +138,8 @@
The font selection system allows to use \`\currvar`
instead explicitly specified variant selector. The current variant
is extracted from `\the\font` output which could be `\_tenXX` control
- sequence. Then `\currvar` expands to `\_rm` or `\_it` etc.
- \_cod ----------------------------
+ sequence. Then `\currvar` expands to `\_rm` or `\_it` etc.
+ \_cod ----------------------------
\_protected \_def \_currvar{\_cs{_currvar:\_ea \_csstring \_the\_font}}
\_sdef{_currvar:_tenrm}{\_rm}
@@ -150,32 +150,32 @@
\_public \currvar ;
\_doc -----------------------------
- The \`\_regtfm` `<font id> <optical size data>`
+ The \`\_regtfm` `<font id> <optical size data>`
saves the <optical size data> concerned to `<font id>`.
The `<optical size data>` is in the form as shown below in the code where
`\_regtfm` is used.
\nl
The \`\_wichtfm` `<fontname>` expands to the `<fontname>` or to the corrected
`<fontname>` read from the `<optical size data>`. It is used in the
- \^`\_rfontskipat` macro and it is used in \^`\fontlet` macro.
- It means that each `<fontname>` generated by the `\fontname` primitive in the
+ \^`\_rfontskipat` macro and it is used in \^`\fontlet` macro.
+ It means that each `<fontname>` generated by the `\fontname` primitive in the
`\fontlet` macro is processed by the `\_whichtfm`. The real `<fontname>` or
- corrected `<fontname>` (depending on the optical data does not exist or exist)
+ corrected `<fontname>` (depending on the optical data does not exist or exist)
is the output of the expansion before `\font` primitive takes this output
as its parameter.
The implementation detail: The `\_<font id>:reg` is defined as the
`<optical size data>` and all control sequences `\_<fontname>:reg`
- from this data line has the same meaning because of the
+ from this data line have the same meaning because of the
\`\_reversetfm` macro. The `\_whichtfm` expands this data line and apply
- \`\_dowhichtfm`. This macro select the right result from the data line
+ \`\_dowhichtfm`. This macro selects the right result from the data line
by testing with the current `\_optsize` value.
\_cod -----------------------------
\_def\_regtfm #1 0 #2 *{\_ea\_def \_csname _#1:reg\_endcsname{#2 16380 \_relax}%
\_def\_tmpa{#1}\_reversetfm #2 * %
}
-\_def\_reversetfm #1 #2 {% we need this data for \_setmathfamily
+\_def\_reversetfm #1 #2 {% we need this data for \_setmathfamily
\_ea\_let\_csname _#1:reg\_ea\_endcsname
\_csname _\_tmpa:reg\_endcsname
\_if*#2\_else \_ea\_reversetfm \_fi
@@ -200,7 +200,7 @@
\_regtfm lmr 0 ec-lmr5 5.5 ec-lmr6 6.5 ec-lmr7 7.5 ec-lmr8 8.5 ec-lmr9 9.5
ec-lmr10 11.1 ec-lmr12 15 ec-lmr17 *
-\_regtfm lmbx 0 ec-lmbx5 5.5 ec-lmbx6 6.5 ec-lmbx7 7.5 ec-lmbx8 8.5 ec-lmbx9 9.5
+\_regtfm lmbx 0 ec-lmbx5 5.5 ec-lmbx6 6.5 ec-lmbx7 7.5 ec-lmbx8 8.5 ec-lmbx9 9.5
ec-lmbx10 11.1 ec-lmbx12 *
\_regtfm lmri 0 ec-lmri7 7.5 ec-lmri8 8.5 ec-lmri9 9.5 ec-lmri10 11.1 ec-lmri12 *
\_regtfm lmtt 0 ec-lmtt8 8.5 ec-lmtt9 9.5 ec-lmtt10 11.1 ec-lmtt12 *
@@ -215,7 +215,7 @@
\secc The `\setfontsize` macro
-The \^`\setfontsize` `{<size spec>}`
+The \^`\setfontsize` `{<size spec>}`
saves the information about `<size spec>`. This information is taken into
account when a variant selector (for example `\rm`, `\bf`, `\it`, `\bi`)
or `\resizethefont` is used. The `<size spec>` can be:
@@ -226,7 +226,7 @@ or `\resizethefont` is used. The `<size spec>` can be:
behaves like `\font\... scaled<number>`.
* `mag<decimal number>`, for example `\setfontsize{mag1.2}`. The font is
scaled in respect to the current size of the fonts given by the previous
- \^`\setfontsize` command.
+ \^`\setfontsize` command.
\enditems
The initialization value in \OpTeX/ is given by `\setfontsize{at10pt}`.
@@ -234,9 +234,9 @@ The \^`\resizethefont` resizes the currently selected font to the size given by
\^`\setfontsize`. For example
\begtt
- Here is 10 pt text,
-\setfontsize{at12pt} 10 pt text here unchanged...
-\resizethefont and 12 pt text is here.
+ The 10 pt text is here,
+\setfontsize{at12pt} the 10 pt text is here unchanged...
+\resizethefont and the 12 pt text is here.
\endtt
%
The \^`\setfontsize` command acts like {\em font modifier}. It means that it
@@ -262,15 +262,15 @@ create a size-dependent selector for such font then you can use
\font\tencomfortaa=Comfortaa-Regular-T1 at10pt
\def\comfortaa{\tencomfortaa\resizethefont}
-\comfortaa Here is 10 pt text
+\comfortaa The 10 pt text is here
\setfontsize{at12pt}
-\comfortaa Here is 12 pt text
+\comfortaa The 12 pt text is here
\endtt
%
The example above uses the 8\,bit `tfm` font. You can use Unicode font too, of
course. The \^`\fontfam` macro initializes the extended `\font` primitive
features for \LuaTeX/ (see section \ref[exfont]).
-If you didn't use this command, you must to initialize
+If you didn't use this command, you must initialize
these features by the \^`\initunifonts` command explicitly, for example:
\begtt
@@ -278,9 +278,9 @@ these features by the \^`\initunifonts` command explicitly, for example:
\font\tencyklop=[cyklop-regular] at10pt % the font cyklop-regular.otf is loaded
\def\cyklop{\tencyklop\resizethefont}
-\cyklop Here is 10 pt text
+\cyklop The 10 pt text is here
\setfontsize{at12pt}
-\cyklop Here is 12 pt text
+\cyklop The 12 pt text is here
\endtt
\secc[fontdef] The \code{\\fontdef} declarator
@@ -297,8 +297,8 @@ This command runs `<font modifiers> \<variant-selector>` in an internal group an
resulting selected font as `\<newfont>`.
The resulting `\<newfont>` declared by \~`\fontdef` is \"fixed font switch"
-independent of \^`\setfontsize` and other font modifiers. More exactly, it is
-fixed font switch when it is used but it can depend on the current font
+independent of \^`\setfontsize` and other font modifiers. More exactly, it is
+a fixed font switch when it is used but it can depend on the current font
modifiers and font family and given font modifiers when it is declared.
The parameter of the \~`\fontdef` macro must be exactly finished by the
@@ -307,9 +307,9 @@ and variant selectors are in the section~\ref[fontsystem].
\secc[fontlet] The \code{\\fontlet} declarator
-We have another command for scaling: \^`\fontlet` which is able to resize
+We have another command for scaling: \^`\fontlet` which can resize
arbitrary font given by its font switch.
-This font switch was declared it by the
+This font switch was declared by the
`\font` primitive or the \~`\fontdef` macro.
\begtt \catcode`\<=13
@@ -318,7 +318,7 @@ This font switch was declared it by the
\fontlet \bigfont = \_tenbf at15pt
\endtt
-The resulted `\bigfont` is the same as in previous example where \~`\fontdef`
+The resulted `\bigfont` is the same as in the previous example where \~`\fontdef`
was used. The advantage of \~`\fontdef` macro will be more clear when you load
font families by `\fontfam` and you are using more font modifiers declared
in such families.
@@ -343,7 +343,7 @@ of the `\defaultoptsize` register and such font is scaled by the specified
Font collections with optical sizes must be registered by the
\^`\_regtfm` for `tfm` files or \^`\_regoptsizes` for Unicode fonts.
-\OpTeX/ registers 8bit Latin Moder fonts in the format (`fonts-resize.opm` file)
+\OpTeX/ registers 8bit Latin Moder fonts in the format (`fonts-resize.opm` file)
and OTF Latin Modern fonts in the `f-lmfonts.opm` file.
\secc Implementation notes