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

Weird Chinese rendering #25

Open
liblaf opened this issue Nov 12, 2022 · 4 comments
Open

Weird Chinese rendering #25

liblaf opened this issue Nov 12, 2022 · 4 comments

Comments

@liblaf
Copy link

liblaf commented Nov 12, 2022

When I use Chinese in terminal it looks fine like this

image

But when I render it as a gif using agg , the Chinese becomes weird

agg --renderer resvg --font-dir "${HOME}/.local/share/fonts/MesloLGS NF" --font-family "MesloLGS NF" demo.cast demo.gif

demo

If I use fontdb as renderer, then Chinese will not be displayed.

@a2659802
Copy link

a2659802 commented Jan 6, 2023

see also #10

@dlf412
Copy link

dlf412 commented May 15, 2023

you can edit cast file: add a space character as placeholder after all chinese characters

@zetako
Copy link

zetako commented Jul 10, 2023

you can edit cast file: add a space character as placeholder after all chinese characters

This works well! Thanks! I'm using a perl command to convert it now.

(It should be a sed cmd for general usage, but I'm having trouble making sed support unicode)

cat demo.cast | perl -CS -pe 's/([\x{4e00}-\x{9fa5}]|[\x{3040}-\x{30ff}])/$1 /g' > demo.space.cast

The first part (\u4e00-\u9fa5) matches basic CJKs and second part (\u3040-\u30ff) matches japanese kanas. These seems enough for me, check wiki if u need other blocks.

@hustcer
Copy link

hustcer commented Dec 1, 2023

@zetako Works for me, thanks

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

5 participants