Force the basic layout engine when generating the kneeboard.

The libraqm backed layout engine causes crashes on some machines.

Fixes #531.
This commit is contained in:
Hanninho 2021-04-11 22:24:31 +02:00 committed by GitHub
parent 8ca68b3d7a
commit 2a1127e637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,18 @@ class KneeboardPageWriter:
# more information in the comm ladder (the latter of which we should
# probably do), we'll need to split some of this information off into a
# second page.
self.title_font = ImageFont.truetype("arial.ttf", 32)
self.heading_font = ImageFont.truetype("arial.ttf", 24)
self.content_font = ImageFont.truetype("arial.ttf", 20)
self.table_font = ImageFont.truetype("resources/fonts/Inconsolata.otf", 20)
self.title_font = ImageFont.truetype(
"arial.ttf", 32, layout_engine=ImageFont.LAYOUT_BASIC
)
self.heading_font = ImageFont.truetype(
"arial.ttf", 24, layout_engine=ImageFont.LAYOUT_BASIC
)
self.content_font = ImageFont.truetype(
"arial.ttf", 20, layout_engine=ImageFont.LAYOUT_BASIC
)
self.table_font = ImageFont.truetype(
"resources/fonts/Inconsolata.otf", 20, layout_engine=ImageFont.LAYOUT_BASIC
)
self.draw = ImageDraw.Draw(self.image)
self.x = page_margin
self.y = page_margin