fontspec
fontspec copied to clipboard
Feature request for combined fonts
Description
This is a feature request. luaotfload.sty can combine multiples fonts, that is, if a glyph is absent in the first font, the glyph in the second font is used (if the second has that glyph). As far as I see fontspec does not offer an equivalent function. For example, luaotfload combines the Gilbert color font and the Twemoji font, by lualatex --shell-escape with a manual bug fix to luaotfload,
\documentclass{article}
\font\colorfont={[./Gilbert-Color Bold Preview5.otf]:+svg;+kern;} at 10pt
\font\twemoji={[./TwemojiMozilla.ttf]:+colr;+ccmp;+dist;} at 10pt
\font\combo={combo: 1->\fontid \colorfont ; 2->\fontid \twemoji ,fallback}
\begin{document}
\combo
Font Combination in \LaTeX❣✌
\end{document}
into

It would be nice if the fontspec can offer this underlying function of luaotfload. luatexja-fontspec package has a similar option AltFont for Japanese fonts used as
AltFont = {
{ Range=⟨range⟩,⟨features⟩},
{ Range=⟨range⟩, Font=⟨font name⟩,⟨features⟩},
{ Range=⟨range⟩, Font=⟨font name⟩},...}
which is explained Section 11.1 of its English documentation http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=blob_plain;f=doc/luatexja-en.pdf;hb=HEAD#subsection.11.1
Check/indicate
- [Not sure...] Relevant for XeTeX
- [Yes] Relevant for LuaTeX
- [Yes] Issue tracker has been searched for similar issues?
- [N/A] Links to <tex.stackexchange.com> discussion if appropriate
Minimal example demonstrating the issue
See above.
Further details
The Gilbert font is from https://www.typewithpride.com/download The Twemoji font is from https://github.com/mozilla/twemoji-colr/releases