-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ‘uni0453.ital’ and enable support for Macedonian italics #398
Conversation
Wow thanks for the effort in contributing this @d125q, this looks great — all normalized and everything. For the sake of my future self in regression testing, could you drop the UTF8 string for the sample above into a comment here? |
You’re welcome – this is the first time I’ve done anything font-related and it was nice. I used LuaLaTeX to generate the sample, would the source for that help? Otherwise, the six letters are simply |
Yes the LuaLaTeX sources would be great. I try to post sources for such samples (either TeX or SILE) any time there is an issue like this. It makes figuring out regressions later much easier. A year from now if something breaks or needs extending I don't have to try to invent test cases again. Eventually I'd like to make such test specimens part of the project source, but haven't figured out how exactly I want to integrate that with I'm even more impressed if this was your first foray into fonts and using FontForge! Good work. |
I just whipped up a small sample in SILE to test this and it looks like there may be a problem with either the right side bearing or some kerning class interaction on the Serif Bold Italic styles. Here it is with a pipe character drawn after your sample word in each style for reference: SILE Code
I busted out FontForge myself on this and it wasn't immediately apparent to me what the actual problem is. The right bearing looks okay and is in line with similar glyphs. |
Hmm, that looks very weird to me. What is supposed to be Serif Bold Italic does not resemble the Serif font at all, so maybe SILE’s engine is doing something weird. Below is a somewhat configurable LuaLaTeX sample. You will need the latest TeX Live to typeset it. \documentclass[preview]{standalone}
\RequirePackage[american]{babel}
\RequirePackage{enumitem}
\setlist[description]{%
leftmargin=*,%
font=\sffamily\bfseries,%
}
\babelprovide[import]{macedonian}
\babelprovide[import]{serbian}
\babelprovide[import]{russian}
\babelfont[american]{rm}[Language=Default]{Libertinus Serif}
\babelfont[american]{sf}[Language=Default]{Libertinus Sans}
\babelfont{tt}[Language=Default,Scale=MatchLowercase]{Libertinus Mono}
\babelfont[macedonian]{rm}[Language=Macedonian]{Libertinus Serif}
\babelfont[macedonian]{sf}[Language=Macedonian]{Libertinus Sans}
\babelfont[serbian]{rm}[Language=Serbian]{Libertinus Serif}
\babelfont[serbian]{sf}[Language=Serbian]{Libertinus Sans}
\babelfont[russian]{rm}[Language=Default]{Libertinus Serif}
\babelfont[russian]{sf}[Language=Default]{Libertinus Sans}
\newcommand{\sampletext}{бгдптѓ/}
\newcommand{\testitem}[2]{%
\item[#1]
\begin{otherlanguage}{#2}
\begin{description}[widest=Serif]
\item[Serif] \rmfamily
\sampletext{}
\textbf{\sampletext{}}
\textit{\sampletext{}}
\textit{\textbf{\sampletext{}}}
\item[Sans] \sffamily
\sampletext{}
\textbf{\sampletext{}}
\textit{\sampletext{}}
\end{description}
\end{otherlanguage}%
}
\begin{document}
\begin{description}[widest=Macedonian]
\testitem{Macedonian}{macedonian}
\testitem{Serbian}{serbian}
\testitem{Russian}{russian}
\end{description}
\end{document}
% Local Variables:
% fill-column: 80
% mode: latex
% TeX-engine: luatex
% TeX-master: t
% End: |
So it is. I'll work on that separately. With the correct font in play (set using Everything except Semibold that is. Can we get Semibold Added to your TeX sample so we can confirm? |
Perfect.
Unfortunately, problems also happen here. However, they occur not only with MKD and SRB, but also with the default – the glyphs look completely off. (Note that LuaLaTeX code\documentclass[preview]{standalone}
\RequirePackage{xpatch}
\RequirePackage{xcolor}
\RequirePackage[american]{babel}
\RequirePackage{enumitem}
\setlist[description]{%
leftmargin=*,%
font=\mdseries\ttfamily,%
}
\babelprovide[import]{macedonian}
\babelprovide[import]{serbian}
\babelprovide[import]{russian}
\NewDocumentCommand{\FontName}{}{Libertinus}
\NewDocumentCommand{\LoadFont}{mo}{%
\babelfont[#1]{rm}[%
Language=\IfValueTF{#2}{#2}{Default},%
FontFace={sb}{n}{\FontName{} Serif Semibold},%
FontFace={sb}{it}{\FontName{} Serif Semibold Italic},%
]{\FontName{} Serif}
\babelfont[#1]{sf}[%
Language=\IfValueTF{#2}{#2}{Default},%
]{\FontName{} Sans}
\babelfont[#1]{tt}[%
Language=Default,%
Scale=MatchLowercase,%
FakeStretch=0.8,%
]{\FontName{} Mono}
}
\DeclareOldFontCommand{\sbseries}{\fontseries{sb}\selectfont}{\mathbf}
\DeclareTextFontCommand{\textsb}{\sbseries}
\LoadFont{american}
\LoadFont{american}
\LoadFont{macedonian}[Macedonian]
\LoadFont{macedonian}[Macedonian]
\LoadFont{serbian}[Serbian]
\LoadFont{serbian}[Serbian]
\LoadFont{russian}
\LoadFont{russian}
\NewDocumentCommand{\SampleText}{}{бгдптѓ/}
\NewDocumentCommand{\TestItem}{mm}{%
\item[#1]
\begin{otherlanguage}{#2}
\begin{description}[widest=\FontName{} Serif]
\item[\FontName{} Serif]\rmfamily
\begin{description}[widest=Semibold Italic]
\item[Regular] \SampleText{}
\item[Semibold] \textsb{\SampleText{}}
\item[Bold] \textbf{\SampleText{}}
\item[Italic] \textit{\SampleText{}}
\item[Semibold Italic] \textcolor{red}{\textsb{\textit{\SampleText{}}}}
\item[Bold Italic] \textbf{\textit{\SampleText{}}}
\end{description}
\item[\FontName{} Sans]\sffamily
\begin{description}[widest=Semibold Italic]
\item[Regular] \SampleText{}
\item[Bold] \textbf{\SampleText{}}
\item[Italic] \textit{\SampleText{}}
\end{description}
\end{description}
\end{otherlanguage}%
}
\begin{document}
\begin{description}[widest=MKD]
\TestItem{MKD}{macedonian}
\TestItem{SRB}{serbian}
\TestItem{RUS}{russian}
\end{description}
\end{document}
% Local Variables:
% fill-column: 80
% mode: latex
% TeX-engine: luatex
% TeX-master: t
% End: |
So the issue with SILE was that I wasn't getting the Bold at all, The remaining issue with Semibold looks like a bigger problem than this PR, and nothing seems worse here. I think I'll go ahead and merge this and we can track Semibold Cyrillic as a separate issue. |
This is great. I would just like to suggest to use бдгѓийптшщ as the test string. |
@Crissov Here is a sample with your test string (skipping the known-broken Semibold): SILE Code
|
Fixes #394. See also #29.