From dfedf096565fbd9ef81d575f5716fa55cff088c0 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 10 Nov 2022 13:53:15 +0100 Subject: [PATCH] PDF renderer: Normalize unicode before printing text --- src/pretix/base/pdf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pretix/base/pdf.py b/src/pretix/base/pdf.py index 1dbb32f8e..8eeffd8d3 100644 --- a/src/pretix/base/pdf.py +++ b/src/pretix/base/pdf.py @@ -40,6 +40,7 @@ import os import re import subprocess import tempfile +import unicodedata import uuid from collections import OrderedDict from functools import partial @@ -860,6 +861,9 @@ class Renderer: except: logger.exception('Reshaping/Bidi fixes failed on string {}'.format(repr(text))) + # reportlab does not support unicode combination characters + text = unicodedata.normalize("NFKC", text) + p = Paragraph(text, style=style) w, h = p.wrapOn(canvas, float(o['width']) * mm, 1000 * mm) # p_size = p.wrap(float(o['width']) * mm, 1000 * mm)