@alexey.noskov Thanks for all the info. Adding a few fonts to our AWS Lambda helped a lot.
For reference, we found these are the fonts pre-loaded on amazon linux:
"DejaVu Sans Bold",
"DejaVu Sans Bold Oblique",
"DejaVu Sans ExtraLight",
"DejaVu Sans Oblique",
"DejaVu Sans",
"DejaVu Sans Condensed Bold",
"DejaVu Sans Condensed Bold Oblique",
"DejaVu Sans Condensed Oblique",
"DejaVu Sans Condensed"
We recently added these fonts to project:
"Arial Bold",
"Arial Unicode MS",
"Arial",
"Calibri",
"SimSun",
"NSimSun",
"Times New Roman",
"Times Roman",
"Times Bold",
"Times Italic",
"Times Bold Italic"
Implementation:
doc = aw.Document('file.rtf')
font_settings = aw.fonts.FontSettings()
# I thought this default might help render a large set
font_settings.substitution_settings.default_font_substitution.default_font_name = "Arial Unicode MS"
font_sources = font_settings.get_fonts_sources()
# /var/task is lamba's working dir where project is loaded
folder_font_source = aw.fonts.FolderFontSource("/var/task/fonts", True)
updated_font_sources = list(font_sources)
updated_font_sources.append(folder_font_source)
font_settings.set_fonts_sources(updated_font_sources)
doc.font_settings = font_settings
saveOptions = aw.saving.PdfSaveOptions()
saveOptions.embed_full_fonts = True
doc.save('file.pdf', saveOptions)
The following few sets are the only items we are missing. I am wondering if you might be able to provide a font list like you did before?
- si: Sinhala; Sinhalese
- my: Burmese
- km: Central Khmer
- dv: Divehi; Dhivehi; Maldivian
- am: Amharic
- ti: Tigrinya
The PDFs all output similarly to the first option with white boxes for non supported characters. The output PDFs all had embedded fonts so their size is too large to attach. Hopefully this is enough!
Thanks
rtfs_only.zip (53.9 KB)