-
-
Notifications
You must be signed in to change notification settings - Fork 417
/
import-svg.h
32 lines (21 loc) · 1.15 KB
/
import-svg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include "../core/Shape.h"
#ifndef MSDFGEN_DISABLE_SVG
#ifndef MSDFGEN_EXT_PUBLIC
#define MSDFGEN_EXT_PUBLIC // for DLL import/export
#endif
namespace msdfgen {
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_FAILURE;
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_SUCCESS_FLAG;
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_PARTIAL_FAILURE_FLAG;
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_INCOMPLETE_FLAG;
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_UNSUPPORTED_FEATURE_FLAG;
extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_TRANSFORMATION_IGNORED_FLAG;
/// Builds a shape from an SVG path string
bool buildShapeFromSvgPath(Shape &shape, const char *pathDef, double endpointSnapRange = 0);
/// Reads a single <path> element found in the specified SVG file and converts it to output Shape
bool loadSvgShape(Shape &output, const char *filename, int pathIndex = 0, Vector2 *dimensions = NULL);
/// New version - if Skia is available, reads the entire geometry of the SVG file into the output Shape, otherwise may only read one path, returns SVG import flags
int loadSvgShape(Shape &output, Shape::Bounds &viewBox, const char *filename);
}
#endif