Repository navigation
Add support for embedded fonts and multi-column sections - #16
Merged
Merged
Conversation
- Introduced `EmbeddedFont` class to allow embedding fonts directly into HTML reports, ensuring self-contained documents without external font dependencies. - Added `RowStyle` class for row-specific styling options in reports. - Implemented `MultiColumnSection` class to facilitate multi-column layouts in reports, including functionality for measuring and rendering content across multiple columns. - Created unit tests for `EmbeddedFont`, `ApproximateTextMeasurer`, and `MultiColumnSection` to ensure correct behavior and edge case handling. - Added smoke tests for `PlaywrightTextMeasurer` to validate text measurement functionality.
| }) | ||
| .Build(); | ||
|
|
||
| var outputPath = Path.Combine(AppContext.BaseDirectory, "playwright-measured-report.html"); |
| } | ||
| } | ||
|
|
||
| var path = Path.Combine(Path.GetTempPath(), $"terrafluent-preview-{Guid.NewGuid():N}.html"); |
Comment on lines
+41
to
+44
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($"Could not open a browser automatically ({ex.Message}) - open the file above manually."); | ||
| } |
| /// <summary>Resolves paths to the font files shipped in the fonts/ folder next to the built sample.</summary> | ||
| internal static class SampleFonts | ||
| { | ||
| public static string Resolve(string fileName) => Path.Combine(AppContext.BaseDirectory, "fonts", fileName); |
- QrCodeImage: cast size to double before multiplying in LostPointLevel4 to avoid a possible int-multiplication-then-cast precision loss (CodeQL error; not exploitable given size <= 177, but worth being precise about). - QrCodeImage: extract IsFinderPatternDark/HasFinderLikeRatio helpers to de-duplicate and de-complexify the finder-pattern and masking-penalty conditions; use .Where(...) instead of foreach+if in two loops. - MultiColumnSection: use Any(...) instead of foreach+if for the nested-section validation check. All are behavior-preserving refactors - re-verified the QR encoder end-to-end against an independent decoder (pyzbar) across 7 values spanning versions 1-10 plus UTF-8 content; byte-for-byte identical PNG output to before the change. Full unit (162) and browser (7) test suites pass.
Comment on lines
+418
to
+420
| (r >= 0 && r <= 6 && (c == 0 || c == 6)) | ||
| || (c >= 0 && c <= 6 && (r == 0 || r == 6)) | ||
| || (r >= 2 && r <= 4 && c >= 2 && c <= 4); |
Comment on lines
+730
to
+732
| !at(1) && at(4) && !at(5) && at(6) && !at(9) | ||
| && ((at(0) && at(2) && at(3) && !at(7) && !at(8) && !at(10)) | ||
| || (!at(0) && !at(2) && !at(3) && at(7) && at(8) && at(10))); |
Owner
Author
|
merge |
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.
EmbeddedFontclass to allow embedding fonts directly into HTML reports, ensuring self-contained documents without external font dependencies.RowStyleclass for row-specific styling options in reports.MultiColumnSectionclass to facilitate multi-column layouts in reports, including functionality for measuring and rendering content across multiple columns.EmbeddedFont,ApproximateTextMeasurer, andMultiColumnSectionto ensure correct behavior and edge case handling.PlaywrightTextMeasurerto validate text measurement functionality.Summary
Related Issue
Type of Change
Checklist
dotnet build -c Releasesucceeds with no new warningsdotnet test -c ReleasepassesCHANGELOG.mdunder[Unreleased]docs/Output Impact
Notes for Reviewers