mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix font size changes not applying to monospaced fonts. Fixes #1876580 [Re: calibre bug 1875021 (Viewer: Some font size cannot be influenced by A+ or A-)](https://bugs.launchpad.net/calibre/+bug/1876580)
This commit is contained in:
parent
4c06764684
commit
2af560fe8a
@ -317,6 +317,7 @@ def apply_font_settings(page_or_view):
|
||||
s.setFontFamily(s.StandardFont, s.fontFamily(sf))
|
||||
old_minimum = s.fontSize(s.MinimumFontSize)
|
||||
old_base = s.fontSize(s.DefaultFontSize)
|
||||
old_fixed_base = s.fontSize(s.DefaultFixedFontSize)
|
||||
mfs = fs.get('minimum_font_size')
|
||||
if mfs is None:
|
||||
s.resetFontSize(s.MinimumFontSize)
|
||||
@ -325,8 +326,10 @@ def apply_font_settings(page_or_view):
|
||||
bfs = sd.get('base_font_size')
|
||||
if bfs is not None:
|
||||
s.setFontSize(s.DefaultFontSize, bfs)
|
||||
s.setFontSize(s.DefaultFixedFontSize, int(bfs * 13 / 16))
|
||||
|
||||
font_size_changed = old_minimum != s.fontSize(s.MinimumFontSize) or old_base != s.fontSize(s.DefaultFontSize)
|
||||
font_size_changed = (old_minimum, old_base, old_fixed_base) != (
|
||||
s.fontSize(s.MinimumFontSize), s.fontSize(s.DefaultFontSize), s.fontSize(s.DefaultFixedFontSize))
|
||||
if font_size_changed and hasattr(page_or_view, 'execute_when_ready'):
|
||||
page_or_view.execute_when_ready('viewer_font_size_changed')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user