forked from CGM_Public/pretix_original
Invoices: Support font choice and Arabic text (#3343)
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
from arabic_reshaper import ArabicReshaper
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
from PIL.Image import Resampling
|
||||
from reportlab.lib.utils import ImageReader
|
||||
|
||||
@@ -41,3 +43,9 @@ class ThumbnailingImageReader(ImageReader):
|
||||
# file handle if the file is a JPEG, and therefore does not respect the
|
||||
# (smaller) size of the modified image.
|
||||
return None
|
||||
|
||||
|
||||
reshaper = SimpleLazyObject(lambda: ArabicReshaper(configuration={
|
||||
'delete_harakat': True,
|
||||
'support_ligatures': False,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user