Added ACC flipping of page
Python CI / test (3.12) (push) Successful in 7m18s
Python CI / test (3.13) (push) Successful in 7m7s

This commit is contained in:
2025-11-11 12:58:34 +01:00
parent 70c0b4a1f2
commit a1775baa76
6 changed files with 635 additions and 7 deletions
+26 -2
View File
@@ -507,7 +507,28 @@ class EbookReader:
Current font scale factor
"""
return self.settings_manager.get_font_size()
def set_font_family(self, font_family) -> Optional[Image.Image]:
"""
Set the font family and re-render current page.
Args:
font_family: BundledFont enum value (SERIF, SANS, MONOSPACE) or None for document default
Returns:
PIL Image of the re-rendered page
"""
return self.settings_manager.set_font_family(font_family)
def get_font_family(self):
"""
Get the current font family.
Returns:
Current BundledFont or None if using document default
"""
return self.settings_manager.get_font_family()
def set_line_spacing(self, spacing: int) -> Optional[Image.Image]:
"""
Set line spacing using pyWebLayout's native support.
@@ -989,6 +1010,8 @@ class EbookReader:
line_spacing = self.page_style.line_spacing
inter_block_spacing = self.page_style.inter_block_spacing
word_spacing = self.page_style.word_spacing
font_family = self.get_font_family()
font_family_name = font_family.name if font_family else "Default"
# Use the Settings sub-application
overlay_subapp = self._overlay_subapps[OverlayState.SETTINGS]
@@ -997,7 +1020,8 @@ class EbookReader:
font_scale=font_scale,
line_spacing=line_spacing,
inter_block_spacing=inter_block_spacing,
word_spacing=word_spacing
word_spacing=word_spacing,
font_family=font_family_name
)
# Update state