3

I have this in my preamble:

\usepackage{luacode}
\begin{luacode*}
luaotfload.add_fallback("FallbackFonts", {
  "Noto Color Emoji:mode=harf",
  "Noto Sans CJK JP:"
})
\end{luacode*}
\usepackage{fontspec}
\setmainfont{Arial}[RawFeature={fallback=FallbackFonts}]

But I don't understand how to add bold feature to fallback fonts, well, at least to Noto Sans CJK JP. I can, for example, do this:

\newfontfamily{\jserif}{Noto Serif CJK JP}
\fontspec[AutoFakeBold=1.5]{Noto Serif CJK JP}

Which will add ability to make Noto Serif CJK JP font bold when in \textbf{} command. But this is only for one specific font which is used directly, not as a fallback font.

So, my question is, how can I add bold feature to fallback font Noto Sans CJK JP?

Update: The bold font must be applied in the same situations as any other regular font which support bold feature out of the box, e.g., when using \textbf{}.

  • This https://tex.stackexchange.com/questions/520874/fake-bold-applied-inconsistently-to-section-titles may be useful – MadyYuvi Jan 13 '23 at 05:24

1 Answers1

0
\documentclass{article}
\usepackage{luacode}
\begin{luacode*}
luaotfload.add_fallback("FallbackFonts", {
  "Noto Color Emoji:mode=harf;",
  "Noto Sans CJK JP:embolden=10;"
})
\end{luacode*}
\usepackage{fontspec}
\setmainfont{Arial}[RawFeature={fallback=FallbackFonts}]
\begin{document}
 的 
blub
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • I already tried it — it's always bold. I need it to be bold only when the macros say so (\textbf, \bfseries) (conditional). – Andrew15_5 Jan 13 '23 at 20:29
  • well as you didn't provide a sensible example I guessed. Ask a new, better question. – Ulrike Fischer Jan 13 '23 at 20:45
  • I only can emphasize that bold should be as a regular bold — when used with appropriate macros. I can't give an example, because I need to know the answer to my question in order to provide one. – Andrew15_5 Jan 14 '23 at 10:37