/* * Copyright (c) 2023, MacDue * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include namespace Gfx { // Current recommended SVG to TVG conversion (without installing tools) // (FIXME: Implement our own converter!) // 1. (Optional) Convert strokes to fills // * Only round joins/linecaps exist in TVG, so for other stroke kinds converting // them to fills (that still beziers etc, so are scalable) works better. // * This site can do that: https://iconly.io/tools/svg-convert-stroke-to-fill // 2. Scale your SVG's width/height to large size (e.g. 1024x?) // * Current converters deal poorly with small values in paths. // * This site can do that: https://www.iloveimg.com/resize-image/resize-svg // (or just edit the viewbox if it has one). // 3. Convert the SVG to a TVG // * This site can do that: https://svg-to-tvg-server.fly.dev/ // Decoder from the "Tiny Vector Graphics" format (v1.0). // https://tinyvg.tech/download/specification.pdf struct TinyVGHeader; class TinyVGDecodedImageData final : public VectorGraphic { public: using Style = Variant>; struct DrawCommand { Path path; Optional