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

Display of unicode-test.txt has error in some glyphs #11

Closed
plntyk opened this issue Aug 24, 2018 · 5 comments
Closed

Display of unicode-test.txt has error in some glyphs #11

plntyk opened this issue Aug 24, 2018 · 5 comments

Comments

@plntyk
Copy link

plntyk commented Aug 24, 2018

docs/unicode-test.txt Line 3, first 13 symbols for example are internally rendered bigger and then
some small part of that rendered glyph is displayed: like some edge of a circle/square on other symbols (like emojis)

since kmscon uses Pango i checked in KDE, xfce4-terminal with

pango-view --text="♉♊♋♌♍♎♏♐♑♒" --font="DejaVu Sans Mono"

Result: color emoji due to font replacement/missing glyphs (?) and correct size with font - rending by default should be cairo
However

pango-view --backend=ft2 --text="♉a♊s♋d♌f♍♎♏♐♑♒" --font="DejaVu Sans Mono"

Result: larger black/white glyphs (similar to parts displayed in kmscon) but complete symbols but different symbol and "normal" font size.

/etc/kmscon/kmscon.conf 
font-name=DejaVu Sans Mono
font-size=16
vt=5
no-switchvt

beside some glyphs of docs/unicode-test.txt the following emojis exhibit the problem too for example:

😀😂🙀😈😇😤🙌🙈🙏

According to kmscon docs it uses freetype2 so it might be some issue with different fonts from that side?
Also, this might be "duplicate" of dvdhrm#133

System: Arch Linux, Intel HD4000 integrated in CPU i7-3770

@Aetf
Copy link
Owner

Aetf commented Sep 5, 2018

Hmm.... emoji font issues again. These little things never work correctly for me :/

According to kmscon docs it uses freetype2 so it might be some issue with different fonts from that side?

It's indeed possible this is caused by some misconfiguration in freetype2. Rendering docs/unicode-test.txt with pango-view + ft2 also shows incorrect results, for example the "other symbols" section. And there shouldn't be much special configuration done in kmscon.

Anyway, I need to investigate more into this mess. But I'm definitely not a guru in font rendering...

@plntyk
Copy link
Author

plntyk commented Sep 6, 2018

Done some additional testing with pango-view, ft2 and cairo backends, some fontconfig changes:
like custom
FONTCONFIG_FILE=fonts.conf `FONTCONFIG_PATH=./ pango-view ........
using
FC_DEBUG=<number>
show that pango-view cairo backend can show "wrong" sizes if one disables/remove
/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
IIRC the font-cache should be cleaned too between tests to make sure.

Using the shortcuts of kmscon --grab-zoom-in <grab> [<Ctrl>Plus] Shortcut to increase font size
shows complete bitmap symbols on a ridiculous font-size.

For test/scripting notice that 'pango-view' can output to a picture file.

So "new" bitmap-fonts -- those that might have "CBDT Data Tables" in them -- and their scaling seems to be the culprit. Those color/picture fonts are probably going to stay and are developed even further: Colorfonts
Checking of emoji/symbol content of a font was done with program "gucharmap" with setting "Only show glyph of this font"

Temporary "workaround" but with some bugs in character width too: use Symbola Font.
The Symbola Font is a more "normal" font and has exotic symbols and emojis like 🦖
but the Symbola raptor is incomplete too on : only the left half of the glyph is displayed.

@Aetf
Copy link
Owner

Aetf commented Sep 6, 2018

Okay. So if I understand correctly, this is caused by some bitmap fonts not having correct scaling information with them? So it's not a bug in kmscon.

the Symbola raptor is incomplete too on : only the left half of the glyph is displayed.

This might be a separate issue about the character width and which wcwidth implementation your shell and kmscon is using. See Aetf/libtsm#1.

I'm closing the issue and adding a wiki page documenting this. Feel free to add more to the wiki if you find out more :)

@Aetf Aetf closed this as completed Sep 6, 2018
@plntyk
Copy link
Author

plntyk commented Sep 7, 2018

I extended documentation on unicode, colored glyphs, colored fonts and font formats and some test/bug issues in the wiki.

@Aetf
Copy link
Owner

Aetf commented Sep 7, 2018

@plntyk Thank you so much!

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

No branches or pull requests

2 participants