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] Show pla


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri-2] [ftinspect] Show platform and encoding id in the charmap selector.
Date: Mon, 25 Jul 2022 11:10:56 +0000

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

Commits:

  • aeb4baba
    by Charlie Jiang at 2022-07-25T19:09:18+08:00
    [ftinspect] Show platform and encoding id in the charmap selector.
    
    * src/ftinspect/panels/continuous.cpp: Show PID and EID in the combobox.
      Add necessary layout change.
    
    * src/ftinspect/engine/charmap.cpp, src/ftinspect/engine/charmap.hpp:
      Retrieve PID and EID from the charmap struct and expose them as fields.
    

3 changed files:

Changes:

  • src/ftinspect/engine/charmap.cpp
    ... ... @@ -35,7 +35,10 @@ encodingNames()
    35 35
     
    
    36 36
     
    
    37 37
     CharMapInfo::CharMapInfo(int index, FT_CharMap cmap)
    
    38
    -: index(index), ptr(cmap), encoding(cmap->encoding), maxIndex(-1)
    
    38
    +: index(index), ptr(cmap),
    
    39
    +  encoding(cmap->encoding),
    
    40
    +  platformID(cmap->platform_id), encodingID(cmap->encoding_id),
    
    41
    +  maxIndex(-1)
    
    39 42
     {
    
    40 43
       auto& names = encodingNames();
    
    41 44
       auto it = names.find(encoding);
    

  • src/ftinspect/engine/charmap.hpp
    ... ... @@ -17,6 +17,8 @@ struct CharMapInfo
    17 17
       int index;
    
    18 18
       FT_CharMap ptr;
    
    19 19
       FT_Encoding encoding;
    
    20
    +  unsigned short platformID;
    
    21
    +  unsigned short encodingID;
    
    20 22
       QString* encodingName;
    
    21 23
     
    
    22 24
       // Actually this shouldn't go here, but for convenience...
    

  • src/ftinspect/panels/continuous.cpp
    ... ... @@ -139,9 +139,11 @@ ContinuousTab::setCharMaps(std::vector<CharMapInfo>& charMaps)
    139 139
         int newIndex = 0;
    
    140 140
         for (auto& map : charMaps)
    
    141 141
         {
    
    142
    -      charMapSelector_->addItem(tr("%1: %2")
    
    142
    +      charMapSelector_->addItem(tr("%1: %2 (platform %3, encoding %4)")
    
    143 143
                                     .arg(i)
    
    144
    -                                .arg(*map.encodingName));
    
    144
    +                                .arg(*map.encodingName)
    
    145
    +                                .arg(map.platformID)
    
    146
    +                                .arg(map.encodingID));
    
    145 147
           auto encoding = static_cast<unsigned>(map.encoding);
    
    146 148
           charMapSelector_->setItemData(i, encoding, EncodingRole);
    
    147 149
     
    
    ... ... @@ -296,6 +298,8 @@ ContinuousTab::createLayout()
    296 298
       charMapSelector_ = new QComboBox(this);
    
    297 299
       sourceSelector_ = new QComboBox(this);
    
    298 300
     
    
    301
    +  charMapSelector_->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    
    302
    +
    
    299 303
       // Note: in sync with the enum!!
    
    300 304
       modeSelector_->insertItem(GlyphContinuous::M_Normal, tr("Normal"));
    
    301 305
       modeSelector_->insertItem(GlyphContinuous::M_Fancy, tr("Fancy"));
    


  • reply via email to

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