freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Wrote a tiny Python 3 script to extract SVG Documents out of


From: Moazin Khatri
Subject: [ft-devel] Wrote a tiny Python 3 script to extract SVG Documents out of a OT-SVG font
Date: Sat, 18 May 2019 17:58:44 +0500

Hi Toshiya,

However, to proceed to next step, I should prepare some sample SVGs which are precisely fitting to the feature range of SVG Native,
and which we can understand "correct" rendering result. It seems that svgnative/test files are not precisely
fitting to the feature range of SVG Native (thus, testSkia result is different from that by rsvg-convert).

I have written a very small Python 3 script that can read OT files and extract SVG documents out of it. 

You can find it here: https://github.com/moazin/font-file-reader

I have tried to make it generalized enough so that it can be easily modified to support more tables. For now, the README will tell you the default behavior of the script. It can be modified with a basic knowledge of Python. If you want me to document it or if you have any questions, feel free to ask me, I'd love to help.

You can extract the glyphs using this script and render them using any tool you want. However, your browser and some other SVG renderers might not render these properly because of the coordinate system inversion.  However, I have found an online editor that can show you the results. You can find it here http://vectorpaint.yaks.co.nz/. You'll need to zoom out to see the glyph (because of coordinate system inversion again). 

You can grab some free SVG based fonts from here:  https://www.colorfonts.wtf/

Note that this is very basic and might not work with all fonts. Also, GZIP encoded SVG documents are not supported at the moment.

I know tools like these can be easily found online. I just did it as to get some practice, since I'd be eventually doing this in C inside FreeType when my coding time starts. I'd be happy if this helps anyone! :)

Regards,
Moazin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]