Skip to content

How can I use Chinese in the caption #597

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

Open
hjdbenny opened this issue Jul 25, 2024 · 2 comments
Open

How can I use Chinese in the caption #597

hjdbenny opened this issue Jul 25, 2024 · 2 comments

Comments

@hjdbenny
Copy link

hjdbenny commented Jul 25, 2024

Hello. How can I use Chinese garbled characters? For example Chinese .

 var square = new makerjs.models.Square(100);
    square.caption = {
      text: "测试",
      anchor: new makerjs.paths.Line([0, 50], [100, 50])
    };
    square.layer = 'blue';
    let dxf = makerjs.exporter.toDXF(square, { fontSize: 16 });

When exporting DXF in this way, Chinese garbled characters will be displayed
Dingtalk_20240725154827

@hjdbenny hjdbenny reopened this Jul 25, 2024
@danmarshall
Copy link
Contributor

Hello, we use the opentype.js library for fonts. Please check their repo's issues list to see if there are any workarounds. It seems not all languages/glyphs are supported. Perhaps we should add an integration with fontkit ?

@danmarshall
Copy link
Contributor

Sorry, I see I have misunderstood that you are using captions, not fonts. What DXF viewer are you using? I'm uncertain if this is a limitation of your viewer or of the DXF format itself.

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

2 participants