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

Unicode font support for window titles in Tabbed layout #173

Closed
crocket opened this issue Apr 30, 2017 · 13 comments
Closed

Unicode font support for window titles in Tabbed layout #173

crocket opened this issue Apr 30, 2017 · 13 comments

Comments

@crocket
Copy link

crocket commented Apr 30, 2017

Problem Description

When I watch japanese videos on youtube, the tab displays broken boxes.

2017-05-25_thu_02 27 15

This issue occurs on Gentoo Linux.
But, it doesn't occur on Manjaro Linux.

Configuration

import XMonad
import XMonad.Layout.Tabbed (tabbed, Theme(fontName))
import XMonad.Layout.SimpleDecoration (shrinkText)

main :: IO ()
main = do
  xmonad $ def
    { layoutHook = tabbed shrinkText def { fontName = "xft:Monospace-13" }
    }
@crocket crocket changed the title Unicode font fallback support for XMonad.Layout.Decoration.Theme.fontName Unicode font support for window titles in Tabbed layout May 25, 2017
@crocket
Copy link
Author

crocket commented Aug 9, 2017

dmenu doesn't have this issue on both Manjaro Linux and Gentoo Linux.

echo | dmenu -fn monospace-20 -p おはよう

@geekosaur
Copy link
Contributor

geekosaur commented Aug 29, 2017 via email

@crocket
Copy link
Author

crocket commented Aug 29, 2017

I enabled xft USE flag globally in every gentoo package, but my xmonad configuration builds xmonad from source via stack. use_xft cabal flag is enabled by default in xmonad-contrib. Even if I bypass stack by using the sample config, the issue remains.

CKJ characters were drawn correctly on Manjaro Linux because the chosen font contained CKJ characters. On Gentoo Linux, the chosen font didn't contain CKJ characters. It seems xmonad-contrib doesn't detect a correct font for each character.

dmenu utilizes libXft to handle multiple languages with multiple fonts as below.

echo | dmenu -fn monospace-20 -p 'ایمان، اتحاد، نظم おはよう東方'

drw_text of dmenu chooses a correct font for each character.

@crocket
Copy link
Author

crocket commented Oct 5, 2017

If someone implemented something like drw_text from dmenu on top of Xft and substituted it for XMonad's current text drawing function, would it be merged?

@art-solopov
Copy link

I'm observing the same error. Ubuntu 16.04, Xmonad 0.12, Xmonad-contrib 0.12. I've tried to set the font theme to Noto Sans CJK, but the Japanese characters are displayed as squares. Cyrillic characters are displayed okay though.

@x-ji
Copy link

x-ji commented Oct 8, 2018

One can manually specify the font in the config, right? When I specify:

, fontName = "xft:Noto Sans CJK:size=10:antialias=true"

the tab titles (with CJK characters) are displayed correctly. I also originally encountered squares in the titles. I'm on Manjaro.

@x-ji
Copy link

x-ji commented Oct 8, 2018

However, the consequence of specifying such a CJK font is that other non-ASCII characters are not displayed correctly, such as ö. Guess if the issue #209 is solved then specifying a series of fonts should be the solution, just like what one does with xmobar.

@crocket
Copy link
Author

crocket commented Oct 9, 2018

fontconfig is the sane solution for choosing fonts.

@hanliinter
Copy link

Same issue on Gentoo, xmonad-contrib version 0.16 only with USE="+xft", google guided me here so I guess it might be the USE flag problem.

I re-emerged it with all USE flag "xft doc hscolour profile" and problem solved.

Maybe the key flag should be "profile" as it shows in the ebuild: https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-wm/xmonad-contrib/xmonad-contrib-0.16.ebuild#n21

Hope it helps.

1 similar comment
@hanliinter
Copy link

Same issue on Gentoo, xmonad-contrib version 0.16 only with USE="+xft", google guided me here so I guess it might be the USE flag problem.

I re-emerged it with all USE flag "xft doc hscolour profile" and problem solved.

Maybe the key flag should be "profile" as it shows in the ebuild: https://gitweb.gentoo.org/repo/gentoo.git/tree/x11-wm/xmonad-contrib/xmonad-contrib-0.16.ebuild#n21

Hope it helps.

@mikenrafter
Copy link
Contributor

This should be closed. This is not XMonad's problem. You need to select the correct fonts to display your characters. The same is true of any program.

Though, perhaps the documentation should mention this in its examples.

@geekosaur
Copy link
Contributor

Not necessarily. There also needs to be fallback font support, which I think is still missing in a bunch of places in contrib. This stuff doesn't just happen by itself, it needs to be coded.

@slotThe
Copy link
Member

slotThe commented Mar 4, 2022

Font fallback is supported now, so I guess we can really close this now. I created #692 to track the documentation part

@slotThe slotThe closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants