/* * LCD Image Converter. Converts images and fonts for embedded applications. * Copyright (C) 2014 riuson * mailto: riuson@gmail.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see #if QT_VERSION_COMBINED >= VERSION_COMBINE(5, 2, 0) //----------------------------------------------------------------------------- #include #include #include #include #include #include #include #include "modeconvertfont.h" #include "fontdocument.h" #include "datacontainer.h" #include "preset.h" #include "templateoptions.h" #include "tfontparameters.h" //----------------------------------------------------------------------------- namespace CommandLine { //----------------------------------------------------------------------------- ModeConvertFont::ModeConvertFont(QCommandLineParser *parser, QObject *parent) : ModeParserBase(parser, parent) { this->mFontFamily = "Times"; this->mFontSize = 14; this->mFontMonospaced = false; this->mFontStyle = "Normal"; this->mFontAntiAliasing = false; this->mFontAlphaChannel = false; this->mFontCharactersList = "0123456789ABCDEFabcdef"; this->mFontCharactersEncoding = "UTF-8"; this->mFontCharactersRange = QString(); this->mFontCharactersBigEndian = false; this->mOuputFilename = QString(); this->mTemplateFilename = QString(); this->mDocumentName = QString(); this->mPresetName = QString(); } //----------------------------------------------------------------------------- QString ModeConvertFont::modeName() { return "convert-font"; } //----------------------------------------------------------------------------- void ModeConvertFont::fillParser() const { // --family="Ubuntu" QCommandLineOption familyOption(QStringList() << "family", QCoreApplication::translate("CmdLineParser", " of new font."), QCoreApplication::translate("CmdLineParser", "family")); this->mParser->addOption(familyOption); // --size=14 QCommandLineOption sizeOption(QStringList() << "size", QCoreApplication::translate("CmdLineParser", "Font ."), QCoreApplication::translate("CmdLineParser", "size")); this->mParser->addOption(sizeOption); // --mono QCommandLineOption monoOption(QStringList() << "mono" << "monospaced", QCoreApplication::translate("CmdLineParser", "Make monospaced font.")); this->mParser->addOption(monoOption); // --style QCommandLineOption styleOption(QStringList() << "style", QCoreApplication::translate("CmdLineParser", "Font