reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
185 stars 52 forks source link

Slash is rendered as division slash U+2215 for Roboto Mono #625

Closed misho104 closed 5 months ago

misho104 commented 5 months ago

Hi. Using Roboto Mono with Polyglossia causes an issue: the code

\documentclass{article}
\usepackage{polyglossia}
\newfontfamily{\englishfont}{Roboto Mono}
\setdefaultlanguage{english}
\begin{document}
/////
\end{document}

compiled by LuaLaTeX generates a PDF file with Division Slash U+2215, not the ASCII slashes.

This is likely caused because Roboto Mono does not have a glyph for U+002F but its U+002F is redirected to U+2215.

screen

Interestingly, the issue does not occur in the following code:

%% fontfamily defined before loading PolyGlossia
\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\englishfont}{Roboto Mono}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\begin{document}
/////
\end{document}

% This code also works fine.
%\documentclass{article}
%\usepackage{fontspec}
%\setmainfont{Roboto Mono}
%\begin{document}
%/////
%\end{document}
jspitz commented 5 months ago

Cannot reproduce; here the following code:

% !TeX TS-program = lualatex
\documentclass{article}
\usepackage{polyglossia}
\newfontfamily{\englishfont}{Roboto Mono}
\setdefaultlanguage{english}
\begin{document}
    /////
\end{document}

produces: grafik

What happens if you select another luatexrenderer for polyglossia (or Renderer for the font itself), e.g.

\newfontfamily\englishfont{Roboto Mono}[Renderer=Base]
misho104 commented 5 months ago

Thanks for the clarification! Renderer=Base and Node produce slash (U+2F), while HarfBuzz produces U+2215. (The glyphs are exactly the same, so it requires a copy-and-paste to somewhere else to check its unicode.)

It seems an issue of my HarfBuzz (I have HarfBuzz 8.3.0 via Homebrew, but LuaLaTeX may be using another installation).

jspitz commented 5 months ago

OK, so we can close this ticket.