Debian Codegraph @

texmf-dist/tex/optex/base/f-newcm.opm

raw
1 %% This is part of the OpTeX project, see http://petr.olsak.net/optex
2
3 \_famdecl [New Computer Modern] \NewCM {CM with Book variants, Cyrillic, Greek}
4 {\book \ttset \sans \caps \bookMath \sansMath} {\rm \bf \it \bi} {NewCM-Regular}
5 {[NewCM10-Regular]}
6 {\_def\_fontnamegen {[NewCM\_typfV-\_currV]:\_capsV\_fontfeatures}}
7
8 \_wlog{\_detokenize{%
9 Modifiers:^^J
10 \book ...... slightly bolder \rm, \it^^J
11 \ttset ..... Typewriter variants^^J
12 \sans ...... Sans serif variants^^J
13 \caps ...... caps & small caps (not in Italic variants)^^J
14 \bookMath .. Book variant for math fonts^^J
15 \sansMath .. Sans serif variants for math fonts
16 }}
17
18 \_moddef \resetmod {\_fsetV caps={},typf=10,book={} \_fvars Regular Bold {\_ncmI} {\_ncmBI} }
19 \_moddef \book {\_fsetV book=Book \_fvars Book Bold {\_ncmI} {\_ncmBI} }
20 \_moddef \ttset {\_fsetV typf=Mono10 }
21 \_moddef \sans {\_fsetV typf=Sans10 }
22 \_moddef \caps {\_fsetV caps=+smcp;\_ffonum; }
23
24 \_moddef \bookMath {\_doloadmath
25 \_loadmath {[NewCMMath-Book]}\_loadboldmath{NewCMMath-Bold} \to {[NewCMMath-Book]}}
26 \_moddef \sansMath {\_doloadmath \_loadmath {[NewCMSansMath-Regular]}}
27
28 \_def\_ncmtyprm{10}
29 \_def\_ncmtypsans{Sans10}
30 \_def\_ncmI {\_bookV \_ifx\_typfV\_ncmtypsans Oblique\_else Italic\_fi}
31 \_def\_ncmBI {Bold\_ifx\_typfV\_ncmtyprm Italic\_else Oblique\_fi}
32
33 \_initfontfamily % new font family must be initialized
34
35 \_loadmath {[NewCMMath-Regular]}
36 \_loadboldmath{[NewCMMath-Bold]} \to {[NewCMMath-Regular]}
37
38 \_endcode
39
40 If you want to use \book variant in the whole document, you can load
41 NewCMMath-Book Unicode math font too. Use the following declaration in this
42 case:
43
44 \loadmath{[NewCMMath-Book]}
45 \loadboldmath{NewCMMath-Bold} \to {[NewCMMath-Book]}
46 \fontfam[newcm]
47 \book\rm
48
49 or for sans serif math you can use:
50
51 \loadmath{[NewCMSansMath-Regular]}
52 \fontfam[newcm]
53 \sans\rm
54
55 See the file `f-heros.opm` for information about principles of such
56 font-macro-files.
57