On Wed, 24 Dec 2025 at 14:09, Ihor Radchenko <[email protected]> wrote:
> "Pedro A. Aranda" <[email protected]> writes: > > > Sorry for the length of the message... > > > > I'm not answering inline, because I want to give this discussion a > > (hopefully) new approach that should make the design and layout for > > `org-latex-fontspec-config' more understandable. Let's go step-by-step > > in a green-slate approach. Let's forget everything we knew and loved > > about fonts in LaTeX and org and start from scratch: > > > > 1. Typesetting in (Lua)LaTeX is about putting characters in a document. > > ... > > I understand all the above, yes. > > > 9. Emacs happens to know about scripts. Thanks to the code provided by > > J.M. Macías, we can get a list of 'special' scripts used in a document. > > This list provides the hint we need to guess which font LuaLaTeX will > > need for unsupported characters. > > 10. Since we have the scripts, we can use them as the _key_ in the > > fallback alist. Mapping the script to the full font specification > > simplifies this list. Once again, please note that the Emacs script name > > does not appear in the LaTeX code. LuaLaTeX only needs to know that it > > should try with 'Noto Color Emoji' if a character is not supported by > > the font used by default. We can supply a larger list that the exporter > > will then adapt taking the actual scripts contained in the document. > > This makes the whole process 'grow as you go' as I pointed out in > EmacsConf. > > This should probably be explained in the manual. Currently, the manual > does not specify whether "script" is named by Emacs or it is something > from LaTeX world. > OK, that can be fixed. > 10. Alternatives: If we really need a plist here, if should be like: > > > > ("emoji" :font "Noto Color Emoji" :features "mode=harf") > > What I rather had in mind is standard notation for all fonts (fallback > or not): > > ("font-name" :key1 val1 :key2 val2 ...) > > Then, > (setq org-latex-fontspec-config > '(("main" :font "FreeSerif" > :fallback (("emoji" . "Noto Color Emoji:mode=harf"))))) > > becomes > > '(("FreeSerif" :family "main" > :fallbacks (("Noto Color Emoji" :emacs-script "emoji" :features > "mode=harf") > ...)) > ...) > > Note how "main" and "emoji" are clearly marked as something different - > one is :family, while another is :script/:emacs-script/:onchar or some > other distinct name. > I really don't see it. Really sorry. I feel it is more natural to say 'for the "main" family use font "FreeSerif" (with features "whatever" if needed)' and 'when emacs finds script "emoji" in the buffer, add font "Noto Color Emoji" with features "mode=harf" to the list of fallbacks'. Why? In both cases I see the sequence (family/script) -> font -> features more natural, because family and script determine the font, not the other way round. Moreover, the script as returned by emacs is the key in my definition of the alist and has family is a fixed set of values. > However, when looking for 'fallback fonts' in the Internet, you will > > find the 'compact' definition used backend the backend and, I feel, this > > expanded version may introduced confusion. I would rather not go this > way. > > Do you mean "Noto Color Emoji:mode=harf" notation? > I actually have no problem with it, but if we allow it in fallback > fonts, let's allow it in main fonts as well. > In this case, I fear we would quite diverge from the things users will find in the Internet. > What I really want to achieve is uniform notation, and I really want to > avoid different ways to express the same thing (e.g. font features) in > different parts of the configuration. If features are passed as property > in one part of latex config, but can be a part of font name in another, > users will have a hard time remembering where to use which. > > I hope my intentions are clearer now. > I understand you what you want, but I fear this will convolute the code unnecessarily. -- > 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> > -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler "Sagen's Paradeiser" (ORF: Als Radiohören gefährlich war) => write BE! Year 1 of the New Koprocracy
