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

Letters overlap each other on specific font and combination of letters #635

Open
antmelnyk opened this issue Jun 5, 2023 · 2 comments
Open
Labels

Comments

@antmelnyk
Copy link
Contributor

Hey @RazrFalcon, I hope you're doing OK.

There is a weird issue with text resolving that was caught for one particular font and a combination of letters. Not sure exactly on which level that happens - either usvg-text-layout or rustybuzz. Maybe you have an idea?

SVG:

<svg width='100' height='100' viewBox='0 -201.7578125 100 251.3671875'
    xml:space='preserve'
    xmlns='http://www.w3.org/2000/svg'
    xmlns:xlink='http://www.w3.org/1999/xlink'>
    <text x='0' y='0' font-size='200' font-family='Fjalla One' fill='#000000'>fit</text>
</svg>

Font Fjalla One (https://fonts.google.com/specimen/Fjalla+One?noto.query=Roboto&preview.text=fit&preview.text_type=custom&query=fjalla)

Result of running minimal.rs example with added fontdb.load_font_file("./examples/Fjalla One-regular.ttf").unwrap();

Expected (rsvg-convert):
rsvg

Actual (ReSVG):
resvg

@RazrFalcon
Copy link
Owner

This is a ligature handling bug. Similar to #614, but this time it doesn't fail immediately.
Seems like usvg-text-layout bug. rustybuzz produces the same output as harfbuzz.

It basically thinks that fi is a single character, which is not. Kinda...

@RazrFalcon RazrFalcon added the bug label Jun 5, 2023
@antmelnyk
Copy link
Contributor Author

Yeah, that makes sense. I thought that it was about ligature handling.

For this font, the ligatures are classic ff, fi, fl, ffi, ffl.
And it fails to render fi and fl if there are more characters after these.

I checked 350 other Google Fonts, and quite a lot of them have these 2 ligatures (fi and fl). It fails to render only for this particular font, Fjalla One. Maybe that can help you to understand the difference and core of the issue.

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

No branches or pull requests

2 participants