Allow pixel based adjustments as well

This commit is contained in:
Kovid Goyal
2022-07-15 11:45:43 +05:30
parent c910f483bf
commit 1aa50b73a1
6 changed files with 19 additions and 10 deletions

View File

@@ -824,6 +824,9 @@ def modify_font(val: str) -> Iterable[Tuple[str, FontModification]]:
if sz.endswith('%'):
munit = ModificationUnit.percent
sz = sz[:-1]
elif sz.endswith('px'):
munit = ModificationUnit.pixel
sz = sz[:-2]
try:
mvalue = float(sz)
except Exception: