@@ -53,7 +53,15 @@ def paragraph_layouter(paragraph: Paragraph, page: Page, start_word: int = 0, pr
|
||||
text_align = Alignment.LEFT # Default alignment
|
||||
else:
|
||||
# paragraph.style is an AbstractStyle, resolve it
|
||||
rendering_context = RenderingContext(base_font_size=paragraph.style.font_size)
|
||||
# Ensure font_size is an int (it could be a FontSize enum)
|
||||
from pyWebLayout.style.abstract_style import FontSize
|
||||
if isinstance(paragraph.style.font_size, FontSize):
|
||||
# Use a default base font size, the resolver will handle the semantic size
|
||||
base_font_size = 16
|
||||
else:
|
||||
base_font_size = int(paragraph.style.font_size)
|
||||
|
||||
rendering_context = RenderingContext(base_font_size=base_font_size)
|
||||
style_resolver = StyleResolver(rendering_context)
|
||||
style_registry = ConcreteStyleRegistry(style_resolver)
|
||||
concrete_style = style_registry.get_concrete_style(paragraph.style)
|
||||
|
||||
Reference in New Issue
Block a user