odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[IMP] sign: add arabic letters reshaping

Open mograby3500 opened this issue 1 year ago • 1 comments

Before this commit: Arabic letters were not displayed properly. In particular they have the correct direction but lack ligature, since arabic letters have different shapes depending on the surrounding letters. They were displayed in one shape only (The isolated shape).

This commit aims to address this issue by using the arabic_reshaper library. That would simply replace each letter with the unicode of the correct shape.

Task: 3494707

mograby3500 avatar May 16 '24 12:05 mograby3500

Pull request status dashboard.

robodoo avatar May 16 '24 12:05 robodoo

@robodoo rebase-merge

arj-odoo avatar Jun 13 '24 12:06 arj-odoo

Merge method set to rebase and merge, using the PR as merge commit message.

robodoo avatar Jun 13 '24 12:06 robodoo

@robodoo r+

arj-odoo avatar Jun 25 '24 15:06 arj-odoo

Still have an issue in print image

MasoudEBS avatar Jun 27 '24 07:06 MasoudEBS

@MasoudEBS The aim of this PR is to be able to use the right UTF-8 characters for arabic content. But not all fonts have definition of these UTF-8 characters. You need to define the ir.config.parameter "sign.use_custom_font". with the font name to use something else than the Helvetica font. For example you could use: NotoSansArabic-Med.

image

See how the full path is used without the extension. The path is the one of the server. if you are on premise, you can check which font are available or any other font family if you installed other package on the server:

# find . -name 'NotoSans*'
./usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
./usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc
./usr/share/fonts/opentype/noto/NotoSansArabic-Bol.ttf
./usr/share/fonts/opentype/noto/NotoSansArabic-Med.ttf
./usr/share/fonts/opentype/noto/NotoSansMyanmar-Reg.ttf
./usr/share/fonts/opentype/noto/NotoSansMyanmar-Bol.ttf

See https://github.com/odoo/enterprise/pull/10181/files#diff-fd924498755af2d3fa8524a8260aed6830a30a87b5a8d9cc0b0470e1a7534b5fR405-R410

arj-odoo avatar Jun 27 '24 08:06 arj-odoo