ockham opened this issue on Aug 12, 2013 · 6 posts
ockham posted Fri, 16 August 2013 at 7:11 PM
Update: After trying those tools and looking around, I think I've found the right path.
I'm starting with a whole bunch of code that involves text and images and vector lines, which I wrote up in a private 'language' for a Windows-based courseware engine that I also wrote. The whole bunch of code needs to be converted into HTML5 so it can be run by platform-independent commercial courseware engines like Moodle.
A few lines of my code:
=============================
ITEM LABEL TERMSULC
LOC 89 210
BLINK
LINECOLOR 3
LINEWIDTH 5
SHAPE -43 25 L
SHAPE -12 18 L
SHAPE 15 9 L
SHAPE 34 30 L
SHAPE 101 189 M
@Terminal sulcus
}
ITEM LABEL FORCEC
LOC 114 190
BLINK
LINECOLOR 7
LINEWIDTH 7
SHAPE -3 19 L
SHAPE 93 205 M
@Foramen cecum
HTML5 has two different graphics systems: Canvas and SVG. After a quick look, it's obvious that SVG is what I need. It has all the same vector commands in a different format.
Randomly picked piece of SVG:
==========================
<g
transform="translate(600,150)"
id="SecondHand">
<g
id="RotSecondHand">
<path
d="M 0,-82.5 L -2.5,-75 L -4.71875,-8.8125 C -7.85655,-7.12467 -10,-3.81029 -10,0 C -10,3.9979 -7.64307,7.43129 -4.25,9.03125 L -2.5,30 L 2.5,30 L 4.25,9.03125 C 7.64307,7.43129 10,3.9979 10,0 C 10,-3.81029 7.85655,-7.12467 4.71875,-8.8125 L 2.5,-75 L 0,-82.5 z M 0,-2.5 C 1.38,-2.5 2.5,-1.38 2.5,0 C 2.5,1.38 1.38,2.5 0,2.5 C -1.38,2.5 -2.5,1.38 -2.5,0 C -2.5,-1.38 -1.38,-2.5 0,-2.5 z "
style="opacity:1;fill:#800000;stroke:black"
id="SecondHandPath" />
==================================
Same underlying commands, different format.
After choosing SVG, I looked around and found Inkscape, which is pretty clearly the best free tool for building SVG from scratch or from existing images and lines.
http://inkscape.org/
I may use Inkscape directly for the whole conversion, or I may use it for some trial conversions until I understand the 'mapping', and then write a mass converter in Python. Most likely the latter.
=====================================
Thanks again for the suggestions! They helped to guide me in the right direction.