QuestPDF / QuestPDF-Documentation

MIT License
22 stars 17 forks source link

How can I contribue Chinese version of documents? #8

Open yangzhongke opened 2 years ago

yangzhongke commented 2 years ago

I'd like to contribute Chinese version of documents. What should I do? Can I create a ***_ZH_CN.md, for example, Readme_ZH_CN.md?

MarcinZiabek commented 2 years ago

Hello 😁

This is tough... I would really appreciate your help in translating the documentation and making it more accessible. However, right now, I am planning a huge update - this is my highest priority for nearest months. Organizining documentation structure, explaining API more precisly and adding more examples. Would it be possible for you to wait until the update is done?

In the meantime - I really need a foreign language expert. I am using Polish and English fluently but their structures are pretty simple and do not introduce any difficulties in text rendering. I am sure that QuestPDF is not perfect when working with more complex languages, e.g. Chinese, Japanese or Arabic. There is an additional step required called "text shaping" - where two or more text characters are combined together to create a text symbol. Would you like to create a separate discussion about this topic and help me test if algorithm results are as expected? So we can fix any existing issues? That would be great 😊

yangzhongke commented 2 years ago

I can wait. Do https://github.com/QuestPDF/QuestPDF/tree/main/QuestPDF.Examples , https://github.com/QuestPDF/QuestPDF/tree/main/QuestPDF.UnitTests and https://github.com/QuestPDF/QuestPDF/tree/main/QuestPDF.ReportSample cover all the testcases?

MarcinZiabek commented 2 years ago

QuestPDF.Examples - this is a source of examples for documentation and tests for more complex structures. It is great as I can get visualization of the algorithm results.

QuestPDF.UnitTests - this is my current approach to test behaviors of elemenets. It allows to test even most complex cases. However, I am thinking/working on a much simpler test engine that will not be coupled so much with internal implementation and will also allow to visualise and compare results when debugging.

QuestPDF.ReportSample - this project is to test most common elements together and observe if everything is stable. Some issues may appear only after certain number of pages (due to float number rounding).

yangzhongke commented 2 years ago

image It doesn't wokr well with Chinese characters. I have no idea of PDF format. What can I do to solve this issue? If you can give me some hints, maybe I can try to fix it.

MarcinZiabek commented 2 years ago

Can please try with a font that supports Chinese characters? For example Microsoft JhengHei? I have used it in my test as it is available on Windows 11 by default. Got nicely rendered characters - not sure if correctly rendered though.

yangzhongke commented 2 years ago

Cool. It works well. image image

Is there any further thing I can do with the i18n things?

MarcinZiabek commented 2 years ago

That's great it works correctly for Chinese. Thank you for checking it 😁

Recently, I was playing with Arabic and trying to use the HarfBuzz library to shape the text (so characters are correctly connected together within a word). It is hard to validate though as I don't know anything about Arabic 😂 And it still requires updating a lot of code in the library to properly measure and break text, something separate for a release.

Once I gather more time and prepare next version of the documentation, I will let you know. That would be awesome to have it transalted! This may take around 2-3 months as I am not sure about my life priorities and my time availability.

yangzhongke commented 2 years ago

I'm a microsoft MVP, and I'll try to ask Arabic MVPs for help in the MVP community.

MarcinZiabek commented 2 years ago

That would be fantastic, thank you!