Skip to content

Feature to embed fonts#40

Merged
erweixin merged 7 commits intoerweixin:mainfrom
jangernert:embed
Apr 13, 2026
Merged

Feature to embed fonts#40
erweixin merged 7 commits intoerweixin:mainfrom
jangernert:embed

Conversation

@jangernert
Copy link
Copy Markdown
Contributor

Fixes #38

Only ratex-svg at the moment to wait for feedback about the PR first.

@erweixin erweixin self-assigned this Apr 12, 2026
@erweixin erweixin self-requested a review April 12, 2026 14:39
Comment thread crates/ratex-svg/Cargo.toml Outdated
ratex-font = { workspace = true, optional = true }
ratex-layout = { workspace = true, optional = true }
ratex-parser = { workspace = true, optional = true }
rust-embed = { version = "8.11.0", features = ["debug-embed"], optional = true }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Maybe we could move the rust-embed = 8.11.0 pin to the root Cargo.toml to keep it consistent across the workspace, and use { workspace = true, optional = true } here, since ratex-render will depend on it.

Comment thread crates/ratex-svg/src/standalone.rs Outdated
{
for (id, filename) in &font_map {
if let Some(font) = Fonts::get(filename) {
data.insert(*id, font.data.to_vec());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Small nit: consider erroring if any embedded font is missing (or if data.len() != font_map.len()), so we don’t return Ok with an empty/partial set—happy to drop if you prefer a softer fallback.

@erweixin
Copy link
Copy Markdown
Owner

Thanks very much for the PR — overall it looks great to me. I left two small suggestions.

It would also be appreciated if you could update the docs

@erweixin erweixin merged commit c37491c into erweixin:main Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed Fonts

2 participants