This PR starts adding support for rendering documents as a stream of SVG commands (as text, in HTML format). The new SVG rendering facilities are independent of the existing bitmap related methods and both can be used simultaneously.
Limitations
For now there are neither IDs nor classes in SVG elements. Therefore, the SVG code for notes, rests and other music notation elements can not be identified, styled and manipulated by the user application. I expect to add all these in coming PRs.
For now the only formatting option for SVG output is to add a line break after each SVG element. Default value is false (do not add new lines) for maximum compactness of generated code.
The SVG rendition does not include any Lomse visual effects (tempo line, cursor, markers, etc.) as all them should be treated differently in SVG oriented applications.
Usage example
See file /examples/svg/svg-minimal.cpp
I will soon update the API documentation to add information about generating SVG with Lomse.
Changes
Added SVG usage example in folder /examples/svg/.
Added class SvgDrawer and struct SvgOptions.
Added new methods in Interactor and GraphicView related to SVG.
Moved helper classes LineVertexSource, MarkerVertexSource and LineCapsConverter from lomse_bitmap_drawer.cpp to lomse_drawer.h, so that they can be used from any Drawer derived class.
Fixed GmoShapeWord and GmoShapeTexton_paint() methods: set font has to be done by the Drawer class not by the TextMeter class.
Now all objects providing vertices derive from VertexSource. Signature of method rewind(int) changed to rewind(unsigned) where required.
Other non-related changes
Removed unused member variable m_pTextMeter in BitmapDrawer
Fix in GmoShapeGlyph removing incorrect unnecessary code.
This PR starts adding support for rendering documents as a stream of SVG commands (as text, in HTML format). The new SVG rendering facilities are independent of the existing bitmap related methods and both can be used simultaneously.
Limitations
false
(do not add new lines) for maximum compactness of generated code.Usage example See file /examples/svg/svg-minimal.cpp
Modify lines 36 & 50 as desired and build with:
I will soon update the API documentation to add information about generating SVG with Lomse.
Changes
/examples/svg/
.SvgDrawer
and structSvgOptions
.Interactor
andGraphicView
related to SVG.LineVertexSource
,MarkerVertexSource
andLineCapsConverter
fromlomse_bitmap_drawer.cpp
tolomse_drawer.h
, so that they can be used from anyDrawer
derived class.GmoShapeWord
andGmoShapeText
on_paint()
methods: set font has to be done by theDrawer
class not by theTextMeter
class.VertexSource
. Signature of methodrewind(int)
changed torewind(unsigned)
where required.Other non-related changes
m_pTextMeter
inBitmapDrawer