I’ve been playing with old-style search engine suggestions and the Noto fonts
(which seem to be installed with TexLive) and have come up with a MWE with
“challenging” UTF-8 and emojis… WDTY? Additional code to generate by org-mode
is limited in size:
—— cut here ——
#+OPTIONS: num:nil toc:nil
#+LATEX_COMPILER: lualatex
#+LATEX_CLASS: article
#+LATEX_CLASS_OPTIONS: [12pt]
#+LATEX_HEADER: \directlua{luaotfload.add_fallback
#+LATEX_HEADER: ("emojifallback",{ "NotoColorEmoji:mode=harf;"})
#+LATEX_HEADER: }
# Toggle setmainfont to see both Serif and Sans fonts in action
# +LATEX_HEADER: \setmainfont{Noto Serif}[RawFeature={fallback=emojifallback}]
#+LATEX_HEADER: \setmainfont{Noto Sans}[RawFeature={fallback=emojifallback}]
#+LATEX_HEADER: \setsansfont{Noto Sans}[RawFeature={fallback=emojifallback}]
#+LATEX_HEADER: \setmonofont{Noto Sans
Mono}[RawFeature={fallback=emojifallback}]
#+LATEX_HEADER: \setlength\parindent{0pt}
#+TITLE: Minimal Emoji support with the Noto family
This is a minimal working example mixing fonts of the Noto font family to get
Emoji's onboard.
😄 minikube v1.15.1 on Ubuntu 20.04
✨ Automatically selected the docker driver
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
And a simple UTF-8 text showing a file directory:
#+BEGIN_verbatim
/test
├── file-a
├── file-b
└── file-c
#+END_verbatim
Добрий день
Ähnlich wie Anno dazumal: Sagen's Paradeiser
Ñaca ñaca la cigala
—— cut here ——
Contributions for scripts outside Latin/Cyrillic
> El 13 abr 2025, a las 10:50, Pedro Andres Aranda Gutierrez
> <[email protected]> escribió:
>
> PS: Free* means the Free* _fonts_
>
> On Sun, 13 Apr 2025 at 10:49, Pedro Andres Aranda Gutierrez
> <[email protected] <mailto:[email protected]>> wrote:
> A bit more info
>
> With lualatex, I get
>
> luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not
> found:
> "/usr/lib/firefox/fonts/TwemojiMozilla.ttf"....texmf-dist/tex/luatex/luaotfload/luaotfload-fallback.lua:50:
> attempt to inde
> x a nil value (local 'f').
> <to be read again>
> relax
> l.19 ... Serif}[RawFeature={fallback=seriffallback}]
>
> It looks that the example is very config specific, because in my case
>
> ~ > ls /usr/lib/firefox/
> defaults ubuntu-gnome.cfg
>
> I have been able to get some results with lualatex and the Free* in macOS,
> Debian, Ubuntu, Fedora and Windows. So what I'm after is a simple snippet
> that will provide a configuration which only depends on what TexLive &
> friends offer.
>
> Nice discussion here :-)
> /PA
>
> On Sun, 13 Apr 2025 at 09:57, Ihor Radchenko <[email protected]
> <mailto:[email protected]>> wrote:
> Max Nikulin <[email protected] <mailto:[email protected]>> writes:
>
> >> \directlua{
> >> luaotfload.add_fallback("global_fallback", {
> >> "Noto Serif:mode=harf;", % 1st: Broad Unicode coverage
> >> "DejaVu Serif:mode=harf;", % 2nd: Common Linux/Windows font
> >> "FreeSerif:mode=harf;", % 3rd: Common TeX Live font
> >> "Arial Unicode MS:mode=harf;", % 4th: Windows fallback
> >> "Code2000:mode=harf;" % 5th: Historic Unicode font
> >> })
> >> }
> >
> > Has anybody tested that LuaTeX can efficiently cache that some
> > characters are missed in earlier tried fonts? It looks like a rather low
> > level feature, so without benchmarks I am unsure if it is reasonably
> > optimized.
>
> I think that our first priority should be getting fallbacks
> working. Trying to optimize it is going too far ahead.
>
> > This list looks like a set of fallback variants for primary font, not as
> > options to try when some characters are missed. Perhaps it may be
> > reasonable to have predefined configuration for widely used fonts like
> > Noto, freefonts, DejaVu, Liberation, CMU (Computer Modern Unicode),
> > crosscore, ubuntu, etc., test what ones are installed (unless preferred
> > family is configured by the user) and use just it.
>
> Yup, that's what I thought. It looks like lualatex is able to scan
> available fonts and select first available, so we do not have to limit
> ourselves to a single font.
>
> > The key point is to have a number of presets for complete set of fonts
> > (serif, sans, mono, math) instead of simple alist. It would be
> > unfortunate to render document with Noto Sans and FreeSerif just because
> > Noto Serif is not installed.
>
> +1
>
> >> % ===== SCRIPT-SPECIFIC FALLBACKS =====
> >> % (Only activate for specific scripts)
> >> \newfontfamily\cjkfallback{Noto Sans CJK SC}[Script=Han]
> >> \newfontfamily\arabicfallback{Amiri}[Script=Arabic]
> >> \newfontfamily\symbolfallback{Segoe UI Symbol}[
> >> Scale=MatchLowercase,
> >> RawFeature={colr=yes} % For emoji support
> >> ]
> > [...]
> >> CJK: {\cjkfallback 汉语 日本語} \\
> >
> > I recall Juan Manuel posted examples with per-script font configuration
> > for babel. The problem was babel language detection based on character
> > script vs. explicit foreignlanguage commands.
> >
> > My experiments with hieroglyphs and emoji:
> >
> > For my earlier experiments with configuring fonts for LuaLaTeX see
> > Maxim Nikulin. Re: org-mode export to (latex) PDF. Sat, 17 Jul 2021
> > 19:35:57 +0700.
> > https://list.orgmode.org/[email protected]
> > <https://list.orgmode.org/[email protected]>
>
> Would you mind consolidating example lualatex document that will
> compile? LLM example is not very useful (it does not compile) - it only
> illustrates that automatic font fallbacks are possible. Your example
> from the linked thread also does not compile.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at <https://orgmode.org/ <https://orgmode.org/>>.
> Support Org development at <https://liberapay.com/org-mode
> <https://liberapay.com/org-mode>>,
> or support my work at <https://liberapay.com/yantar92
> <https://liberapay.com/yantar92>>
>
>
> --
> Fragen sind nicht da, um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> Sagen's Paradeiser, write BE!
> Year 1 of the New Koprocracy
>
>
>
> --
> Fragen sind nicht da, um beantwortet zu werden,
> Fragen sind da um gestellt zu werden
> Georg Kreisler
>
> Sagen's Paradeiser, write BE!
> Year 1 of the New Koprocracy
>