Juan Manuel Macías <maciasch...@posteo.net> writes: >> Do I understand correctly that onchar=id will not break anything if text >> is correctly marked with \selectlanguage{<lang>}? > > To load language features (hyphen rules, captions, etc.) there is no > problem. But to load a font associated with a language, the font of the > last declared language will always be loaded.
May we explicitly set the needed font around language environments? Something like \setfontforrussian \selectlanguage{russian} .... \setfontforbulgarian \selectlanguage{bulgarian} .... > In any case (to organize myself mentally) I thought that it could be > done on two levels: > > - Level 0: The fonts associated with each script are loaded (from a > defcustom list) if luatex is the current engine. And low-level code is > generated in Lua with the luaotfload.add_fallback function. That code > can be in a Lua file or directly within the preamble, enclosed in the > \directlua primitive (mode=harf means that HarfBuzz is used as otf > rendering): > ... Sounds reasonable. > - Level 1: The user can load language properties and associate fonts > with each language using Babel's high-level code (via keywords in Org, > as we have commented in previous messages). Here you can also modify > the default fonts (also, as we mentioned before): main, mono, sans and > math. If the language is declared with an asterisk (for example: > russian*) the onchar=etc property will be included in the preamble, > and it would not be necessary to switch to russian explicitly. It is > assumed that in this scenario the only language with Cyrillic script > would be Russian. For language swithcing, in the rest of the cases, > some babel command would have to be used using @@latex:@@, special > blocks, etc. When Org already has its own language switching > mechanism, this would be used instead. Wdyt? I am not sure if I like "russian*" idea. May you explain a bit more about how onchar works? What if language characters are intersecting, and not using exactly the same char sets? -- Ihor Radchenko // yantar92, Org mode contributor, 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>