Fix style cascade and rendering bugs (Phase 3 Track B Task 3)#5
Open
kevincarlson wants to merge 2 commits into
Open
Fix style cascade and rendering bugs (Phase 3 Track B Task 3)#5kevincarlson wants to merge 2 commits into
kevincarlson wants to merge 2 commits into
Conversation
Bug 1 — Percentage font size not cascaded correctly: - Add FontSizePercentage float? to ParagraphStyleDef so fo:font-size="150%" can be stored without loss. - OdfDocumentParser.ParseParaDef splits raw font-size values into either absolute points or a percentage multiplier via new ParseFontSize helper. - OdfStyleResolver.ApplyPara resolves percentage values relative to the running FontSizePts at each cascade level (defaulting to 12pt at root), so Heading styles with percentage sizes produce correct point values. Bug 2 — Bold flag not reflected in FontDescriptor: - OdfStyleResolver.ResolveCharacter now synchronises Font.Weight with the resolved Bold flag after the full cascade, ensuring IFontManager receives a FontDescriptor.Weight == Bold when Bold == true. Bug 3 — Bullet points not rendered for list items: - OdfDocumentParser.ParseParaDef reads style:list-style-name into ParagraphStyleDef.ListStyleId so list paragraphs carry their list id. - OdfStyleResolver.ResolveNamedStyleId (new public method) walks the automatic-style parent chain to return the named style id; used by OdfDocumentParser.ParseParagraph to store a recognisable StyleName on ParagraphNode (e.g. "Heading_20_1" instead of auto-style "P1"). - PaintSceneBuilder now requires IFontManager + ILokiLogger, creates a LokiTextShaper, and emits a shaped bullet GlyphRunNode before the first line of any list-item paragraph, indenting the following text by bulletWidth + 6pt. Bullet character depends on ListLevel (•/◦/▪). - LayoutEngine passes its font manager and logger to PaintSceneBuilder. Add StyleResolverBugFixTests.cs with 6 regression tests covering all three bugs plus integration verification against tests/corpus/writer/simple.fodt. https://claude.ai/code/session_01MwZSF1NiXAiAtYgDy6AHUv Signed-off-by: Claude <noreply@anthropic.com>
OdfStyleResolver is internal but StyleResolverBugFixTests calls it directly for unit testing. Add InternalsVisibleTo for AppThere.Loki.Tests.Writer in the Format.Odf csproj so tests can access it without changing its production visibility. https://claude.ai/code/session_01MwZSF1NiXAiAtYgDy6AHUv Signed-off-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug 1 — Percentage font size not cascaded correctly:
Bug 2 — Bold flag not reflected in FontDescriptor:
Bug 3 — Bullet points not rendered for list items:
Add StyleResolverBugFixTests.cs with 6 regression tests covering all three bugs plus integration verification against tests/corpus/writer/simple.fodt.
https://claude.ai/code/session_01MwZSF1NiXAiAtYgDy6AHUv