The library provides wxWidgets controls and methods for rendering svg path data and svg fonts (WebFonts sush as "Font Awesome"). Supports wxGraphicsContext, Cairo and Direct2D backends. Temporary arcTo path element not implemented. The library also provided wxWidgets control and path viewer application based on this widget.
- wxWidgets (viewers and controls)
- Catch (tests) - optional
- Cairo (cairo rendering backend) - optional
Creating control for showing svg font glyph:
#include <svgglyphctrl.h>
#include <svgfont.h>
// somewhere in UI-related code
SvgFont font(L"font.svg");
SvgGlyphCtrl *glyphCtrl = new SvgGlyphCtrl(parent, wxID_ANY, font.GetGlyph(0xf000),
fontSize, wxALIGN_CENTER);
Generating wxBitmap from svg font glyph:
#include <wxcontext.h>
#include <svgfont.h>
SvgFont font(L"font.svg");
wxBitmap bitmap = GetBitmapForGlyph(font.GetGlyph(0xf020), fontSize, fontColor, bgColor);
mkdir build
cd build
cmake ..
make
If you have a custom wxWidgets build pass -DwxWidgets_CONFIG_EXECUTABLE=<path to wx-config>
mkdir build
cd build
cmake -G "NMake Makefiles" -DwxWidgets_ROOT_DIR=<path to wxWidgets> ..
nmake
You can pass wxWidgets_LIB_DIR
instead of wxWidgets_ROOT_DIR
if it is not working
-DTESTS=1/0
for enable or disable tests from build. Execute wget -P tests https://github.com/catchorg/Catch2/releases/download/v2.0.1/catch.hpp
in source root directory for fetching dependency (Catch 1.2.1)
-DVIEWERS=1/0
for enable or disable viewers from build
-DSAMPLES=1/0
for enable or disable samples from build