You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing some fonts, specifically with Google Fonts (.OTF) and two open source fonts (Ping Fang and Founder Type Hei Ti). My observations are as follows:
PDFKit has problems with OTF files.
PDFKit normally works with TTF fonts.
I made some changes to the Issues-PDFKit repository. I added more fonts in the "./source" folder and added them to the "./src/global.ts" file. To test the other sources you just need to change the property called on line 14 of the "index.ts" file to another one inside the Global.Path.Fonts module.
Finally, I attach a preview of how PDFKit renders some of the fonts tested in the attached screenshots:
The problem still occurs with OTF fonts. The example code is HERE. When you run the project, that create 2 PDF files. One file is created with a OTF Font (fails), and the another PDF is created with a TTF Font (working).
Some Chinese fonts apparently use obscure features. Someone sent me a Chinese TTF font that most font web sites can't successfully manipulate. And some browsers can't display it correctly, seems there are some special flags that some tools & browsers don't handle properly, but that are the basis for sharing strokes among glyphs which can make a Chinese font significantly smaller.
Thanks for all @blikblum , but I can't access to the last changes applied into the lib. I assume that I'll waiting for test these changes to the master branch when the push request will done.
Activity
dasoncheng commentedon Sep 29, 2019
May be your font load error or do not support Chinese, i tried and it worked
see Dr-NULL/Issues-PDFKit#1
Dr-NULL commentedon Sep 30, 2019
I was testing some fonts, specifically with Google Fonts (.OTF) and two open source fonts (Ping Fang and Founder Type Hei Ti). My observations are as follows:
I made some changes to the Issues-PDFKit repository. I added more fonts in the "./source" folder and added them to the "./src/global.ts" file. To test the other sources you just need to change the property called on line 14 of the "index.ts" file to another one inside the Global.Path.Fonts module.
Finally, I attach a preview of how PDFKit renders some of the fonts tested in the attached screenshots:
Font NotoSansSC OTF:

Font NotoSerifSC OTF:

Font PingFang TTF:

Font FZHei TTF:

Dr-NULL commentedon Sep 30, 2019
Finally that report give me some doubts:
blikblum commentedon Sep 30, 2019
Some OTF bugs were fixed recently.
Please create a self contained example, with font using https://repl.it/@blikblum/minimal-pdfkit so we can look at it
Dr-NULL commentedon Oct 1, 2019
The problem still occurs with OTF fonts. The example code is HERE. When you run the project, that create 2 PDF files. One file is created with a OTF Font (fails), and the another PDF is created with a TTF Font (working).
blikblum commentedon Oct 2, 2019
I confirm a bug exists but is not necessarily related with OTF format.
I tested with PingFang otf and ttf formats and both works fine
Testing with noto sans otf shows the bug. I could not find a noto sans ttf version and the online converters do not properly work with this font.
v-python commentedon Oct 3, 2019
Some Chinese fonts apparently use obscure features. Someone sent me a Chinese TTF font that most font web sites can't successfully manipulate. And some browsers can't display it correctly, seems there are some special flags that some tools & browsers don't handle properly, but that are the basis for sharing strokes among glyphs which can make a Chinese font significantly smaller.
blikblum commentedon Oct 3, 2019
This specific font works in other web tools.
I already identified a bug in fontkit, looking into it
blikblum commentedon Oct 5, 2019
Fixed a bug that affect noto sans otf font at foliojs/fontkit#207. Hopefully will fix this.
Dr-NULL commentedon Oct 7, 2019
Thanks for all @blikblum , but I can't access to the last changes applied into the lib. I assume that I'll waiting for test these changes to the master branch when the push request will done.
Dr-NULL commentedon Oct 14, 2019
The problem continues, I tried with updating PDFKit, the last version that NPM downloads is 0.10.0 and this is the result with NotoSansSC.otf:

...and with PingFang.ttf:

The most strange part is if I try to print the pdf with OTF broken font using SumatraPDF (by console), returns the following error:

blikblum commentedon Oct 14, 2019
The fix is not released yet