photopea / Typr.js

Typr.js - process fonts in Javascript
MIT License
914 stars 73 forks source link

Add SVG table parser for svg color font parsing #17

Closed kingschnulli closed 6 years ago

kingschnulli commented 6 years ago

see https://www.colorfonts.wtf/ and https://www.microsoft.com/typography/otspec/svg.htm

This currently only parses the data, maybe the utilities could add some methods to draw all of this into a canvas context. What do you think?

photopea commented 6 years ago

As I understand, you implemented just parsing, not the rendering mechanism?

kingschnulli commented 6 years ago

Yes this is currently just the parsing part - i tested the output with a simple test script that just draws the parsed svg information into the page. This looks good so far, as there is just a limited set of fonts that have this feature currently I could only test a few.

I wanted to discuss what would be the best way to implement the rendering before adding that.

photopea commented 6 years ago

I already implemented the SVG rendering, I will update it here today.

photopea commented 6 years ago

I just updated the library, I slightly edited your SVG.js (added SVG parsing). Try to open your colored fonts in https://photopea.github.io/Typr.js/ :)

kingschnulli commented 6 years ago

This is awesome, thanks for implementing this part.

photopea commented 6 years ago

Thank you for telling me that such thing exists :D

photopea commented 6 years ago

You can try it HERE.