APK errors

In a PDF the letter ə becomes a square

A square means the font has no ə, or the PDF did not embed the font. The reader cannot find the letter and puts an empty box in its place.

Helvetica, many old PDF fonts, and decorative fonts do not carry ə. Arial, Calibri, Times New Roman, and Noto Sans do.

If the square is already inside the PDF, another reader will not fix it. Change the font and write the file again.

  • In Python do not use the built-in Helvetica. Register Arial or Noto Sans and embed it.
  • In Word, under File, Options, Save, turn on embedding fonts in the file. Then write the PDF.
  • In LibreOffice, embed the standard fonts when you export a PDF. Otherwise the square stays on another computer.
  • A decorative font does not carry ə. Keep the title in it and set the text to Arial.
  • A reader does not fix an old PDF that already has squares. Export the source again.
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen import canvas

pdfmetrics.registerFont(TTFont("Arial", r"C:\Windows\Fonts\arial.ttf"))
fayl = canvas.Canvas("sened.pdf")
fayl.setFont("Arial", 14)
fayl.drawString(40, 800, "Azərbaycan")
fayl.save()

Related guides