/****************************************************************************** * QSkinny - Copyright (C) 2016 Uwe Rathmann * SPDX-License-Identifier: BSD-3-Clause *****************************************************************************/ #if defined( QSK_STANDALONE ) #include #include #include #include #include #include #else #include #include #endif #include #include #include #include static void usage( const char* appName ) { qWarning() << "usage: " << appName << "svgfile qvgfile"; } int main( int argc, char* argv[] ) { if ( argc != 3 ) { usage( argv[0] ); return -1; } #if 0 /* When there are no "text" parts in the SVGs we can avoid the costs of initializing not needed fonts by using the minimal plugin. */ qputenv( "QT_QPA_PLATFORM", "minimal" ); #endif #if 1 /* When having a SVG with specific font assignments Qt runs on qGuiApp to load a default font. Makes no sense in this context, but to avoid having segfaults ... */ QGuiApplication app( argc, argv ); #endif QSvgRenderer renderer; if ( !renderer.load( QString( argv[1] ) ) ) return -2; QskGraphic graphic; QPainter painter( &graphic ); renderer.render( &painter ); painter.end(); if ( graphic.commandTypes() & QskGraphic::RasterData ) qWarning() << argv[1] << "contains non scalable parts."; QskGraphicIO::write( graphic, argv[2] ); return 0; }