freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][gsoc-2022-chariri-2] [ftinspect] Fix comp


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri-2] [ftinspect] Fix compilation on GCC.
Date: Mon, 11 Jul 2022 14:11:54 +0000

Charlie Jiang pushed to branch gsoc-2022-chariri-2 at FreeType / FreeType Demo Programs

Commits:

  • 6513ad18
    by Charlie Jiang at 2022-07-11T22:09:21+08:00
    [ftinspect] Fix compilation on GCC.
    
    * src/ftinspect/panels/continuous.hpp, src/ftinspect/panels/continuous.cpp,
      use `std::vector` over `QVector` because the latter requires default
      `constructor`.
    
    * src/ftinspect/models/ttsettingscomboboxmodel.hpp: Fix enum inconsistency.
    
    * src/ftinspect/engine/engine.hpp, src/ftinspect/engine/engine.cpp: Fix
    missing include; use `std::vector`;
    
    * src/ftinspect/CMakeLists.txt: Fix MinGW: g++ doesn't need `/utf-8` switch.
    

7 changed files:

Changes:

  • src/ftinspect/CMakeLists.txt
    ... ... @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD 11)
    4 4
     
    
    5 5
     project("ftinspect")
    
    6 6
     
    
    7
    -if (WIN32)
    
    7
    +if (MSVC)
    
    8 8
       add_compile_options("/utf-8")
    
    9 9
     endif ()
    
    10 10
     
    

  • src/ftinspect/engine/engine.cpp
    ... ... @@ -309,7 +309,7 @@ Engine::loadFont(int fontIndex,
    309 309
         curCharMaps_.clear();
    
    310 310
         curCharMaps_.reserve(face->num_charmaps);
    
    311 311
         for (int i = 0; i < face->num_charmaps; i++)
    
    312
    -      curCharMaps_.append(CharMapInfo(i, face->charmaps[i]));
    
    312
    +      curCharMaps_.emplace_back(i, face->charmaps[i]);
    
    313 313
       }
    
    314 314
     
    
    315 315
       curNumGlyphs_ = numGlyphs;
    

  • src/ftinspect/engine/engine.hpp
    ... ... @@ -7,6 +7,7 @@
    7 7
     
    
    8 8
     #include "fontfilemanager.hpp"
    
    9 9
     
    
    10
    +#include <vector>
    
    10 11
     #include <QString>
    
    11 12
     #include <QMap>
    
    12 13
     
    
    ... ... @@ -121,7 +122,7 @@ public:
    121 122
       unsigned glyphIndexFromCharCode(int code, int charMapIndex);
    
    122 123
       FT_Size_Metrics const& currentFontMetrics();
    
    123 124
     
    
    124
    -  QVector<CharMapInfo>& currentFontCharMaps() { return curCharMaps_; }
    
    125
    +  std::vector<CharMapInfo>& currentFontCharMaps() { return curCharMaps_; }
    
    125 126
       FontFileManager& fontFileManager() { return fontFileManager_; }
    
    126 127
       EngineDefaultValues& engineDefaults() { return engineDefaults_; }
    
    127 128
       bool antiAliasingEnabled() { return antiAliasingEnabled_; }
    
    ... ... @@ -174,7 +175,7 @@ private:
    174 175
       QString curFamilyName_;
    
    175 176
       QString curStyleName_;
    
    176 177
       int curNumGlyphs_ = -1;
    
    177
    -  QVector<CharMapInfo> curCharMaps_;
    
    178
    +  std::vector<CharMapInfo> curCharMaps_;
    
    178 179
     
    
    179 180
       FT_Library library_;
    
    180 181
       FTC_Manager cacheManager_;
    

  • src/ftinspect/models/ttsettingscomboboxmodel.hpp
    ... ... @@ -112,7 +112,7 @@ public:
    112 112
       virtual ~LCDFilterComboBoxModel() = default;
    
    113 113
     
    
    114 114
     public:
    
    115
    -  enum LCDFilter
    
    115
    +  enum LCDFilter : int
    
    116 116
       {
    
    117 117
         LCDFilter_Default,
    
    118 118
         LCDFilter_Light,
    

  • src/ftinspect/panels/continuous.cpp
    ... ... @@ -145,7 +145,7 @@ ContinousAllGlyphsTab::ContinousAllGlyphsTab(QWidget* parent)
    145 145
     {
    
    146 146
       createLayout();
    
    147 147
     
    
    148
    -  QVector<CharMapInfo> tempCharMaps;
    
    148
    +  std::vector<CharMapInfo> tempCharMaps;
    
    149 149
       setCharMaps(tempCharMaps); // pass in an empty one
    
    150 150
     
    
    151 151
       checkSubMode();
    
    ... ... @@ -240,7 +240,7 @@ ContinousAllGlyphsTab::setDisplayingCount(int count)
    240 240
     
    
    241 241
     #define EncodingRole (Qt::UserRole + 10)
    
    242 242
     void
    
    243
    -ContinousAllGlyphsTab::setCharMaps(QVector<CharMapInfo>& charMaps)
    
    243
    +ContinousAllGlyphsTab::setCharMaps(std::vector<CharMapInfo>& charMaps)
    
    244 244
     {
    
    245 245
       charMaps_ = charMaps;
    
    246 246
       int oldIndex = charMapSelector_->currentIndex();
    

  • src/ftinspect/panels/continuous.hpp
    ... ... @@ -12,10 +12,10 @@
    12 12
     #include "../rendering/glyphcontinuous.hpp"
    
    13 13
     #include "../engine/engine.hpp"
    
    14 14
     
    
    15
    +#include <vector>
    
    15 16
     #include <QWidget>
    
    16 17
     #include <QLabel>
    
    17 18
     #include <QComboBox>
    
    18
    -#include <QVector>
    
    19 19
     #include <QGridLayout>
    
    20 20
     #include <QBoxLayout>
    
    21 21
     
    
    ... ... @@ -92,7 +92,7 @@ public:
    92 92
       void setGlyphCount(int count);
    
    93 93
       void setDisplayingCount(int count);
    
    94 94
     
    
    95
    -  void setCharMaps(QVector<CharMapInfo>& charMaps);
    
    95
    +  void setCharMaps(std::vector<CharMapInfo>& charMaps);
    
    96 96
       // This doesn't trigger either.
    
    97 97
       void updateLimitIndex();
    
    98 98
     
    
    ... ... @@ -124,7 +124,7 @@ private:
    124 124
     
    
    125 125
       QGridLayout* layout_;
    
    126 126
     
    
    127
    -  QVector<CharMapInfo> charMaps_;
    
    127
    +  std::vector<CharMapInfo> charMaps_;
    
    128 128
     
    
    129 129
       void createLayout();
    
    130 130
       void createConnections();
    

  • src/ftinspect/rendering/grid.hpp
    ... ... @@ -6,6 +6,7 @@
    6 6
     #pragma once
    
    7 7
     
    
    8 8
     #include <QGraphicsItem>
    
    9
    +#include <QGraphicsView>
    
    9 10
     #include <QPen>
    
    10 11
     
    
    11 12
     class Grid
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]