From e3e07b5c51c40a23338dd818f7709f6281b67fab Mon Sep 17 00:00:00 2001 From: Ace Date: Mon, 13 May 2019 13:36:13 +0200 Subject: [PATCH] Added support for cjk This updates allows choosing chinese, japanese and korean as a language --- Calendar/E-Paper.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Calendar/E-Paper.py b/Calendar/E-Paper.py index 74467eb..5c12e50 100644 --- a/Calendar/E-Paper.py +++ b/Calendar/E-Paper.py @@ -39,10 +39,16 @@ from calibration import calibration EPD_WIDTH = 640 EPD_HEIGHT = 384 -default = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedLight.ttf', 18) -semi = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensed.ttf', 18) -bold = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedMedium.ttf', 18) -month_font = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedLight.ttf', 40) +if language in ['ja','zh','zh_tw','ko']: + default = ImageFont.truetype(fpath+'NotoSansCJK/NotoSansCJKsc-Light.otf', 18) + semi = ImageFont.truetype(fpath+'NotoSansCJK/NotoSansCJKsc-DemiLight.otf', 18) + bold = ImageFont.truetype(fpath+'NotoSansCJK/NotoSansCJKsc-Regular.otf', 18) + month_font = ImageFont.truetype(fpath+'NotoSansCJK/NotoSansCJKsc-DemiLight.otf', 40) +else: + default = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedLight.ttf', 18) + semi = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensed.ttf', 18) + bold = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedMedium.ttf', 18) + month_font = ImageFont.truetype(fpath+'NotoSans/NotoSans-SemiCondensedLight.ttf', 40) im_open = Image.open