diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm')
-rw-r--r-- | Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm | 93 |
1 files changed, 39 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm b/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm index 3daf7045ceb..9f9a650a839 100644 --- a/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm +++ b/Master/texmf-dist/tex/luatex/optex/f-lmfonts.opm @@ -1,9 +1,10 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_fontdecl [Latin Modern] \LMfonts {TeX Gyre fonts based on Coputer Modern} +\_famdecl [Latin Modern] \LMfonts {TeX Gyre fonts based on Coputer Modern} {\roman \sans \quotset \ttset \ttprop \ttlight \ttcond \upital \dunhill submods:\caps \slant \nbold \bolder} {\rm \bf \it \bi \tt} {LM} {[lmroman10-regular]} + {\_def\_fontnamegen {[\_optname{lm\_subfamV.\_currV}]:\_fontfeatures}} \_wlog{\_detokenize{% Modifiers (selects subfamily):^^J @@ -16,19 +17,13 @@ Modifiers (selects subfamily):^^J \ttcond .... condensed typewriter subfamily^^J \upital .... upright italic (only \rm)^^J \dunhill ... dunhill roman subfamily (only \rm, \it)^^J% -Submodifiers (setlects special variants of given subfamily):^^J +Sub-modifiers (selects special variants of given subfamily):^^J \caps ...... caps & small caps (available only at limited shapes)^^J \slant ..... slanted (default in some subfamilies)^^J \nbold ..... normal bold (extended bold is default)^^J \bolder .... extended bold^^J }} -\_protected\_def \LMfonts {% - \_def \_currfamily {LMfonts}% - \_def \_fontnamegen {[\_optname{lm\_subfamV.\_currV}]:\_fontfeatures}% - \_resetmod -} - \_def\_LMregfont #1 #2 #3{% \_edef\_tmp {\_noexpand\_regoptsizes #1 #2 \_ea\_detokenize\_ea{#3}}% \_lowercase\_ea{\_tmp}% OTF file names are lowercase @@ -118,79 +113,69 @@ Submodifiers (setlects special variants of given subfamily):^^J \_endcode -\sec How to wite font-macro-file with optical sizes for \OpTeX/ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -First, look at more clear example in `f-hermes.opm`. The basic documentation -is there. +\secc How to write the font family file with optical sizes -You can use `\_optname` macro in upur `\_fontnamegen`. This macro is fully +You can use \^`\_optname` macro when `\_fontnamegen` in expanded. This macro is fully expandable and its input is `<internal-template>` and its output is a -part of your `\_fontnamegen`, i.e. it is a part of a real font file name with -`.otf` extension. Shortly speaking: +part of the font file name `<size-dependent-template>` with respect to given +optical size. -\begtt - \_optname{<internal-template>} -> <part-of-file-name> -\endtt +You can declare a collection of `<size-dependent-template>`s for one +given `<internal-template>` by the \^`\_regoptsizes` macro. +The syntax is shown for one real case: -You can declare a collection of file names for only one -<optical-name-template> by `\_regoptsizes`. The syntax is shown for one real -case: - -\begtt - \_regoptsizes lmr.r lmroman?-regular - 5 <5.5 6 <6.5 7 <7.5 8 <8.5 9 <9.5 10 <11.1 12 <15 17 <* +\begtt +\_regoptsizes lmr.r lmroman?-regular + 5 <5.5 6 <6.5 7 <7.5 8 <8.5 9 <9.5 10 <11.1 12 <15 17 <* \endtt In general: -\begtt - \_regoptsizes <internal-template> {<default-size>} <resizing-data> +\begtt \catcode`\<=13 +\_regoptsizes <internal-template> <general-ouput-template> <resizing-data> \endtt Suppose our example above. Then `\_optname{lmr.r}` expands to lmroman?-regular where the question mark is substituted by a number depending on current `\_optsize`. If the `\_optsize` lies between two boundary -values (they are prefixed by `<` character) then the number written between -them is used. For example if $11.1 \lt \_optsize \_le 15$ then 12 is +values (they are prefixed by \code{<} character) then the number written between +them is used. For example if $11.1 \lt `\_optsize` \le 15$ then 12 is substituted instead question mark. The <resizing-data> virtually begins -with zero `<0`, but it is not explicitly written. The right part of -<resizing-data> must be terminated by `<*` which means "less than infinity". +with zero \code{<0}, but it is not explicitly written. The right part of +<resizing-data> must be terminated by \code{<*} which means "less than infinity". If `\_optname` gets an argument which is not registered <internal-template> then it expands to `\_failedoptname` which typically ends to error message about missing font. You can redefine `\_failedoptname` macro to some -existing font if you fint it useful. +existing font if you find it useful. -We are using a special macro \_LMregfont which sets the file names to +We are using a special macro `\_LMregfont` in `f-lmfonts.opm`. +It sets the file names to lowercase and enables to use a shortcasts isntead real <resizing-data>. -There are shortcats `\_regoptFS`, `\_regoptT`, etc. here. THe collection of -<internal-templates> are declared, each of them covers a collection of real +There are shortcats `\_regoptFS`, `\_regoptT`, etc. here. The collection of +`<internal-templates>` are declared, each of them covers a collection of real file names. -The modifiers redefines \_subfamV and \_currV ouput in this file -`f-lmfonts.opm`. These outputs are used in the paramater of `\_optname`, so -they decalre parts of <internal-template>, no parts of real file name. - -The `\optfontalias {<new-template>} {<declared-template>} decales -<new-template> wit the same meaning as previously <declared-template>. +The \^`\_optfontalias` `{<new-template>} {<internal-template>}` declares +`<new-template>` with the same meaning as previously declared +`<internal-template>`. The `\_optname` macro can be used even if no otical sizes are provided by a font family. Suppose that font file names are much more chaotic (because artists are very creative people), so you need to declare more systematic -<internal-templates> and do an alias from each <internal-template> to -<real-font-name>. For example, you can do it as folows: +`<internal-templates>` and do an alias from each `<internal-template>` to +`<real-font-name>`. For example, you can do it as follows: \begtt - \def\fontalias #1 #2 {\_regoptsizes #1 ?#2 {} <*} -% alias name real font name - \fontalias crea-a-regular {Creative Font} - \fontalias crea-a-bold {Creative FontBold} - \fontalias crea-a-italic {Creative olique} - \fontalias crea-a-bolditalic {Creative Bold plus italic} - \fontalias crea-b-regular {Creative Regular subfam} - \fontalias crea-b-bold {Creative subfam bold} - \fontalias crea-b-italic {Creative-subfam Oblique} - \fontalias crea-b-bolditalic {Creative Bold subfam Oblique} +\def\fontalias #1 #2 {\_regoptsizes #1 ?#2 {} <*} +% alias name real font name +\fontalias crea-a-regular {Creative Font} +\fontalias crea-a-bold {Creative FontBold} +\fontalias crea-a-italic {Creative olique} +\fontalias crea-a-bolditalic {Creative Bold plus italic} +\fontalias crea-b-regular {Creative Regular subfam} +\fontalias crea-b-bold {Creative subfam bold} +\fontalias crea-b-italic {Creative-subfam Oblique} +\fontalias crea-b-bolditalic {Creative Bold subfam Oblique} \endtt |