Open Phyambre opened 8 years ago
There's been problems with non Latin characters for a while, but I'll look into it. Do you have an example string that you're having trouble writing that I can use for testing? Thanks.
Hi, For those fonts I explained above, any string with Japanese characters fails. So I think it is a problem of the metadata of the fonts or something. You can take as an example: 私はたろうです。 As I said, a couple of very heavy fonts such as TakaoPGothic can do the job, but they are big and I am afraid of OutOfMemoryError. Actually at this moment I am programming a kind of music editor and with your framework I can only export the music file to PDF with the music file closed. If it is open, and the editor is showing many visual components, I get the OutOfMemoryError the second or 3rd time I export the file to PDF.
@TomRoush have you solved this issue? I am also facing same
Hi,
I am trying to write Japanese characters, but all the fonts I have tried seem to have some problem. My code looks like this:
Now depending on the font the error is different For example, fonts like DroidSansJapanese I get:
For other fonts such as HeiseiMin-W3-Acro I get:
For non-Japanese fonts such as ArialMT.ttf I get:
Finally, if I try to load a type 1 font embedded in your library such as:
content.setFont(PDType1Font.COURIER, 10);
Then I get:
In general, it seems that all otf fonts give the "loca is mandatory" error.
I found some fonts that can do the job, such as TakaoPGothic, VL-Gothic-Regular or MS-Mincho, but all of them are quite heavy (around 5MB), so I would like to find an alternative. In addition I think MS-Mincho is a privative font, so cannot be used without Microsoft's permission. I would like to use DroidSansJapanese, which is around 1.3 MB, but I can't understand what is the problem.
By the way, for loading large fonts such as TakaoPGothic, DroidSansJapanese, etc. I am doing the trick of changing the extension from ttf to mp3 in the assets as mentioned here: http://stackoverflow.com/questions/7503133/japanese-characters-looking-like-chinese-on-android but I don't think that is the problem, as some fonts work. So, what can I do to use a smaller font? Please help.