Repository navigation
Add full Persian (FA) localization and improve Arabic-script font rendering (FreeType/Vazirmatn ) - #8808
Conversation
…; add Arabic-script note
|
💖 Thanks for opening this pull request! 💖 Please make sure you read our Contributing Guide and abide by our Code of Conduct. A few things to keep in mind:
|
|
Why was that merge of master in this branch? |
Because it was out of date. Did I do something wrong? |
|
Well, branches are always out of date. We don't have to permanently have them in sync with master. No problem with that as long as conflicts do not com in. I saw that the merge updated one .dvc file (can't find it anymore). |
|
Ok. Can I merge this? I think it is ok. |
|
Hmm, I wanted to ask @mohseniaref what he meant by "Investigate FreeType/HarfBuzz support for Arabic/Persian shaping and RTL text." Does this mean that this PR improves the situation of the Farsi language but still leaves issues to be solved? And, BTW, thank you @mohseniaref for this contribution. (P.S. I knew that already, but always fun to see how the name of the region where I leave, Algarve, derived from the Gharb as in |
Reply to Developer Comment on Persian (FA) LocalizationThank you very much for your message! Yes, exactly — this PR adds complete Persian (Farsi) localization (months, weekdays, etc.) and a transliterated FA_ASCII fallback, so Persian users can use GMT immediately in both native and ASCII-friendly modes. However, the note about FreeType/HarfBuzz refers to the remaining limitation: So, the localization part is solved , but full Persian rendering (proper joining and RTL direction) would still need HarfBuzz or another shaping engine in GMT’s text pipeline. Additional contextStep-by-step: Register Vazirmatn (or any TTF/OTF) for GMT PostScript outputI have tried: # Create the file ~/.gmt/PSL_custom_fonts.txt
mkdir -p ~/.gmt
nano ~/.gmt/PSL_custom_fonts.txtThen added entries such as: This allows GMT to recognize Persian-capable fonts for PostScript output, even without system-level font detection. I couldn't fix it so far for Persian language. Rebuilding GMT with FreeType enabledI rebuilt GMT manually to ensure FreeType was enabled: cd ~/Software/gmt
rm -rf build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/Software/gmt-install -DGMT_ENABLE_FREETYPE=ON
make -j"$(nproc)"
make installAgain, thank you for reviewing and encouraging this addition — it’s great to make GMT more accessible to Persian-speaking researchers! |
|
OK, I'll merge this. As for the remaining difficulties ... we will see. Don't know how much we can help but |
|
🎉🎉🎉 Congrats on merging your first pull request and welcome to the team! 🎉🎉🎉 We hope that this was a good experience for you. Let us know if there is any way that the contributing process could be improved. |
Add full Persian (FA) localization + font rendering (Vazirmatn test)
Summary
I added new Persian (FA) localization files for GMT but still doesn't work:
You can see it in master...mohseniaref:gmt:feat/localization-fa
gmt_fa.locale→ Persian (UTF-8)gmt_fa_ascii.locale→ ASCII transliteration fallbackBoth work correctly for day/month names, but Persian text (e.g.
شنبه,یکشنبه) does not render properly, even when FreeType and Fontconfig are enabled. Glyphs appear isolated (no Arabic shaping) and left-to-right.Environment
Steps to Reproduce
Result: Persian letters render unjoined or replaced with default Latin font.
Works fine
GMT_LANGUAGE=FA_ASCII(transliteration: Shanbeh, Yekshanbeh, etc.)Request
FA) and transliterated (FA_ASCII) locales to official GMT.feat/localization-fa.Thank you for maintaining GMT!
— Mohammad Mohseni Aref
University of Potsdam