How do I add unicode font in my GAE application using PyFPDF?
I have gone through the tutorials on: https://pyfpdf.readthedocs.io/en/latest/Unicode/index.html#metric-files
FPDF will try to automatically generate metrics (i.e. character widths) about TTF font files to speed up their processing.
Such metrics are stored using the Python Pickle format (.pkl extension), by default in the font directory (ensure read and write permission!). Additional information about the caching mechanism is defined in the add_font reference.
The problem here is PyFPDF will create the metrics file (.pkl) in the folder, it required write permission, GAE doesn't allow to write file, how should I do it?
Thank you!
Joel
The add_font() function makes use of the FPDF_CACHE_MODE constant which looks like is the one specifying if writing the .pkl files or not. This constant may have three values (either 0, 1 or 2). If settled to 1 then it does not write the .pkl files. This constant is defined in the fpdf.py file of the library. Therefore you need to modify this file and set the constant to 1 before you do the deploy.