GLBasic forum

Codesnippets => Code Snippets => Topic started by: loganite on 2008-Jan-17

Title: SVG vector graphics and fonts
Post by: loganite on 2008-Jan-17
svgpaths.zip - 0.33MB (http://www.zshare.net/download/6612875d464371/)


I was thinking if I could render an SVG path in GL Basic then I could build scalable, rotatable fonts and graphics that could be created easily in programs like inkscape.

I created the project above to demonstrate the principle and thought I would share it in case anyone was thinking or doing something along the same lines.

On the subject of fonts in particular, I used inkscape to create the paths but I know there is a program which can convert truetype fonts to SVG paths. I think it would be possible to reduce the whole project down to 2 keywords something like

loadFontPath ,
drawVectorText ,,,,,

If anyones interested in me taking it further let me know.
Title: SVG vector graphics and fonts
Post by: bigsofty on 2008-Jan-18
Well done, very interesting... how would I produce the spline data ("I$")?
Title: SVG vector graphics and fonts
Post by: loganite on 2008-Jan-18
I used a free vector drawing package called Inkscape. It produces an XML file. In the file you can find the spline data.

Inkscape can also convert fonts and bitmap images to paths.

There is still some work to do on some of the other types of points that can appear in a path (quadratic beizers for one) to support the SVG path standard completely.
Title: SVG vector graphics and fonts
Post by: bigsofty on 2008-Jan-19
Ah, I see.  As I said, this is quite interesting stuff, Ill be following your work ;)
Title: SVG vector graphics and fonts
Post by: loganite on 2008-Jan-22
ariblk.zip - 0.01MB (http://www.zshare.net/download/67763587a9394c/)

this is a new version

i used a freeware truetype to SVG font converter to create the data which can be found at

http://xmlgraphics.apache.org/batik/tools/font-converter.html

i had to hack the file because it was over 256 lines ( a limit of GL Basic). which is a shame cos it contained kerning data which i could have used.
Title: SVG vector graphics and fonts
Post by: Kitty Hello on 2008-Jan-23
Use OPENFILE and READLINE - there's no limit with them.
Title: SVG vector graphics and fonts
Post by: loganite on 2008-Jan-23
Quote from: GernotFrischUse OPENFILE and READLINE - there's no limit with them.
Doh! I missed that, LOL
Title: SVG vector graphics and fonts
Post by: bigsofty on 2008-Jan-24
Worked fine here, if a little slow, may be my old computer though! :P