Reputation: 33
I am generating pdf using reportlab library for python27 project.
The arabic texts are not printing properly and instead i see these tiny black squares. I tried following this solution: ReportLab: Arabic characters are displayed as black squares. but lot of the bidi.algorithm's import modules are missing and outdated.
in sufficiently large fonts as follows: ■ ■ ■ ■ ■ ■ ■ ■ ■
Please advice. Thanks a lot!
Upvotes: 2
Views: 2132
Reputation: 973
The black squares show you that those characters are not included in the font. These characters may display in your text editor because it will often use a different font file than your PDF viewer.
You are likely using one of the 14 standard PDF fonts. These fonts do not get embedded in the document and depend on font files that come with each PDF viewer. These standard fonts are not consistent and some PDF viewing software will substitute similar fonts with different character sets. Additionally, the PDF standards only require the fonts to include the Latin character set.
You will need to find a font that includes the required characters and embed it in the document. Directions for using non-standard fonts can be found in Chapter 3 of the ReportLab documentation. Google Fonts allows you to search for fonts with Arabic characters.
Upvotes: 3