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

Incorrect font rendering with SDL2 #1255

Open
mychris opened this issue Jan 14, 2024 · 1 comment
Open

Incorrect font rendering with SDL2 #1255

mychris opened this issue Jan 14, 2024 · 1 comment
Labels
bug sdl2 Issue related to the SDL2 frontend

Comments

@mychris
Copy link
Contributor

mychris commented Jan 14, 2024

Ligatures are rendered differently, dependent on line-wrapping and the current cursor position. In the first picture, line-wrapping is enabled, in the second disabled:

wrapping-on

wrapping-off

This happens only for the line the cursor is currently on. If line-wrapping is disabled, ligatures are no longer rendered as a single glyph for the line the cursor is on.

There is also a problem with non monospace fonts, which are outlined with kerning.
The following picture is an example with the Caveat font (https://fonts.google.com/specimen/Caveat):

caveat-font

If line-wrapping is disabled, it gets ever worse:

caveat-line-wrapping-off

While this might not be a problem with monospace fonts and normal or bold rendering, but if italics are added, this will most likely appear there as well.

@mychris
Copy link
Contributor Author

mychris commented Jan 14, 2024

The problem here is, that the backend splits up a line into multiple text objects, dependent on text-attributes and cursor position. If line-wrapping is disabled, the backend creates one object for every character. The frontend can then no longer render these objects together, or would have to merge them again, to ensure correct rendering of the text.

@Sasanidas Sasanidas added sdl2 Issue related to the SDL2 frontend bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sdl2 Issue related to the SDL2 frontend
Projects
None yet
Development

No branches or pull requests

2 participants