// This file was automatically generated by opt2cpp. // It is part of the dvisvgm package and published under the terms // of the GNU General Public License version 3, or (at your option) any later version. // See file COPYING for further details. // Copyright (C) 2016-2024 Martin Gieseking #ifndef COMMANDLINE_HPP #define COMMANDLINE_HPP #include #include #include #include "CLCommandLine.hpp" using CL::Option; using CL::TypedOption; class CommandLine : public CL::CommandLine { public: CommandLine () : CL::CommandLine( "This program converts DVI files, as created by TeX/LaTeX, as well as\nEPS and PDF files to the XML-based scalable vector graphics format SVG.", "[options] dvifile\n--eps [options] epsfile\n--pdf [options] pdffile", "Copyright (C) 2005-2024 Martin Gieseking " ) {} CommandLine (int argc, char **argv) : CommandLine() { parse(argc, argv); } // option variables TypedOption bboxOpt {"bbox", 'b', "size", "min", "set size of bounding box"}; TypedOption bitmapFormatOpt {"bitmap-format", 'B', "fmt", "jpeg", "set format used to embed PS/EPS bitmaps"}; TypedOption cacheOpt {"cache", 'C', "dir", "set/print path of cache directory"}; Option clipjoinOpt {"clipjoin", 'j', "compute intersection of clipping paths"}; Option colorOpt {"color", '\0', "colorize messages"}; Option colornamesOpt {"colornames", '\0', "prefer color names to RGB values if possible"}; Option commentsOpt {"comments", '\0', "add comments with additional information"}; TypedOption currentcolorOpt {"currentcolor", '\0', "color", "#000", "replace given color with 'currentColor'"}; Option debugGlyphsOpt {"debug-glyphs", '\0', "create PS files for all glyphs converted to TTF"}; Option embedBitmapsOpt {"embed-bitmaps", '\0', "prevent references to external bitmap files"}; Option epsOpt {"eps", 'E', "convert EPS file to SVG"}; Option exactBboxOpt {"exact-bbox", 'e', "compute exact glyph bounding boxes"}; TypedOption fontFormatOpt {"font-format", 'f', "format", "svg", "set file format of embedded fonts"}; TypedOption fontmapOpt {"fontmap", 'm', "filenames", "evaluate (additional) font map files"}; Option gradOverlapOpt {"grad-overlap", '\0', "create overlapping color gradient segments"}; TypedOption gradSegmentsOpt {"grad-segments", '\0', "number", 20, "number of color gradient segments per row"}; TypedOption gradSimplifyOpt {"grad-simplify", '\0', "delta", 0.05, "reduce level of detail for small segments"}; TypedOption helpOpt {"help", 'h', "mode", 0, "print this summary of options and exit"}; Option keepOpt {"keep", '\0', "keep temporary files"}; TypedOption libgsOpt {"libgs", '\0', "filename", "set name of Ghostscript shared library"}; TypedOption linkmarkOpt {"linkmark", 'L', "style", "box", "select how to mark hyperlinked areas"}; Option listSpecialsOpt {"list-specials", 'l', "print supported special sets and exit"}; TypedOption magOpt {"mag", 'M', "factor", 4, "magnification of Metafont output"}; TypedOption messageOpt {"message", '\0', "text", "print message text after writing an SVG file"}; TypedOption noFontsOpt {"no-fonts", 'n', "variant", 0, "draw glyphs by using path elements"}; Option noMergeOpt {"no-merge", '\0', "don't merge adjacent text elements"}; Option noMktexmfOpt {"no-mktexmf", '\0', "don't try to create missing fonts"}; TypedOption noSpecialsOpt {"no-specials", 'S', "prefixes", "don't process [selected] specials"}; Option noStylesOpt {"no-styles", '\0', "don't use CSS styles to reference fonts"}; TypedOption optimizeOpt {"optimize", 'O', "modules", "all", "perform several SVG optimizations"}; TypedOption outputOpt {"output", 'o', "pattern", "set name pattern of output files"}; TypedOption pageOpt {"page", 'p', "ranges", "1", "choose page(s) to convert"}; TypedOption pageHashesOpt {"page-hashes", 'H', "params", "xxh64", "activate usage of page hashes"}; Option pdfOpt {"pdf", 'P', "convert PDF file to SVG"}; TypedOption precisionOpt {"precision", 'd', "number", 0, "set number of decimal points (0-6)"}; TypedOption progressOpt {"progress", '\0', "delay", 0.5, "enable progress indicator"}; Option relativeOpt {"relative", 'R', "create relative path commands"}; TypedOption rotateOpt {"rotate", 'r', "angle", "rotate page content clockwise"}; TypedOption scaleOpt {"scale", 'c', "sx[,sy]", "scale page content"}; Option stdinOpt {"stdin", '\0', "read input file from stdin"}; Option stdoutOpt {"stdout", 's', "write SVG output to stdout"}; TypedOption tmpdirOpt {"tmpdir", '\0', "path", "set/print the directory for temporary files"}; TypedOption traceAllOpt {"trace-all", 'a', "retrace", false, "trace all glyphs of bitmap fonts"}; TypedOption transformOpt {"transform", 'T', "commands", "transform page content"}; TypedOption translateOpt {"translate", 't', "tx[,ty]", "shift page content"}; TypedOption verbosityOpt {"verbosity", 'v', "level", 15, "set verbosity level (0-15)"}; TypedOption versionOpt {"version", 'V', "extended", false, "print version and exit"}; TypedOption zipOpt {"zip", 'z', "level", 9, "create compressed .svgz file"}; TypedOption zoomOpt {"zoom", 'Z', "factor", 1.0, "zoom page content"}; protected: std::vector& options () const override {return _options;} const char* section (size_t n) const override {return n < _sections.size() ? _sections[n] : nullptr;} private: std::array _sections {{ "Input options", "SVG output options", "SVG transformations", "Processing options", "Message options", }}; mutable std::vector _options = { {&pageOpt, 0}, {&fontmapOpt, 0}, #if !defined(DISABLE_GS) {&epsOpt, 0}, #endif #if !defined(DISABLE_GS) {&pdfOpt, 0}, #endif {&stdinOpt, 0}, {&bboxOpt, 1}, #if !defined(DISABLE_GS) {&bitmapFormatOpt, 1}, #endif #if !defined(DISABLE_GS) {&clipjoinOpt, 1}, #endif {&colornamesOpt, 1}, {&commentsOpt, 1}, {¤tcolorOpt, 1}, {&embedBitmapsOpt, 1}, #if !defined(DISABLE_WOFF) {&fontFormatOpt, 1}, #endif #if !defined(DISABLE_GS) {&gradOverlapOpt, 1}, #endif #if !defined(DISABLE_GS) {&gradSegmentsOpt, 1}, #endif #if !defined(DISABLE_GS) {&gradSimplifyOpt, 1}, #endif {&linkmarkOpt, 1}, {&optimizeOpt, 1}, {&outputOpt, 1}, {&precisionOpt, 1}, {&relativeOpt, 1}, {&stdoutOpt, 1}, {&tmpdirOpt, 1}, {&noFontsOpt, 1}, {&noMergeOpt, 1}, {&noStylesOpt, 1}, {&zipOpt, 1}, {&rotateOpt, 2}, {&scaleOpt, 2}, {&translateOpt, 2}, {&transformOpt, 2}, {&zoomOpt, 2}, {&cacheOpt, 3}, #if defined(TTFDEBUG) {&debugGlyphsOpt, 3}, #endif {&exactBboxOpt, 3}, {&keepOpt, 3}, #if !defined(HAVE_LIBGS) && !defined(DISABLE_GS) {&libgsOpt, 3}, #endif {&magOpt, 3}, {&noMktexmfOpt, 3}, {&noSpecialsOpt, 3}, {&pageHashesOpt, 3}, {&traceAllOpt, 3}, {&colorOpt, 4}, {&helpOpt, 4}, {&listSpecialsOpt, 4}, {&messageOpt, 4}, {&progressOpt, 4}, {&verbosityOpt, 4}, {&versionOpt, 4}, }; }; #endif