mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-11-19 16:39:20 +02:00
name_parser: Correct output on weight check
[why] When the weight check fails for some input the reason is not shown correctly (i.e. not the string that actually failed). [how] Display exactly the failed string in the warning. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
809101da32
commit
89f1325205
@ -285,10 +285,10 @@ class FontnameParser:
|
||||
name_weight = FontnameTools.weight_string_to_number(weight)
|
||||
weightproblem = False
|
||||
if ps_weight is None:
|
||||
self.logger.warn('Can not parse PS-weight: {}'.format(restored_weight_token))
|
||||
self.logger.warn('Can not parse PS-weight: {}'.format(font.weight))
|
||||
weightproblem = True
|
||||
if name_weight is None:
|
||||
self.logger.warn('Can not parse name for weight: {}'.format(restored_weight_token))
|
||||
self.logger.warn('Can not parse name for weight: {}'.format(weight))
|
||||
weightproblem = True
|
||||
if weightproblem or abs(os2_weight - ps_weight) > 50 or abs(os2_weight - name_weight) > 50:
|
||||
self.logger.warning('Possible problem with the weight metadata detected, check with --debug')
|
||||
|
Loading…
Reference in New Issue
Block a user