import-svg.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "../core/Shape.h"
  3. #ifndef MSDFGEN_DISABLE_SVG
  4. #ifndef MSDFGEN_EXT_PUBLIC
  5. #define MSDFGEN_EXT_PUBLIC // for DLL import/export
  6. #endif
  7. namespace msdfgen {
  8. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_FAILURE;
  9. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_SUCCESS_FLAG;
  10. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_PARTIAL_FAILURE_FLAG;
  11. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_INCOMPLETE_FLAG;
  12. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_UNSUPPORTED_FEATURE_FLAG;
  13. extern MSDFGEN_EXT_PUBLIC const int SVG_IMPORT_TRANSFORMATION_IGNORED_FLAG;
  14. /// Builds a shape from an SVG path string
  15. bool buildShapeFromSvgPath(Shape &shape, const char *pathDef, double endpointSnapRange = 0);
  16. /// Reads a single <path> element found in the specified SVG file and converts it to output Shape
  17. bool loadSvgShape(Shape &output, const char *filename, int pathIndex = 0, Vector2 *dimensions = NULL);
  18. /// 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
  19. int loadSvgShape(Shape &output, Shape::Bounds &viewBox, const char *filename);
  20. }
  21. #endif