Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 45 of file svg_renderer.cpp.
45 {
46 if (argc != 2) {
48 return 1;
49 }
52 printf(
"Cannot open output file %s\n",
argv[1]);
53 return 1;
54 }
55
56
58#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
60#elif defined(SK_FONTMGR_CORETEXT_AVAILABLE)
62#endif
64 printf(
"No Font Manager configured\n");
65 return 1;
66 }
67
69
73 .make(svgStream);
74
75 if (!svg_dom) {
76 printf(
"Could not parse compiled-in svg\n");
77 return 1;
78 }
79
81
83 svg_dom->render(
surface->getCanvas());
84
87
89 printf(
"PNG encoding failed.\n");
90 return 1;
91 }
93 return 0;
94}
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
SK_API sk_sp< SkFontMgr > SkFontMgr_New_CoreText(CTFontCollectionRef)
sk_sp< SkFontMgr > fontMgr
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
sk_sp< Factory > BestAvailable()
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
DlVertices::Builder Builder
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkSize Make(SkScalar w, SkScalar h)
◆ kHeight
constexpr size_t kHeight = 120 |
|
constexpr |
◆ kWidth
constexpr size_t kWidth = 450 |
|
constexpr |
◆ svg
Initial value:= "<svg viewBox=\"0 0 150 40\" xmlns=\"http://www.w3.org/2000/svg\">"
"<style>"
"text {"
"font: 13px sans-serif;"
"}"
"</style>"
"<text x=\"10\" y=\"30\">VAVAVAVA</text>"
"</svg>"
Definition at line 36 of file svg_renderer.cpp.