Welcome to mirror list, hosted at ThFree Co, Russian Federation.

main.cpp « skin_generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b475dc2b6ea38c7c61fe73bd75c5469d5649236f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "skin_generator.hpp"

#include <QtCore/QFile>
#include <QtGui/QApplication>

#include <QtXml/QXmlSimpleReader>
#include <QtXml/QXmlInputSource>

#include "../3party/gflags/src/gflags/gflags.h"

DEFINE_string(fontFileName, "../../data/01_dejavusans.ttf", "path to TrueType font file");
DEFINE_string(symbolsFile, "../../data/results.unicode", "file with 2bytes symbols for which the skin should be generated");
DEFINE_string(symbolsDir, "../../data/styles/symbols", "directory with svg symbol files");
DEFINE_int32(symbolWidth, 24, "width of the rendered symbol");
DEFINE_int32(symbolHeight, 24, "height of the rendered symbol");
DEFINE_double(symbolScale, 1, "scale factor of the symbol");
DEFINE_int32(fixedGlyphSize, 16, "height of the fixed font");
DEFINE_string(skinName, "../../data/basic", "prefix for the skin and skinImage file name");

int main(int argc, char *argv[])
{
  google::ParseCommandLineFlags(&argc, &argv, true);
  QApplication app(argc, argv);

  tools::SkinGenerator gen;

  std::vector<int8_t> glyphSizes;

  glyphSizes.push_back(FLAGS_fixedGlyphSize);

  std::vector<QSize> symbolSizes;
  symbolSizes.push_back(QSize(FLAGS_symbolWidth, FLAGS_symbolHeight));

  std::vector<double> symbolScales;
  symbolScales.push_back(FLAGS_symbolScale);

  gen.processSymbols(FLAGS_symbolsDir, FLAGS_skinName, symbolSizes, symbolScales);
  gen.processFont(FLAGS_fontFileName, FLAGS_skinName, glyphSizes, FLAGS_symbolScale);
  gen.renderPages();

  gen.writeToFile(FLAGS_skinName);

  return 0;
}