Pedro Andres Aranda Gutierrez <[email protected]> writes:
>>> For each language, again, font + features can be defined.
>>> By default, given a language + font, that font will be used to
>>> typeset everything in that language - main text, emphasis, and
>>> monospaced fragments.
>>>
>> sf has nothing to do with emphasis ;-)
Got it.
>>> However, if :variant is provided (rm/sf/tt), user can specify
>>> individual fonts for main text, emphasis, and monospaced fragments in
>>> that language (is it really true?
>>
> Not completely... if your don't say anything, the font meant is the rm and
> if you add a \textsf{}, lualatex will choke at your document.
Looks like it is simply the default font?
I tried
% Intended LaTeX compiler: lualatex
\documentclass[11pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{unicode-math}
\setmainlanguage{english}
\newfontfamily{\englishfont}{FreeSerif}
\date{\today}
\title{Hello}
\begin{document}
Test. \textsf{This is test}
\end{document}
>>> I think this is not how it works in
>>> the code, but what I say here seems reasonable)
>>>
> lang+variant+font+(optional properties) would be the way to go to make
> sure everything is there.
> If you go back to the example I sent a couple of hours ago you see a config
> for this in the second code block.
But can you do multiple variants for polyglossia-font-config? Your
example is for babel.
>>> There is also :tag, but I do not quite understand its purpose. Can
>>> you please explain? (Reading the manual did not help)
>>>
> That's an obscure feature mentioned in the manual. It should be the BCP-47
> tag for the language.
> I included it but you could consider it for FFS.
This seems relevant
If a specific sans serif or monospace (‘teletype’) font is needed for a
particular script or language, it can be defined by means of ←
\⟨script⟩fontsf or \⟨language⟩fontsf and \⟨script⟩fonttt or
\⟨language⟩fonttt, respectively. Whenever a new language is activated,
polyglossia will first check whether a font has been defined for that
language. If this is not the case, it will check whether a font
associated with the BCP-47 script tag of the current language is
defined. If this also isn’t the case, polyglossia will finally check
(but this only for languages in non-Latin scripts) whether there is a
font associated with the OpenType script tag. If none of these fonts is
defined, polyglossia will use the currently active font as defined by
\setmainfont, \setsansfont or \setmonofont and – in the case of OpenType
fonts – will attempt to turn on the appropriate OpenType tags for the
script and language used, in case these are available in the font, by
means of fontspec’s \addfontfeature. If the current font does not appear
to support the script of that language, an error message is displayed.
So, this simply appears to be alternative alias to language. Do we
really need this? We already know the correct polyglossia language,
don't we?
>>> 3. org-latex-babel-font-config is similar to polyglossia-font-config.
>>> It also maps language to font + features, but with a twist.
>>> Unlike, polyglossia-font-config, you cannot just say - use the same
>>> font famility for normal, emphasized, and monospaced text. You must
>>> always specify individual font + features for each rm/sf/tt script.
>>> In addition, it is possible to explicitly specify default font used
>>> for languages other than with explicitly specified font settings. (is
>>> this really accounteed for in the code?)
>>>
>> Yes... that is the nil in the language.
Hmm. Looking at the code again, I think that my understanding was not
100% accurate. nil in the language is simply an alias to whatever main
language is in the document.
Also, looking into babel docs:
Actually, there is no real need to use \babelfont in a monolingual
document, if you set
the language system in \setmainfont (or not, depending on what you want).
So, it looks like for the actual default (when nothing is specified for
a given language), fontspec config will do.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>