Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support COLR v1 table. #133

Closed
wants to merge 3 commits into from
Closed

Support COLR v1 table. #133

wants to merge 3 commits into from

Conversation

RazrFalcon
Copy link
Collaborator

TODO:

  • ClipList table
  • Variations
  • PaintColrGlyph
  • Recursion detection
  • Documentation
  • Tests

@RazrFalcon
Copy link
Collaborator Author

@laurmaedje beta quality, but seems to be working ok-ish. Here is font2svg output:

sample

Some stuff is hard to represent in SVG, like weird transforms order, sweep gradients, gradients rotation (?), some blending modes.

For you this just a progress report and you can try out the new API.
PS: I've added colr::Table::is_simple to reject v1 tables in case you do not plan to support them yet.

Copy link
Contributor

@laurmaedje laurmaedje left a comment

Choose a reason for hiding this comment

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

Nice work! There are two minor things I noticed while reading.

src/lib.rs Outdated
Transform { a, b, c, d, e, f }
}

#[cfg(feature = "variable-fonts")]
Copy link
Contributor

Choose a reason for hiding this comment

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

this cfg is a bit strange

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we should either make it private, as it was before, or remove cfg altogether.

src/tables/colr.rs Show resolved Hide resolved
@yisibl
Copy link
Contributor

yisibl commented Oct 9, 2023

Some stuff is hard to represent in SVG, like weird transforms order, sweep gradients, gradients rotation (?), some blending modes.

About sweep gradients: Lorp/samsa-core#3

With the stagnation of the SVG2 specification(issue), SVG can no longer keep up with the times.

@RazrFalcon
Copy link
Collaborator Author

That hack would work only in a browser. And we can ignore sweep gradients completely for now. font2svg is just a demo. It doesn't have to be perfect.

@yisibl
Copy link
Contributor

yisibl commented Oct 12, 2023

Maybe this helps, FYI. googlefonts/oxidize#48

@RazrFalcon
Copy link
Collaborator Author

It's a bit different, but thanks.

@RazrFalcon
Copy link
Collaborator Author

@laurmaedje I've published a new ttf-parser with COLR v0. No timeline for v1.

@LaurenzV
Copy link
Contributor

If you think you don't have time to finish it, I can look into finishing this in the next few weeks.

@RazrFalcon
Copy link
Collaborator Author

Yeah, no plans for this month. And it's a tricky beast.

Maybe would have time to at least update the ttf-explorer.

Test font.

@LaurenzV
Copy link
Contributor

Do you know if there is also some way I can view the "reference" of how each glyph is supposed to look to compare? Something like font2svg, but where we know that it (should) already work correctly.

@LaurenzV
Copy link
Contributor

Okay, looks like hb-view supports it. I think I should be able to work with that.

@RazrFalcon
Copy link
Collaborator Author

I was using Chrome.

@LaurenzV
Copy link
Contributor

Could you tell me how exactly you used Chrome to test it? So how did you make it show the glyphs that you wanted to test?

@RazrFalcon
Copy link
Collaborator Author

@RazrFalcon
Copy link
Collaborator Author

Superseded by #145

@RazrFalcon RazrFalcon closed this May 8, 2024
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.

4 participants