fenjalien / obsidian-typst

Renders typst code blocks in Obsidian into images using Typst through the power of WASM!
Apache License 2.0
337 stars 16 forks source link

[Bug] Not support Chinese words #55

Closed xjxl520303 closed 3 months ago

xjxl520303 commented 3 months ago

Can't correctly show Chinese characters in code block typst。

image

fenjalien commented 3 months ago

It turns out Typst's default fonts do not contain any chinese glyphs. The Typst CLI and Webapp can automatically find and fallback to a font that supports the glyphs. For the plugin you need to tell it to load the correct fonts in the plugin settings, if you're using windows the font "Microsoft YaHei" works for me.

Unfortunately this is not supported on mobile, I should probably include a basic fallback for that case.

xjxl520303 commented 3 months ago

It turns out Typst's default fonts do not contain any chinese glyphs. The Typst CLI and Webapp can automatically find and fallback to a font that supports the glyphs. For the plugin you need to tell it to load the correct fonts in the plugin settings, if you're using windows the font "Microsoft YaHei" works for me.

Unfortunately this is not supported on mobile, I should probably include a basic fallback for that case.

Great! Tky, It works

image