arakiken / mlterm

Other
156 stars 13 forks source link

Cairo rendering fuzzy on horizontal bars #18

Closed Atemu closed 3 years ago

Atemu commented 3 years ago

Hi, I've been a happy user of mlterm for a while now but there's something bugging me with the font rendering:

Cairo: image

Xft:

image

I'm not sure it comes across very well in the images (github does some sort of processing on them, the colors are a bit off) but horizontal bars are fuzzy in an inconsistent way. This is especially noticeable on the ===, es and Ts but also the [s.
(Ideally compare this by switching between the font renderers on your system in real time.)

Are you able to reproduce the bahaviour? I want to make sure it's not a packaging bug on my end.

Is that a Cairo bug perhaps? My Emacs and lxterminal are built against Cairo too though AFAICT (the latter through vte+pango) and do not exhibit this behaviour.

Unfortunately, simply using xft is not an option as it fails to display CJK characters.

Dotfiles: https://github.com/Atemu/dotfiles/tree/62cc068345cebd5346f4ead6f0a58efab2293a2f/.config/mlterm/ Nixpkgs: https://github.com/Atemu/nixpkgs/blob/22aaac9cbc6a472c0e68b86466b241d25aa051dc/pkgs/applications/terminal-emulators/mlterm/default.nix Nixos-config: https://github.com/Atemu/nixos-config/blob/9e13cb6801af2714f820a8fed1d81401adeb5653/configs/HEPHAISTOS/default.nix

arakiken commented 3 years ago

Thanks.

Does this patch improve this issue? -> http://mlterm.sf.net/mlterm-3.9.1-fixcairostyle.patch I'd like you to test it.

Atemu commented 3 years ago

Looks flawless; regular text is indistinguishable from Xft with that patch. (Bold text looks different but that might be intentional)

Is CAIRO_FORCE_DOUBLE_DRAWING a parameter one should tweak on the packaging side somehow?

Btw, is Xft not displaying CJK characters a bug or is it an issue on my end?

arakiken commented 3 years ago

Hi,

I don't recommend defining CAIRO_FORCE_DOUBLE_DRAWING. This is because the glyph width of some fonts is different between regular style and bold style, in which case it is necessary to draw glyphs of the bold style font one by one to fit the normal style font width, and the screen drawing gets slow.

It is necessary to use a font which includes CJK glyphs or to specify it as follows in ~/.mlterm/aafont manually in order to show CJK characters with Xft. ISO10646_UCS4_1_FULLWIDTH=(Font Name)

mlterm with cairo searches alternative fonts automatically if it doesn't find glyphs for some characters, but mlterm with Xft doesn't support it for now.

Regards,

arakiken commented 3 years ago

Sorry, I misunderstand. It is not necessary to define CAIRO_FORCE_DOUBLE_DRAWING with cairo-1.8.0 or later. I'll undefine CAIRO_FORCE_DOUBLE_DRAWING by default.

Atemu commented 3 years ago

Fixed as of 96ea847551157c546e715231772ecbc0b6a31c33, thank you!