Skip to content

Commit

Permalink
Add Unicode fallbacks on Windows, prioritizing CJK fonts (#70)
Browse files Browse the repository at this point in the history
* Add Unicode fallbacks on Windows, prioritizing cjk and falling back.

* Remove redundant fallback.
  • Loading branch information
kjerk authored and amietn committed Dec 30, 2019
1 parent c9f0a42 commit c904a99
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions vcsi/vcsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,24 @@ def __str__(self):
DEFAULT_CONFIG_SECTION = "vcsi"

DEFAULT_METADATA_FONT_SIZE = 16
DEFAULT_METADATA_FONT = "/usr/share/fonts/TTF/DejaVuSans-Bold.ttf"
DEFAULT_TIMESTAMP_FONT_SIZE = 12

# Defaults
DEFAULT_METADATA_FONT = "/usr/share/fonts/TTF/DejaVuSans-Bold.ttf"
DEFAULT_TIMESTAMP_FONT = "/usr/share/fonts/TTF/DejaVuSans.ttf"
FALLBACK_FONTS = [
"/Library/Fonts/Arial Unicode.ttf"
]
FALLBACK_FONTS = ["/Library/Fonts/Arial Unicode.ttf"]

# Replace defaults on Windows to support unicode/CJK and multiple fallbacks
if os.name == 'nt':
DEFAULT_METADATA_FONT = "C:/Windows/Fonts/msgothic.ttc"
DEFAULT_TIMESTAMP_FONT = "C:/Windows/Fonts/msgothic.ttc"
FALLBACK_FONTS = [
"C:/Windows/Fonts/simsun.ttc",
"C:/Windows/Fonts/Everson Mono.ttf",
"C:/Windows/Fonts/calibri.ttf",
"C:/Windows/Fonts/arial.ttf"
]

DEFAULT_CONTACT_SHEET_WIDTH = 1500
DEFAULT_DELAY_PERCENT = None
DEFAULT_START_DELAY_PERCENT = 7
Expand Down

0 comments on commit c904a99

Please sign in to comment.