feh icon indicating copy to clipboard operation
feh copied to clipboard

feh doesn't display Chinese chars correctly

Open ri-aje opened this issue 5 years ago • 3 comments

hi, when I use --draw-filename or %F, feh gives me a bunch of boxes for filenames with Chinese chars. same happens to Japanese chars, so maybe it's a general issue with unicode chars? anyone knows how to make it work? thanks.

ri-aje avatar Apr 02 '20 23:04 ri-aje

Yeah you need a font that has the characters, e.g. feh -C /usr/share/fonts/truetype/unifont -e unifont/12 --draw-filename ... renders for me (that's from ttf-unifont on Debian/Ubuntu/...; not the prettiest, but it at least works).

Ferada avatar Apr 03 '20 10:04 Ferada

@Ferada thanks. that worked. then hit another issue, which is the not-pretty part. how do I instruct feh to use two fonts? i.e., display with a primary font and only fall back to the secondary when the primary font doesn't have certain chars.

in my case, I have one font that I like its English chars and the other its Chinese chars. let's call them E.ttf and C.ttf for example. judging from the effects, I believe E.ttf doesn't have Chinese chars and that's why feh renders boxes with it, and C.ttf has both English and Chinese chars but I don't like its English chars. I am hoping for something like feh -C font/folder/ -e E.ttf/12 -e C.ttf/12 --draw-filename, but it looks like command will use the last -e flag, i.e., C.ttf/12, for everything.

on my terminal (terminator 1.91), if I just pick E.ttf, it is able to render CJK chars with some acceptable font (I don't know which font it's using for that). can feh do something similar?

ri-aje avatar Apr 03 '20 13:04 ri-aje

As far as I know, no, taking a look at what the underlying library Imlib2 offers, it's simply one font selected, that's it. For the font selection mechanism you'd want, you'd need a library that e.g. uses fontconfig.

Ferada avatar Oct 16 '23 03:10 Ferada