mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Conversion: Do not rescale fonts sizes/adjust line heights for text based drop caps defined using a separate <span> tag (note that drop caps defined using :first-letter were already handled correctly)
This commit is contained in:
parent
e708f0f183
commit
d10a1a0b90
@ -363,7 +363,10 @@ class CSSFlattener(object):
|
||||
cssdict['font-weight'] = 'normal' # ADE chokes on font-weight medium
|
||||
|
||||
fsize = font_size
|
||||
if not self.context.disable_font_rescaling:
|
||||
is_drop_cap = (cssdict.get('float', None) == 'left' and 'font-size' in
|
||||
cssdict and len(node) == 0 and node.text and
|
||||
len(node.text) == 1)
|
||||
if not self.context.disable_font_rescaling and not is_drop_cap:
|
||||
_sbase = self.sbase if self.sbase is not None else \
|
||||
self.context.source.fbase
|
||||
dyn_rescale = dynamic_rescale_factor(node)
|
||||
@ -382,7 +385,7 @@ class CSSFlattener(object):
|
||||
|
||||
try:
|
||||
minlh = self.context.minimum_line_height / 100.
|
||||
if style['line-height'] < minlh * fsize:
|
||||
if not is_drop_cap and style['line-height'] < minlh * fsize:
|
||||
cssdict['line-height'] = str(minlh)
|
||||
except:
|
||||
self.oeb.logger.exception('Failed to set minimum line-height')
|
||||
|
Loading…
x
Reference in New Issue
Block a user