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

Doesn't support Chinese? #419

Closed
kreja opened this issue Mar 19, 2018 · 14 comments
Closed

Doesn't support Chinese? #419

kreja opened this issue Mar 19, 2018 · 14 comments

Comments

@kreja
Copy link

kreja commented Mar 19, 2018

I can print English words on images but doesn't work with Chinese.

@shawmraz
Copy link

@kreja I wanna print Chinese too , do you have any idea? thx

@hipstersmoothie
Copy link
Collaborator

@kreja @shawmraz It should work if you have a bitmap font that supports chinese characters

@hipstersmoothie
Copy link
Collaborator

If one of you can provide me with one I can verify if it works

@tina1998612
Copy link

hi I used a Chinese character font but it doesn't work.. There's no err msg but no text is printed out.

Here is the font:
font.zip

Thanks so much for your help!

@BlankHrt
Copy link

@tina1998612
中文字体的问题你解决了吗

@weiyunpeng
Copy link

中文字体现在怎么处理?

@peixin7947
Copy link

中文字体现在怎么处理?

+1

@uino-wuixn
Copy link

中文字体现在怎么处理?

+1

+1

@clcheng199903
Copy link

+1

@Selenium39
Copy link

+1

@BraveShadow
Copy link

hi I used a Chinese character font but it doesn't work.. There's no err msg but no text is printed out.

Here is the font: font.zip

Thanks so much for your help!

@tina1998612 Hi, I've downloaded your zip file and tested, maybe the reason that you didn't see printed text is that the color of your font is white!
If you print white words on white base image, of course you cann't see it.
Just change you font color in the fnt file, or change base image to a black image.

@pkjy
Copy link
Contributor

pkjy commented Aug 22, 2023

PingFang_24_BLACK_CHINESE3500.zip

just make a PingFang font with black words and support chinese. including 3500 commonly used Chinese characters , Hope be helpful.

const image = await Jimp.read("http://xxx.png");
const font = await Jimp.loadFont('PingFang_24_BLACK.fnt');
image.print(font, 0, 0, "长按观看视频");
await image.writeAsync('./new.png');

cc

or if you want make your own font:

  1. download hiero
  2. input your words in sample text area
  3. save BMFont files
  4. just ust it with Jimp.loadFont

This was referenced Aug 22, 2023
@kedeng
Copy link

kedeng commented Sep 13, 2023

  1. download ttf file which support chinese characters
  2. downlod bmfont
  3. open bmfont, goto "Options" -> "Font Settings" --> "Add font file" and choose your ttf file
  4. goto "Options" --> "Export Options", Set Bit Depth to 32 and change Presets to "Black text with alpha" or any thing match your requirement, set Textures to "png"
  5. click "Options" --> "Save bitmap fonts as ..." and choose your save folder
  6. now you can use Jimp.loadFont("the fnt file path") and print chinese

@azaryahuu
Copy link

PingFang_24_BLACK_CHINESE3500.zip

just make a PingFang font with black words and support chinese. including 3500 commonly used Chinese characters , Hope be helpful.

const image = await Jimp.read("http://xxx.png");
const font = await Jimp.loadFont('PingFang_24_BLACK.fnt');
image.print(font, 0, 0, "长按观看视频");
await image.writeAsync('./new.png');

cc

or if you want make your own font:

  1. download hiero
  2. input your words in sample text area
  3. save BMFont files
  4. just ust it with Jimp.loadFont

hello good sir can you help me with a japanese font, itried using noto sans from google fonts but im still getting "???"

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