mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Handle negative font sizes better.
This commit is contained in:
parent
724c852a4c
commit
efabf65955
@ -125,10 +125,15 @@ class Span(_Span):
|
||||
|
||||
|
||||
def font_size(val):
|
||||
# Assumes a 10 pt font (14 pixels) has fontsize 100
|
||||
ans = None
|
||||
unit = Span.unit_convert(val, dpi, 14)
|
||||
normal = 14
|
||||
unit = Span.unit_convert(val, dpi, normal)
|
||||
if unit:
|
||||
# Assume a 10 pt font (14 pixels) has fontsize 100
|
||||
if unit < 0:
|
||||
unit = normal + unit
|
||||
if unit < 0:
|
||||
unit = normal
|
||||
ans = int(unit * (72./dpi) * 10)
|
||||
else:
|
||||
if "xx-small" in val:
|
||||
|
Loading…
x
Reference in New Issue
Block a user