Fallback fonts not working
Hi guys, seems like fallback fonts are not being recognized. Systems fonts are working fine.
"@opendesign/sdk": "^0.4.5" node: v14.19.3
Error message:
(node:105008) UnhandledPromiseRejectionWarning: Error: Unknown font format
at Object.fontkit.create (/home/xorb/Projects/ProgPack/parse-ai/node_modules/@avocode/fontkit/src/base.js:99:9)
at SystemFontManager.<anonymous> (/home/xorb/Projects/ProgPack/parse-ai/node_modules/@opendesign/sdk/src/local/system-font-manager.ts:287:52)
at Generator.next (<anonymous>)
Project structure:
.
├── fonts
│ └── Inter-Regular.otf
├── package.json
├── Preview_text_multi.ai
├── src
│ ├── fonts
│ │ └── Inter-Regular.otf
│ └── index.ts
├── tsconfig.json
└── yarn.lock
Config:
const sdk = createSdk({ token: OPEN_DESIGN_TOKEN });
sdk.setGlobalFontDirectory("./fonts");
sdk.setGlobalFallbackFonts(["Inter-Regular"]);
Sample repo: https://github.com/xorb/opendesign-text-issue
I have been testing it on another linux distributions. No issues with Manjaro. Probably some package missing on the other linux distribution. Previously using Garuda Linux.
Seems like issue is back. Facing that issue again. It worked once.
Hi @xorb - very sorry for the late reply on this. I opened your sample repository and tested it in a Docker container (Debian GNU/Linux 11 (bullseye)) and everything worked fine 🤔 Specifically, I used the VS Code Remote Workspaces image for Node + TypeScript.
I certainly haven't tested this with Garuda or Manjaro and you're right that it could be some missing packages. What does your production environment look like? Is it Debian/Ubuntu or something else?
In production, we are using Amazon ami linux 2. It works fine inside vagrant. Probably we need to do some adjustments in our side.