simplefonts: defining a fallback for a non-main font
Hi again, I'm using simplefonts (TeX Live 2013 version) and I have a main font: \setmainfont[Gentium Book Basic] and I can set a fallback for it, \setmainfontfallback[Gentium Plus][range={ipaextensions}, force=yes, rscale=auto] and that works. But then I have another font for the title: \definesimplefont[titleface][Gentium Basic][size=40pt] How do I set a fallback for it? After looking at the source code for simplefonts, I tried: % undefined cs: \definesimplefontfallback[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto] % undefined cs: \fontfallback[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto] % undefined cs: \definefallbackfont[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto] But they all gave "undefined control sequence" errors. I can work around the problem by setting the main font before the title, using the main font for the title, and then changing the main font after the title is done. But that seems kludgy. Thanks, Lars
Am 14.11.2013 um 22:52 schrieb Lars Huttar
Hi again,
I'm using simplefonts (TeX Live 2013 version) and I have a main font:
\setmainfont[Gentium Book Basic]
and I can set a fallback for it,
\setmainfontfallback[Gentium Plus][range={ipaextensions}, force=yes, rscale=auto]
and that works.
But then I have another font for the title: \definesimplefont[titleface][Gentium Basic][size=40pt]
How do I set a fallback for it?
After looking at the source code for simplefonts, I tried:
% undefined cs: \definesimplefontfallback[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto]
% undefined cs: \fontfallback[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto]
% undefined cs: \definefallbackfont[titleface][Gentium Plus][range={ipaextensions}, force=yes, rscale=auto]
But they all gave "undefined control sequence" errors.
I can work around the problem by setting the main font before the title, using the main font for the title, and then changing the main font after the title is done. But that seems kludgy.
There is no support for this with the old version of the module. Wolfgang
On 11/14/2013 5:06 PM, Wolfgang Schuster wrote:
Am 14.11.2013 um 22:52 schrieb Lars Huttar
: ... But then I have another font for the title: \definesimplefont[titleface][Gentium Basic][size=40pt]
How do I set a fallback for it? ... There is no support for this with the old version of the module.
For posterity, here is how I worked around it: \usemodule[simplefonts] % The main font for text: \setmainfont[Gentium Book Basic] \setmainfontfallback[Gentium Plus][range={ipaextensions}, force=yes, rscale=auto] % The font for the title: \def\titlefont{Gentium Basic} \starttext % Temporarily change the main font, while keeping the main font fallback: { \setmainfont[\titlefont] \switchtobodyfont[40pt] Title with a fancy ɠlyph } % Back to our previously defined main font: Body text ... \stoptext Lars
Just a minor improvement: On Fri, 15 Nov 2013, Lars Huttar wrote:
% Temporarily change the main font, while keeping the main font fallback: { \setmainfont[\titlefont] \switchtobodyfont[40pt] Title with a fancy ɠlyph }
Make that {\setmainfont[...] ... \endgraf} Otherwise, the interline space will not be calculated correctly. Aditya
On 11/15/2013 11:50 AM, Aditya Mahajan wrote:
Just a minor improvement:
On Fri, 15 Nov 2013, Lars Huttar wrote:
% Temporarily change the main font, while keeping the main font fallback: { \setmainfont[\titlefont] \switchtobodyfont[40pt] Title with a fancy ɠlyph }
Make that {\setmainfont[...] ... \endgraf}
Otherwise, the interline space will not be calculated correctly.
Thanks. It actually didn't seem to make any difference, but I put it in. Lars
participants (3)
-
Aditya Mahajan
-
Lars Huttar
-
Wolfgang Schuster