Font Support and Character Input Issues in Indico: Persian and Chinese Text

Hello Indico Community,
Is there any way to add Persian ,Chinese or other desired fonts to Indico? It seems we are encountering several issues regarding that.
Our generated PDF files with LaTeX for abstracts containing Persian content do not display correctly.
Additionally, when Chinese users register, we consistently encounter the “Unexpected Exception occurred” error for their names inputted in Chinese characters.
Are there any solutions available for these kinds of problems, or can we expect them to be resolved in future updates?

Our currently installed version is v3.2.7.

Thank you

Please provide the error and its traceback (you can find it in indico.log on the server). Character problems in PDFs are one thing, but considering that it’s Python 3 there should certainly not be any exceptions regardless of which characters you enter.

Please note that this version is outdated, you should update to the latest release (currently v3.3.2). Please check out upgrade docs for details.

1 Like

Thanks @ThiefMaster for your quick response,

I shared the drive folder for the log, which includes the logs for our old Indico and the new one for our Chinese registrant. Additionally, I included a picture of the generated Persian abstract.

GDrive

Sure we will.

Your Drive folder is restricted, I just requested access to it.

1 Like

It’s done

The error is in your custom code (which, by the way, should probably be written as a plugin instead of added in the Indico core):

File "/opt/indico/.venv/lib/python3.9/site-packages/indico/modules/events/inp_conference/__init__.py", line 23, in _editable_field_draw_item
  editable_field_draw_item(**kwargs)
File "/opt/indico/.venv/lib/python3.9/site-packages/indico/modules/events/inp_conference/util.py", line 158, in editable_field_draw_item
  form.textfield(x=xp, y=yp-float(font_size(item['font_size']))*1.33, fillColor=colors.white, borderColor=None, borderStyle='underlined',
File "/opt/indico/.venv/lib/python3.9/site-packages/reportlab/pdfbase/acroform.py", line 912, in textfield
  return self._textfield(
File "/opt/indico/.venv/lib/python3.9/site-packages/reportlab/pdfbase/acroform.py", line 758, in _textfield
  rFontName, iFontName = self.makeFont(fontName)
File "/opt/indico/.venv/lib/python3.9/site-packages/reportlab/pdfbase/acroform.py", line 726, in makeFont
  raise ValueError('form font name, %r, is not one of the standard 14 fonts' % fontName)
ValueError: form font name, 'Sans', is not one of the standard 14 fonts

We can’t help you there unless you share that custom code (and even then it would be on a best-effort basis, e.g. looking if we see something really obvious). Our own code also does not do anything with interactive PDF forms. So it’s most likely caused by your customizations. Maybe the form logic does not support all the fonts that are supported in normal PDF generation?

Also note that this particular PDF generation is not based on LaTeX.

1 Like

It doesn’t have to do anything with the version of Python and the fact that it intrinsically supports Unicode encoding for all the languages. This relates to the underlaying and huge Latex document generator package installed as part of Indico software installation who’s responsible for generating formatted documents in the platform which doesn’t support this in the compiled PDF format. It should be rectified as part of the infrastructure packages upon which the Indico Python 3 codebase is running.

Thank you, So, you’re saying there are no issues in Indico supporting Persian fonts to generate the abstracts?

I’m not sure, you’d need to test it. But what I know for sure is that we’ve never had reports of those exceptions you get with the non-LaTeX PDF generation. Some characters might not be displayed correctly (I strongly recommend you to test with a clean Indico w/o custom code), but it will not fail altogether.

1 Like

I did, and it’s still not working; it’s showing boxes again. I’m not sure if it’s related to our changes because we’ve faced the same issue previously as well. Assuming it’s not related to the customization issue but rather a lack of support from the generator itself, what do you suggest to resolve this problem and add support for Persian fonts to be displayed in generated PDFs?

Could you tell us what documents exactly you’re trying to generate (Book of abstracts, Document templates, …) and share some sample text so that we can test it ourselves and see what the issue is?

Thanks!

Hi Troun,

Thanks for reaching out.

We tried to generate templates (certificate, etc.) with Persian text in them, but regardless of the font we choose, it shows up with some boxes.

Here is a sample Persian text that you can try to use:

این یک متن تست فارسی می‌باشد. آیا شما قادر به مشاهده آن در پی‌دی‌اف خروجی می‌باشید؟

Hi,

the library we use to generate PDFs from document templates relies on fonts installed on the system that Indico is running on. If you want to be able to generate Persian text correctly you’ll need to install an appropriate font for it.

Hope this helps!