Thanks Thaddy, RVK.
The problem might be that SimSun-ExtB is a .ttf file and SimSun/NSimSun is a .ttc file.
Indeed rvk, the font cache (fpttf) will not load .ttc file. It does not understand the format. And fpPDF will not load .ttc files either.
So, .ttc files are ruled out.
The font cache does load .otf fonts and seems to understand them but when it it passes the font file name to fpPDF, it fails. Actually seems to try to load the font but crashes when the document is being finalised. Same thing happens if you supply the font file directly into fpPDF.
Thats why I included a demo that does NOT use the fontcache. The font name and path is "hard wired" in the call to Doc.AddFont().
One problem is fpPDF can work with ONLY .ttf files. Another is that even with a .ttf file (that does have Chinese characters) it does not display them.
The issues with the font cache are separate and, perhaps, incidental, it does not work with .ttc files. They are forecast to be future of fonts being space effective and I guess far better on a platform like Windows with poor disk i/o performance.
I read in one place that .ttf fonts differentiate between "
screen fonts" and "
printer fonts" and .otf fonts do not have that problem. But I could not find any further details of this claim. But as fpPDF is not interested in .otf fonts anyway ....
So Thaddy, can you show us a short simple example where you use NSimSun in fpPDF ??
Indeed, that would be useful. My Windows install does not have NSimSun but it would be trivial, on a system with it, to modify the simpleFPpdf.pas demo I provided to test it.
(BTW. I think mORMot2 does have support for SimSun and ttc fonts)
Even my app, tomboy-ng, will display Chinese characters on screen and printed. Just using the default Desktop font, Cantrell and, just tested, using Nimbus Sans, a .ttc font. (Linux, Debian 12). No special action taken in either screen display of printing, just request that font.
Thanks for your interest.
Davo