|
wxMaxima
|
A wxBitmap with a constructor that generates the image from SVG. More...
#include <SvgBitmap.h>
Public Member Functions | |
| SvgBitmap (wxWindow *window, const unsigned char *data, const size_t len, int width=640, int height=480) | |
| Renders an SVG image. | |
| SvgBitmap (wxWindow *window, const unsigned char *data, const std::size_t len, wxSize siz) | |
| SvgBitmap (SvgBitmap &&)=delete | |
| SvgBitmap & | operator= (SvgBitmap &&o) noexcept |
| const SvgBitmap & | SetSize (int width, int height) |
| Sets the bitmap to a new size and renders the svg image at this size. | |
| const SvgBitmap & | SetSize (wxSize siz) |
| Sets the bitmap to a new size and renders the svg image at this size. | |
Static Public Member Functions | |
| static bool | RendersText () |
| Does the SVG renderer wxWidgets was built with draw text? | |
| static wxString | TextRenderingDiagnosis (bool rendersText) |
| Why SVG plots are available or not, given RendersText()'s result. | |
| static wxBitmap | GetInvalidBitmap (int targetSize) |
| An "invalid bitmap" sign. | |
A wxBitmap with a constructor that generates the image from SVG.
The rendering is done by wxWidgets (wxBitmapBundle::FromSVG()); this class only unpacks our embedded data and keeps the bundle around, so a new size is rendered from the vector data again rather than scaled from pixels.
| SvgBitmap::SvgBitmap | ( | wxWindow * | window, |
| const unsigned char * | data, | ||
| const size_t | len, | ||
| int | width = 640, |
||
| int | height = 480 |
||
| ) |
Renders an SVG image.
| window | Unused; kept so the call sites read as before |
| data | The SVG, either as text or gzip-compressed |
| len | The length of data in bytes |
|
static |
Does the SVG renderer wxWidgets was built with draw text?
Only LunaSVG does (wxWidgets >= 3.3.2, built with LunaSVG on and NanoSVG off); NanoSVG ignores text altogether, which would leave a plot without its labels and tick marks' numbers. Found out by rendering a word set in the font gnuplot's svg terminal asks for, so this also says no if the renderer can find neither that font nor its fallback. Rendered once, on first use, which has to be on the GUI thread, and logs TextRenderingDiagnosis() then, since the option for scalable plots is hidden without it.
|
static |
Why SVG plots are available or not, given RendersText()'s result.
Says which SVG renderer wxWidgets was built with and what would enable scalable plots. Not translated: it is meant for a bug report.