mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-12-19 20:12:52 +02:00
name-parser: Fix enable_short_families() with empty prefix
[why] Specifying an empty string as prefix unexpectedly does not enable short family names for all fonts - but for no font at all. Usually an empty prefix matches all strings (font names). This makes it hard to enable short families for all fonts no matter what. [how] Fix detection if the prefix is False or a string. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
037ab03f16
commit
f99e108273
@ -66,8 +66,8 @@ class FontnameParser:
|
|||||||
def enable_short_families(self, camelcase_name, prefix):
|
def enable_short_families(self, camelcase_name, prefix):
|
||||||
"""Enable short styles in Family when (original) font name starts with prefix; enable CamelCase basename in (Typog.) Family"""
|
"""Enable short styles in Family when (original) font name starts with prefix; enable CamelCase basename in (Typog.) Family"""
|
||||||
# camelcase_name is boolean
|
# camelcase_name is boolean
|
||||||
# prefix is either a string or False
|
# prefix is either a string or False/True
|
||||||
if prefix:
|
if isinstance(prefix, str):
|
||||||
prefix = self._basename.startswith(prefix)
|
prefix = self._basename.startswith(prefix)
|
||||||
self.use_short_families = ( camelcase_name, prefix )
|
self.use_short_families = ( camelcase_name, prefix )
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user