mirror of
https://github.com/pklaus/brother_ql_web.git
synced 2024-05-25 11:56:53 +03:00
[buf fix] Skip fonts that are not properly reported by fc-list
Thanks @jmcwhirter and @ukmattbrock for reporting the issue fixes #24, closes #24, closes #18
This commit is contained in:
parent
8ddbe95505
commit
b1783cfa4a
|
@ -20,6 +20,10 @@ def get_fonts(folder=None):
|
|||
if not line: continue
|
||||
if 'otf' not in line and 'ttf' not in line: continue
|
||||
parts = line.split(':')
|
||||
if 'style=' not in line or len(parts) < 3:
|
||||
# fc-list didn't output all desired properties
|
||||
logger.warn('skipping invalid font %s', line)
|
||||
continue
|
||||
path = parts[0]
|
||||
families = parts[1].strip().split(',')
|
||||
styles = parts[2].split('=')[1].split(',')
|
||||
|
|
Loading…
Reference in New Issue
Block a user