Skip to content
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

f and 5 (almost) colliding #535

Open
juhaszp95 opened this issue Apr 22, 2023 · 5 comments
Open

f and 5 (almost) colliding #535

juhaszp95 opened this issue Apr 22, 2023 · 5 comments

Comments

@juhaszp95
Copy link

The bug
The letter 'f' and number '5' almost collide (in Libertinus Serif). (This is problematic when e.g. links have these next to each other.)

Steps to reproduce
MWE (in LuaLaTeX):

\documentclass[12pt]{article}
\usepackage{libertinus-otf}

\begin{document}
	f5
\end{document}

Screenshot
Output of the MWE:
image

@hvoss49
Copy link
Collaborator

hvoss49 commented Apr 23, 2023

That is the correct behaviour. If you do not like it, then change the kerning. For xelatex with a feature file
and for lualatex with:

\documentclass{article}
\setlength\parindent{0pt}
\usepackage{fontspec}
\directlua {
	fonts.handlers.otf.addfeature {
		name = "f5kern",
		type = "kern",
		data = {
			["f"]   = { ["5"] =  100 },
			["f_f"] = { ["5"] =  100 },
		},
	}
}
\usepackage{libertinus-otf}

\begin{document}\Huge	
f5 ff5
	
\addfontfeature{RawFeature=+f5kern}f5 ff5
\end{document}

Bildschirmfoto 2023-04-23 um 07 48 30

@juhaszp95
Copy link
Author

Well, I guess that's a matter of taste. This solution almost works for me! But when I'm loading libertinus-otf with the [proportional] option (which I use by default), this stops working - do you have any guess how to make this work for the "proportional 5"? (I've looked at the fontspec documentation, but without any luck.)

@georgd
Copy link

georgd commented Apr 24, 2023

The proportional figures are suffixed with .fitted in this font, so the proportional 5 is named five.fitted. The number glyphs in fonts are generally written out so I assume that writing 5 in the addfeature code is a convenience shortcut. It would be interesting if 5.fitted would work, too.

@juhaszp95
Copy link
Author

Many thanks, this solves my problem! five.fitted worked, but 5.fitted didn't, in case anyone's wondering.

@pancaek
Copy link

pancaek commented May 15, 2023

Sorry to pop in with a comment so long after the main convo, but I haven't been successful in doing this adjustment with xelatex. Can you explain how to use these feature files? It's my first time hearing of them, and the fontspec docs didn't really make sense to me for this particular use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants