Skip to content

Font combinations #196

Answered by olsak
bytex0a asked this question in Q&A
Discussion options

You must be logged in to vote

OK. Next example combines letters from Pagella-Italic and Heros-Bold. Moreover, the macro \combofont respects the current size of fonts given by the OpTeX font selection system.

\fontfam[Heros]
\fontfam[Pagella]

\fontdef\one{\Pagella\it}   % Pagella-Italic
\fontdef\two{\Heros\bf}     % Heros-Bold

\def\combofont{%
   \fontlet\one=\one \_sizespec \fontlet\two=\two \_sizespec % resize \one and \two to the current font size
   \font \combospec = "combo: 1 -> \fontid \one ; 2 -> \fontid \two , 0x30-0x39;"
   \combospec
}

\combofont Text 012345.
\medskip
\setfontsize{at14pt}\combofont Larger text 12345.

\bye

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bytex0a
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants