Skip to content

HTML reports & new shaping glue crate#87

Merged
RickyDaMa merged 35 commits into
mainfrom
html-reports
Oct 31, 2025
Merged

HTML reports & new shaping glue crate#87
RickyDaMa merged 35 commits into
mainfrom
html-reports

Conversation

@RickyDaMa
Copy link
Copy Markdown
Collaborator

@RickyDaMa RickyDaMa commented Oct 23, 2025

This started as a quest to add visual HTML reports to the CLI, and somehow spawned an entirely new crate.

Basically, shaping details that were buried in private API within fontheight made sense to be re-used for the CLI's HTML reports, but didn't make sense (in my opinion) to surface as fontheight APIs, so I spun out the code into harfshapedfa, a dedicated glue crate. This has resulted in breaking changes for fontheight.

Tracking the API movements by looking at the diffs is going to be very challenging. I'd advise reviewing the code at face value, and review the higher level API movements through the documentation. I've endeavoured to cover everything, and checked with cargo semver-checks.

@RickyDaMa RickyDaMa requested a review from Hoolean October 23, 2025 16:25
@RickyDaMa RickyDaMa self-assigned this Oct 23, 2025
@RickyDaMa RickyDaMa added the cli Impacts the fontheight CLI program label Oct 23, 2025
@RickyDaMa RickyDaMa added the core Impacts the fontheight Rust library crate label Oct 24, 2025
@RickyDaMa RickyDaMa marked this pull request as ready for review October 30, 2025 11:41
RickyDaMa and others added 23 commits October 30, 2025 11:41
Add --output and --html to CLI
Use maud to put together HTML
Extract a bunch of lines from metrics
Write extension traits for harfrust types for better interaction with ShapingMeta
Make Location insertion-order preserving (with IndexMap) and reject NaN axis values
Really inefficiently, but baby steps
Add PartialEq, Eq, and PartialOrd to Location
Correctly advance width & height
Swap order of pens
Co-authored-by: Harry Dalton <harry.dalton@daltonmaag.com>
Create caches which are re-used (also helps with log flooding)
Adjust SVG size to biggest bounds of any word, not biggest metrics
Use ordered-float in html.rs
Remove OffsetPen
Use groups and more relative co-ordinates

Co-authored-by: Jany Belluz <jany.belluz@daltonmaag.com>
Rename BoundsPen::bounding_box to bounds
Add BoundsPen::control_bounds
Make Location::partial_cmp less unsound
Rename utils to convert
Remove bogus return values from convert::iso639_to_opentype
Change Location::to_harfrust to return an iterator
@RickyDaMa RickyDaMa force-pushed the html-reports branch 2 times, most recently from 834466e to f0283ce Compare October 30, 2025 12:29
@RickyDaMa RickyDaMa changed the title HTML reports HTML reports & new shaping glue crate Oct 30, 2025
# Make sure CI fails on all warnings, and pretend we're docs.rs
env:
RUSTFLAGS: "-Dwarnings -Adead-code -Aunused-imports -Aunused-macros"
# FIXME: in future, use the below to better match docs.rs. At the time of
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, let's move the TODOs and FIXMEs in this file into issues

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do after merging!

Comment thread cli/src/fmt/html.rs
Comment thread cli/src/fmt/html.rs
Comment thread cli/src/fmt/html.rs
Comment thread cli/src/fmt/html.rs
Comment thread cli/src/fmt/html.rs Outdated
Comment thread cli/src/fmt/html.rs Outdated
Comment thread harfshapedfa/Cargo.toml
@RickyDaMa RickyDaMa merged commit 4575013 into main Oct 31, 2025
8 checks passed
@RickyDaMa RickyDaMa deleted the html-reports branch October 31, 2025 11:48
@RickyDaMa RickyDaMa mentioned this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Impacts the fontheight CLI program core Impacts the fontheight Rust library crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants