%20%D1%8B%20com%20estresse%20agudo%20s%C3%B3%20funciona%20corretamente%20%C3%A0s%20vezes%20(usando%20Times%20New%20Roman%20e%20STIX%20Two%20Text)%20.png)
Postei uma pergunta semi-semelhante há algum tempo, onde perguntei por que o caractere ы não apareceu corretamentede forma algumano TNR com acento agudo ao usar \'ы
. Eu tenho um Chromebook e baixei a versão (aparentemente) mais recente (7.05) do Times New Roman, que também parece ser a mesma versão que o Windows 11 usa, já que a versão que tenho agora suporta versaletes e mais glifos que não funcionavam antes para mim.
Com o TNR 7.05, ao usar \ы
, às vezes terá o acento colocado no lugar certo, mas ao usá-lo em uma frase, parece não funcionar. Ele está na posição correta na primeira parte do meu exemplo, mas não sei por que é tão inconsistente. Isso não se aplica apenas ao TNR, pois no meu exemplo o STIX Two Text também é afetado.
\documentclass[letterpaper,12pt]{article}
\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
\setmainfont[BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
\newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel}
\begin{document}
\foreignlanguage{russian}{
\'ы ы́
}
When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.
When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.
\foreignlanguage{russian}{
ф\'ыф
}
\end{document}
Acredito que se você tiver Windows, meu \setmainfont
código deverá funcionar independentemente de você ter baixado os arquivos das variantes TNR pela web ou em outro lugar.
É estranho que pareça diferente dependendo de onde for colocado. Alguém pode ajudar com isso? Eu apreciaria muito.
Responder1
Existe uma abordagem alternativa, que tem a vantagem de os pontos de hifenização não serem eliminados (infelizmente, HarfBuzz
em idiomas hifenizados nem sempre funciona conforme o esperado). É baseado em uma transformação:
\documentclass[letterpaper,12pt]{article}
\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
\setmainfont
[BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
\newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel}
% Add this transform, which removes discretionaries
% before combining characters:
\babelposthyphenation{russian}{ |[{0300}-{036F}] }{ remove, {} }
\begin{document}
\foreignlanguage{russian}{
\'ы ы́
}
When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.
When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.
\foreignlanguage{russian}{
ф\'ыф
}
\end{document}
Responder2
O problema é a hifenização, veja tambémhttps://tex.stackexchange.com/a/340164/2388 ehttps://github.com/latex3/luaotfload/issues/267.
O problema realmente deveria ser resolvido de maneira geral. Até então, se você usar o harfbuzz-Renderer, o problema desaparecerá:
\documentclass[letterpaper,12pt]{article}
\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
\setmainfont
[Renderer=Harfbuzz,BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
\newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel}
\begin{document}
\foreignlanguage{russian}{
\'ы ы́
}
When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.
When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.
\foreignlanguage{russian}{
ф\'ыф
}
\end{document}
dá
Responder3
Você pode adicionar um padrão para evitar a hifenização antes do caractere de combinação conforme mostrado abaixo da regra neste exemplo
Uma interface babel melhor, para ser usada no preâmbulo, seria
\babelpatterns[russian]{8^^^^0301}
Mas aqui, apenas no exemplo de teste, eu uso um \patterns
formulário de nível inferior para poder demonstrar com e sem esse padrão alternando no meio do documento.
\documentclass[letterpaper,12pt]{article}
\usepackage{microtype}
\usepackage{unicode-math} % loads fontspec
\setmainfont
[BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
\newfontfamily\secondfont[Ligatures=TeX]{STIX Two Text}
\usepackage[main=english,russian]{babel}
% Add this transform, which removes discretionaries
% before combining characters:
%\babelposthyphenation{russian}{ |[{0300}-{036F}] }{ remove, {} }
\begin{document}
\foreignlanguage{russian}{
\'ы ы́
}
When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.
When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.
\foreignlanguage{russian}{
ф\'ыф
}
\bigskip
\hrule
\bigskip
\foreignlanguage{russian}{
\patterns{8^^^^0301}
}
\foreignlanguage{russian}{
\'ы ы́
}
When the unstressed vowels come at the end (\foreignlanguage{russian}{Б\'ыло}), they sound like A.
When the unstressed vowels come at the end (\foreignlanguage{russian}{{\secondfont Б\'ыло}}), they sound like A.
\foreignlanguage{russian}{
ф\'ыф
}
\end{document}