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

Kitty still renders braille glyphs with the wrong font. #5910

Closed
clort81 opened this issue Jan 21, 2023 · 5 comments
Closed

Kitty still renders braille glyphs with the wrong font. #5910

clort81 opened this issue Jan 21, 2023 · 5 comments
Labels

Comments

@clort81
Copy link

clort81 commented Jan 21, 2023

Describe the bug
Kitty still renders braille glyphs with some unknown font not chosen by me.

To Reproduce

  • Install a font containing braille glyphs designed for textart (e.g. attached ttf font unscii-16-clort1.zip
  • Verify that kitty +list-fonts sees the installed font unscii-16-clort
  • edit ~/.config/kitty/kitty.conf to set font_family unscii-16-clort (file attached)
  • Ensure that kitty.conf has no speficied symbol_map to override chosen font
  • Launch kitty with: kitty --debug-font-fallback --debug-font-fallback
  • Verify font is loaded by checking kitty output:
[020 23:36:21.920163] Preloaded font faces:
[020 23:36:21.920258] normal face: /usr/share/fonts/X11/misc/unscii-16-clort1.ttf:0
[020 23:36:21.920287] bold face: /usr/share/fonts/X11/misc/unscii-16-clort1.ttf:0
[020 23:36:21.920313] italic face: /usr/share/fonts/X11/misc/unscii-16-clort1.ttf:0
[020 23:36:21.920336] bi face: /usr/share/fonts/X11/misc/unscii-16-clort1.ttf:0
  • print some unicode characters in braille range e.g.
    printf 'U+28F2 \u28F2\nU+28F3 \u28F3\nU+2708 \u2708\n'
  • compare to output using the font in gimp, and the output in fontforge

*Verify that kitty renders with the wrong font.
*Verify that --debug-font-fallback output is not showing a font substitution

Screenshots
Kitty output
kitty-fonttest-01-kitty

Gimp output shows correct rendering
kitty-fonttest-02-gimp

Fontforge shows correct rendering
kitty-fonttest-03-fontforge

unscii-16-clort1.ttf.gz

Environment details

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here. 
kitty 0.26.5 created by Kovid Goyal
Linux Khadas 5.15.0+ #2 SMP Tue Nov 9 09:13:20 CET 2021 aarch64
Devuan GNU/Linux 3 Khadas /dev/tty

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
Running under: Wayland
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/bash
Loaded config files:
  /etc/xdg/kitty/kitty.conf
  /home/Kornho/.config/kitty/kitty.conf

Config options different from defaults:
copy_on_select        clipboard
font_family           unscii-16-clort
font_size             12.0
modify_font:
    cell_height 0
update_check_interval 0.0
Changed mouse actions:
	middle release ungrabbed →  paste_from_clipboard
Colors:
	color15               #dddddd   
	foreground            #fca625   

Important environment variables seen by the kitty process:
	PATH                                /usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/Kornho/.cargo/bin:/home/Kornho/perl5/bin:/home/Kornho/.local/bin
	LANG                                en_US.UTF-8
	SHELL                               /bin/bash
	DISPLAY                             :0
	WAYLAND_DISPLAY                     wayland-1
	USER                                Kornho
	XCURSOR_SIZE                        24
	XDG_SEAT                            seat0
	XDG_SESSION_TYPE                    wayland
	XDG_SESSION_CLASS                   user
	LC_MESSAGES                         en_US.UTF-8
	XDG_VTNR                            1
	XDG_SESSION_ID                      2
	XDG_RUNTIME_DIR                     /run/user/1001
	LC_TIME                             en_DK.UTF-8

On older versions of kitty, run kitty --debug-config instead

Additional context

Most font designers draw the visual representation of unicode braille glyphs (u2800-28FF) as small dots, but since these glyphs are rendered for seeing eyes, they are more useful as drawing characters made of full width blocks, extending edge-to-edge on the monospace glyph.

"Try to reproduce the problem with kitty --config NONE"
With kitty --config NONE i do not expect kitty to use my chosen font.
kitty.conf.gz
unscii-16-clort1.ttf.gz

@clort81 clort81 added the bug label Jan 21, 2023
@kovidgoyal
Copy link
Owner

braille and box drawing characters are not rendered with fonts in kitty.
That is not going to change.

@clort81
Copy link
Author

clort81 commented Jan 21, 2023

I see now the many special cases handled in
/usr/lib/kitty/kitty/fonts/render.py
While it is perhaps laudable that you attempt to 'fix' box and block drawing for your users, I reccommend providing a means to disable this behavior in kitty.conf.
"I will override user font choices" is not respecting your users.
In particular, braille characters are useful as box-drawing characters. We view these glyphs on screens, with our eyes.
Blind people do not need to read braille on screens, with their eyes, which don't work, because they are blind.
Terminal users do need to have control over their font rendering.
Please add an option to disable your overriding user font choices in kitty.conf

@kovidgoyal
Copy link
Owner

Nope, sorry. Those characters are defined in the unicode standard to
render a certain way. I want terminal programs to be able to rely on
them being rendered in that way, since they are used, for example for
graphs. If you want special rendering for unicode codepoints use the PUA
code points, that is what they are there for.

@clort81
Copy link
Author

clort81 commented Jan 21, 2023

Let me inform you about what the unicode consortium writes about this, sir.
"Interpreting Characters and Rendering Glyphs

The difference between identifying a code point and rendering it on screen or paper is crucial to understanding the Unicode Standard's role in text processing. The character identified by a Unicode code point is an abstract entity, such as "LATIN CHARACTER CAPITAL A" or "BENGALI DIGIT 5." The mark made on screen or paper—called a glyph—is a visual representation of the character.

The Unicode Standard does not define glyph images. The standard defines how characters are interpreted, not how glyphs are rendered. The software or hardware-rendering engine of a computer is responsible for the appearance of the characters on the screen. The Unicode Standard does not specify the size, shape, nor style of on-screen characters."
https://www.unicode.org/standard/principles.html
You are overriding user choices without providing an option to disable this behavior.
Please reconsider that decision.

@kovidgoyal
Copy link
Owner

No, I will not. And what you quote applies to CHARACTERS not box drawing and braille symbols. Those very much have a defined appearance and rendering random things for them is beyond broken. It breaks things for the entire ecosystem making those codepoints unuseable for their stated purpose, all in the name of "user choice". User choice is not an infinite good.

Again if you want to render random images for unicode code points, use the PUA code points for it.

Repository owner locked and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants