SVG vector graphics and fonts

Previous topic - Next topic

loganite

svgpaths.zip - 0.33MB


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.

bigsofty

Well done, very interesting... how would I produce the spline data ("I$")?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

loganite

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.

bigsofty

Ah, I see.  As I said, this is quite interesting stuff, Ill be following your work ;)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

loganite

ariblk.zip - 0.01MB

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.

Kitty Hello

Use OPENFILE and READLINE - there's no limit with them.

loganite

Quote from: GernotFrischUse OPENFILE and READLINE - there's no limit with them.
Doh! I missed that, LOL

bigsofty

Worked fine here, if a little slow, may be my old computer though! :P
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)