diff --git a/README.md b/README.md index 1a84f21..cea5597 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + # SvgPanel A wxPanel which can show svg image and simple text labels. @@ -7,7 +9,7 @@ The code contains two parts: Note that currently, [memononen/nanosvg: Simple stupid SVG parser](https://github.com/memononen/nanosvg) does not support parsing the `Text` field in `svg` file. I have modifed `nanosvg.h` to support parsing the `Text` field in the SVG file. I mainly followed commits in this pull request: [Adds basic text parsing by jamislike · Pull Request #94 · memononen/nanosvg](https://github.com/memononen/nanosvg/pull/94), but with some extra code changes, Also, I have merged from the latest master code of nanosvg. -The `svg_panel.h` and `svg_panel.cpp` files are modifed to extract the `Text` field and show them by wxWidgets' `DrawText` function. So, basically, the rasterizer from nanosvg is used to generated the background wxBitmap image, and later text labels were drawn on top of the wxBitmap image. +The `svg_panel.h` and `svg_panel.cpp` files are modifed to extract the `Text` field and show them using `wxGraphicsContext::DrawText` (with the Direct2D renderer for antialiasing). So, basically, the rasterizer from nanosvg is used to generated the background wxBitmap image, and later text labels were drawn on top of the wxBitmap image. Note that text rendering relies on the Direct2D renderer, so it is currently supported on Windows. Here is the screen shot of a svg file `drawing.svg` shown in the panel compared with shown in the [Inkscape editor](https://inkscape.org/). You can also open the svg file in the web browser directly for a comparsion.