freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][reorg-maingui] [ftinspect] Rename all pri


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][reorg-maingui] [ftinspect] Rename all private member variables with an underscore suffix.
Date: Wed, 29 Jun 2022 14:27:42 +0000

Charlie Jiang pushed to branch reorg-maingui at FreeType / FreeType Demo Programs

Commits:

  • e61795ff
    by Charlie Jiang at 2022-06-29T22:24:57+08:00
    [ftinspect] Rename all private member variables with an underscore suffix.
    
    (pure mechnical commit)
    
    * src/ftinspect/**: Renaming. Also some variables with abbreviations
    were renamed.
    
    This will enable nicer getter/setters, as discussed in #13.
    

18 changed files:

Changes:

  • src/ftinspect/engine/engine.cpp
    ... ... @@ -87,7 +87,7 @@ faceRequester(FTC_FaceID ftcFaceID,
    87 87
                  "Pointer size must be at least the size of int"
    
    88 88
                  " in order to treat FTC_FaceID correctly");
    
    89 89
     
    
    90
    -  const FaceID& faceID = engine->faceIDMap.key(val);
    
    90
    +  const FaceID& faceID = engine->faceIDMap_.key(val);
    
    91 91
     
    
    92 92
       // this is the only place where we have to check the validity of the font
    
    93 93
       // index; note that the validity of both the face and named instance index
    
    ... ... @@ -96,7 +96,7 @@ faceRequester(FTC_FaceID ftcFaceID,
    96 96
           || faceID.fontIndex >= engine->numberOfOpenedFonts())
    
    97 97
         return FT_Err_Invalid_Argument;
    
    98 98
     
    
    99
    -  QString font = engine->fileManager[faceID.fontIndex].filePath();
    
    99
    +  QString font = engine->fontFileManager_[faceID.fontIndex].filePath();
    
    100 100
       long faceIndex = faceID.faceIndex;
    
    101 101
     
    
    102 102
       if (faceID.namedInstanceIndex > 0)
    
    ... ... @@ -117,32 +117,32 @@ faceRequester(FTC_FaceID ftcFaceID,
    117 117
     
    
    118 118
     Engine::Engine()
    
    119 119
     {
    
    120
    -  ftSize = NULL;
    
    120
    +  ftSize_ = NULL;
    
    121 121
       // we reserve value 0 for the `invalid face ID'
    
    122
    -  faceCounter = 1;
    
    122
    +  faceCounter_ = 1;
    
    123 123
     
    
    124 124
       FT_Error error;
    
    125 125
     
    
    126
    -  error = FT_Init_FreeType(&library);
    
    126
    +  error = FT_Init_FreeType(&library_);
    
    127 127
       if (error)
    
    128 128
       {
    
    129 129
         // XXX error handling
    
    130 130
       }
    
    131 131
     
    
    132
    -  error = FTC_Manager_New(library, 0, 0, 0,
    
    133
    -                          faceRequester, this, &cacheManager);
    
    132
    +  error = FTC_Manager_New(library_, 0, 0, 0,
    
    133
    +                          faceRequester, this, &cacheManager_);
    
    134 134
       if (error)
    
    135 135
       {
    
    136 136
         // XXX error handling
    
    137 137
       }
    
    138 138
     
    
    139
    -  error = FTC_SBitCache_New(cacheManager, &sbitsCache);
    
    139
    +  error = FTC_SBitCache_New(cacheManager_, &sbitsCache_);
    
    140 140
       if (error)
    
    141 141
       {
    
    142 142
         // XXX error handling
    
    143 143
       }
    
    144 144
     
    
    145
    -  error = FTC_ImageCache_New(cacheManager, &imageCache);
    
    145
    +  error = FTC_ImageCache_New(cacheManager_, &imageCache_);
    
    146 146
       if (error)
    
    147 147
       {
    
    148 148
         // XXX error handling
    
    ... ... @@ -154,8 +154,8 @@ Engine::Engine()
    154 154
     
    
    155 155
     Engine::~Engine()
    
    156 156
     {
    
    157
    -  FTC_Manager_Done(cacheManager);
    
    158
    -  FT_Done_FreeType(library);
    
    157
    +  FTC_Manager_Done(cacheManager_);
    
    158
    +  FT_Done_FreeType(library_);
    
    159 159
     }
    
    160 160
     
    
    161 161
     
    
    ... ... @@ -167,28 +167,28 @@ Engine::numberOfFaces(int fontIndex)
    167 167
     
    
    168 168
       // search triplet (fontIndex, 0, 0)
    
    169 169
       FTC_FaceID ftcFaceID = reinterpret_cast<FTC_FaceID>
    
    170
    -                           (faceIDMap.value(FaceID(fontIndex,
    
    170
    +                           (faceIDMap_.value(FaceID(fontIndex,
    
    171 171
                                                        0,
    
    172 172
                                                        0)));
    
    173 173
       if (ftcFaceID)
    
    174 174
       {
    
    175 175
         // found
    
    176
    -    if (!FTC_Manager_LookupFace(cacheManager, ftcFaceID, &face))
    
    176
    +    if (!FTC_Manager_LookupFace(cacheManager_, ftcFaceID, &face))
    
    177 177
           numFaces = face->num_faces;
    
    178 178
       }
    
    179 179
       else
    
    180 180
       {
    
    181 181
         // not found; try to load triplet (fontIndex, 0, 0)
    
    182
    -    ftcFaceID = reinterpret_cast<FTC_FaceID>(faceCounter);
    
    183
    -    faceIDMap.insert(FaceID(fontIndex, 0, 0),
    
    184
    -                     faceCounter++);
    
    182
    +    ftcFaceID = reinterpret_cast<FTC_FaceID>(faceCounter_);
    
    183
    +    faceIDMap_.insert(FaceID(fontIndex, 0, 0),
    
    184
    +                     faceCounter_++);
    
    185 185
     
    
    186
    -    if (!FTC_Manager_LookupFace(cacheManager, ftcFaceID, &face))
    
    186
    +    if (!FTC_Manager_LookupFace(cacheManager_, ftcFaceID, &face))
    
    187 187
           numFaces = face->num_faces;
    
    188 188
         else
    
    189 189
         {
    
    190
    -      faceIDMap.remove(FaceID(fontIndex, 0, 0));
    
    191
    -      faceCounter--;
    
    190
    +      faceIDMap_.remove(FaceID(fontIndex, 0, 0));
    
    191
    +      faceCounter_--;
    
    192 192
         }
    
    193 193
       }
    
    194 194
     
    
    ... ... @@ -207,28 +207,28 @@ Engine::numberOfNamedInstances(int fontIndex,
    207 207
     
    
    208 208
       // search triplet (fontIndex, faceIndex, 0)
    
    209 209
       FTC_FaceID ftcFaceID = reinterpret_cast<FTC_FaceID>
    
    210
    -                           (faceIDMap.value(FaceID(fontIndex,
    
    210
    +                           (faceIDMap_.value(FaceID(fontIndex,
    
    211 211
                                                        faceIndex,
    
    212 212
                                                        0)));
    
    213 213
       if (ftcFaceID)
    
    214 214
       {
    
    215 215
         // found
    
    216
    -    if (!FTC_Manager_LookupFace(cacheManager, ftcFaceID, &face))
    
    216
    +    if (!FTC_Manager_LookupFace(cacheManager_, ftcFaceID, &face))
    
    217 217
           numNamedInstances = static_cast<int>((face->style_flags >> 16) + 1);
    
    218 218
       }
    
    219 219
       else
    
    220 220
       {
    
    221 221
         // not found; try to load triplet (fontIndex, faceIndex, 0)
    
    222
    -    ftcFaceID = reinterpret_cast<FTC_FaceID>(faceCounter);
    
    223
    -    faceIDMap.insert(FaceID(fontIndex, faceIndex, 0),
    
    224
    -                     faceCounter++);
    
    222
    +    ftcFaceID = reinterpret_cast<FTC_FaceID>(faceCounter_);
    
    223
    +    faceIDMap_.insert(FaceID(fontIndex, faceIndex, 0),
    
    224
    +                     faceCounter_++);
    
    225 225
     
    
    226
    -    if (!FTC_Manager_LookupFace(cacheManager, ftcFaceID, &face))
    
    226
    +    if (!FTC_Manager_LookupFace(cacheManager_, ftcFaceID, &face))
    
    227 227
           numNamedInstances = static_cast<int>((face->style_flags >> 16) + 1);
    
    228 228
         else
    
    229 229
         {
    
    230
    -      faceIDMap.remove(FaceID(fontIndex, faceIndex, 0));
    
    231
    -      faceCounter--;
    
    230
    +      faceIDMap_.remove(FaceID(fontIndex, faceIndex, 0));
    
    231
    +      faceCounter_--;
    
    232 232
         }
    
    233 233
       }
    
    234 234
     
    
    ... ... @@ -242,60 +242,60 @@ Engine::loadFont(int fontIndex,
    242 242
                      int namedInstanceIndex)
    
    243 243
     {
    
    244 244
       int numGlyphs = -1;
    
    245
    -  fontType = FontType_Other;
    
    245
    +  fontType_ = FontType_Other;
    
    246 246
     
    
    247 247
       update();
    
    248 248
     
    
    249 249
       // search triplet (fontIndex, faceIndex, namedInstanceIndex)
    
    250
    -  scaler.face_id = reinterpret_cast<FTC_FaceID>
    
    251
    -                     (faceIDMap.value(FaceID(fontIndex,
    
    250
    +  scaler_.face_id = reinterpret_cast<FTC_FaceID>
    
    251
    +                     (faceIDMap_.value(FaceID(fontIndex,
    
    252 252
                                                  faceIndex,
    
    253 253
                                                  namedInstanceIndex)));
    
    254
    -  if (scaler.face_id)
    
    254
    +  if (scaler_.face_id)
    
    255 255
       {
    
    256 256
         // found
    
    257
    -    if (!FTC_Manager_LookupSize(cacheManager, &scaler, &ftSize))
    
    258
    -      numGlyphs = ftSize->face->num_glyphs;
    
    257
    +    if (!FTC_Manager_LookupSize(cacheManager_, &scaler_, &ftSize_))
    
    258
    +      numGlyphs = ftSize_->face->num_glyphs;
    
    259 259
       }
    
    260 260
       else
    
    261 261
       {
    
    262 262
         // not found; try to load triplet
    
    263 263
         // (fontIndex, faceIndex, namedInstanceIndex)
    
    264
    -    scaler.face_id = reinterpret_cast<FTC_FaceID>(faceCounter);
    
    265
    -    faceIDMap.insert(FaceID(fontIndex,
    
    264
    +    scaler_.face_id = reinterpret_cast<FTC_FaceID>(faceCounter_);
    
    265
    +    faceIDMap_.insert(FaceID(fontIndex,
    
    266 266
                                 faceIndex,
    
    267 267
                                 namedInstanceIndex),
    
    268
    -                     faceCounter++);
    
    268
    +                     faceCounter_++);
    
    269 269
     
    
    270
    -    if (!FTC_Manager_LookupSize(cacheManager, &scaler, &ftSize))
    
    271
    -      numGlyphs = ftSize->face->num_glyphs;
    
    270
    +    if (!FTC_Manager_LookupSize(cacheManager_, &scaler_, &ftSize_))
    
    271
    +      numGlyphs = ftSize_->face->num_glyphs;
    
    272 272
         else
    
    273 273
         {
    
    274
    -      faceIDMap.remove(FaceID(fontIndex,
    
    274
    +      faceIDMap_.remove(FaceID(fontIndex,
    
    275 275
                                   faceIndex,
    
    276 276
                                   namedInstanceIndex));
    
    277
    -      faceCounter--;
    
    277
    +      faceCounter_--;
    
    278 278
         }
    
    279 279
       }
    
    280 280
     
    
    281 281
       if (numGlyphs < 0)
    
    282 282
       {
    
    283
    -    ftSize = NULL;
    
    284
    -    curFamilyName = QString();
    
    285
    -    curStyleName = QString();
    
    283
    +    ftSize_ = NULL;
    
    284
    +    curFamilyName_ = QString();
    
    285
    +    curStyleName_ = QString();
    
    286 286
       }
    
    287 287
       else
    
    288 288
       {
    
    289
    -    curFamilyName = QString(ftSize->face->family_name);
    
    290
    -    curStyleName = QString(ftSize->face->style_name);
    
    289
    +    curFamilyName_ = QString(ftSize_->face->family_name);
    
    290
    +    curStyleName_ = QString(ftSize_->face->style_name);
    
    291 291
     
    
    292
    -    const char* moduleName = FT_FACE_DRIVER_NAME( ftSize->face );
    
    292
    +    const char* moduleName = FT_FACE_DRIVER_NAME( ftSize_->face );
    
    293 293
     
    
    294 294
         // XXX cover all available modules
    
    295 295
         if (!strcmp(moduleName, "cff"))
    
    296
    -      fontType = FontType_CFF;
    
    296
    +      fontType_ = FontType_CFF;
    
    297 297
         else if (!strcmp(moduleName, "truetype"))
    
    298
    -      fontType = FontType_TrueType;
    
    298
    +      fontType_ = FontType_TrueType;
    
    299 299
       }
    
    300 300
     
    
    301 301
       return numGlyphs;
    
    ... ... @@ -308,11 +308,11 @@ Engine::removeFont(int fontIndex, bool closeFile)
    308 308
       // we iterate over all triplets that contain the given font index
    
    309 309
       // and remove them
    
    310 310
       QMap<FaceID, FTC_IDType>::iterator iter
    
    311
    -    = faceIDMap.lowerBound(FaceID(fontIndex, 0, 0));
    
    311
    +    = faceIDMap_.lowerBound(FaceID(fontIndex, 0, 0));
    
    312 312
     
    
    313 313
       for (;;)
    
    314 314
       {
    
    315
    -    if (iter == faceIDMap.end())
    
    315
    +    if (iter == faceIDMap_.end())
    
    316 316
           break;
    
    317 317
     
    
    318 318
         FaceID faceID = iter.key();
    
    ... ... @@ -320,13 +320,13 @@ Engine::removeFont(int fontIndex, bool closeFile)
    320 320
           break;
    
    321 321
     
    
    322 322
         FTC_FaceID ftcFaceID = reinterpret_cast<FTC_FaceID>(iter.value());
    
    323
    -    FTC_Manager_RemoveFaceID(cacheManager, ftcFaceID);
    
    323
    +    FTC_Manager_RemoveFaceID(cacheManager_, ftcFaceID);
    
    324 324
     
    
    325
    -    iter = faceIDMap.erase(iter);
    
    325
    +    iter = faceIDMap_.erase(iter);
    
    326 326
       }
    
    327 327
     
    
    328 328
       if (closeFile)
    
    329
    -    fileManager.remove(fontIndex);
    
    329
    +    fontFileManager_.remove(fontIndex);
    
    330 330
     }
    
    331 331
     
    
    332 332
     
    
    ... ... @@ -338,10 +338,10 @@ Engine::glyphName(int index)
    338 338
       if (index < 0)
    
    339 339
         throw std::runtime_error("Invalid glyph index");
    
    340 340
     
    
    341
    -  if (ftSize && FT_HAS_GLYPH_NAMES(ftSize->face))
    
    341
    +  if (ftSize_ && FT_HAS_GLYPH_NAMES(ftSize_->face))
    
    342 342
       {
    
    343 343
         char buffer[256];
    
    344
    -    if (!FT_Get_Glyph_Name(ftSize->face,
    
    344
    +    if (!FT_Get_Glyph_Name(ftSize_->face,
    
    345 345
                                static_cast<unsigned int>(index),
    
    346 346
                                buffer,
    
    347 347
                                sizeof(buffer)))
    
    ... ... @@ -366,9 +366,9 @@ Engine::loadOutline(int glyphIndex)
    366 366
     
    
    367 367
       // the `scaler' object is set up by the
    
    368 368
       // `update' and `loadFont' methods
    
    369
    -  if (FTC_ImageCache_LookupScaler(imageCache,
    
    370
    -                                  &scaler,
    
    371
    -                                  loadFlags | FT_LOAD_NO_BITMAP,
    
    369
    +  if (FTC_ImageCache_LookupScaler(imageCache_,
    
    370
    +                                  &scaler_,
    
    371
    +                                  loadFlags_ | FT_LOAD_NO_BITMAP,
    
    372 372
                                       static_cast<unsigned int>(glyphIndex),
    
    373 373
                                       &glyph,
    
    374 374
                                       NULL))
    
    ... ... @@ -389,52 +389,52 @@ Engine::loadOutline(int glyphIndex)
    389 389
     int
    
    390 390
     Engine::numberOfOpenedFonts()
    
    391 391
     {
    
    392
    -  return fileManager.size();
    
    392
    +  return fontFileManager_.size();
    
    393 393
     }
    
    394 394
     
    
    395 395
     
    
    396 396
     void
    
    397 397
     Engine::openFonts(QStringList fontFileNames)
    
    398 398
     {
    
    399
    -  fileManager.append(fontFileNames);
    
    399
    +  fontFileManager_.append(fontFileNames);
    
    400 400
     }
    
    401 401
     
    
    402 402
     
    
    403 403
     void
    
    404 404
     Engine::setSizeByPixel(double pixelSize)
    
    405 405
     {
    
    406
    -  this->pixelSize = pixelSize;
    
    407
    -  pointSize = pixelSize * 72.0 / dpi;
    
    408
    -  usingPixelSize = true;
    
    406
    +  this->pixelSize_ = pixelSize;
    
    407
    +  pointSize_ = pixelSize * 72.0 / dpi_;
    
    408
    +  usingPixelSize_ = true;
    
    409 409
     }
    
    410 410
     
    
    411 411
     void
    
    412 412
     Engine::setSizeByPoint(double pointSize)
    
    413 413
     {
    
    414
    -  this->pointSize = pointSize;
    
    415
    -  pixelSize = pointSize * dpi / 72.0;
    
    416
    -  usingPixelSize = false;
    
    414
    +  this->pointSize_ = pointSize;
    
    415
    +  pixelSize_ = pointSize * dpi_ / 72.0;
    
    416
    +  usingPixelSize_ = false;
    
    417 417
     }
    
    418 418
     
    
    419 419
     
    
    420 420
     void
    
    421 421
     Engine::setLcdFilter(FT_LcdFilter filter)
    
    422 422
     {
    
    423
    -  FT_Library_SetLcdFilter(library, filter);
    
    423
    +  FT_Library_SetLcdFilter(library_, filter);
    
    424 424
     }
    
    425 425
     
    
    426 426
     
    
    427 427
     void
    
    428 428
     Engine::setCFFHintingMode(int mode)
    
    429 429
     {
    
    430
    -  FT_Error error = FT_Property_Set(library,
    
    430
    +  FT_Error error = FT_Property_Set(library_,
    
    431 431
                                        "cff",
    
    432 432
                                        "hinting-engine",
    
    433 433
                                        &mode);
    
    434 434
       if (!error)
    
    435 435
       {
    
    436 436
         // reset the cache
    
    437
    -    FTC_Manager_Reset(cacheManager);
    
    437
    +    FTC_Manager_Reset(cacheManager_);
    
    438 438
       }
    
    439 439
     }
    
    440 440
     
    
    ... ... @@ -442,14 +442,14 @@ Engine::setCFFHintingMode(int mode)
    442 442
     void
    
    443 443
     Engine::setTTInterpreterVersion(int version)
    
    444 444
     {
    
    445
    -  FT_Error error = FT_Property_Set(library,
    
    445
    +  FT_Error error = FT_Property_Set(library_,
    
    446 446
                                        "truetype",
    
    447 447
                                        "interpreter-version",
    
    448 448
                                        &version);
    
    449 449
       if (!error)
    
    450 450
       {
    
    451 451
         // reset the cache
    
    452
    -    FTC_Manager_Reset(cacheManager);
    
    452
    +    FTC_Manager_Reset(cacheManager_);
    
    453 453
       }
    
    454 454
     }
    
    455 455
     
    
    ... ... @@ -457,20 +457,20 @@ Engine::setTTInterpreterVersion(int version)
    457 457
     void
    
    458 458
     Engine::update()
    
    459 459
     {
    
    460
    -  loadFlags = FT_LOAD_DEFAULT;
    
    461
    -  if (doAutoHinting)
    
    462
    -    loadFlags |= FT_LOAD_FORCE_AUTOHINT;
    
    463
    -  loadFlags |= FT_LOAD_NO_BITMAP; // XXX handle bitmap fonts also
    
    460
    +  loadFlags_ = FT_LOAD_DEFAULT;
    
    461
    +  if (doAutoHinting_)
    
    462
    +    loadFlags_ |= FT_LOAD_FORCE_AUTOHINT;
    
    463
    +  loadFlags_ |= FT_LOAD_NO_BITMAP; // XXX handle bitmap fonts also
    
    464 464
     
    
    465
    -  if (doHinting)
    
    465
    +  if (doHinting_)
    
    466 466
       {
    
    467 467
         unsigned long target;
    
    468 468
     
    
    469
    -    if (antiAliasingMode == AntiAliasing_None)
    
    469
    +    if (antiAliasingMode_ == AntiAliasing_None)
    
    470 470
           target = FT_LOAD_TARGET_MONO;
    
    471 471
         else
    
    472 472
         {
    
    473
    -      switch (antiAliasingMode)
    
    473
    +      switch (antiAliasingMode_)
    
    474 474
           {
    
    475 475
           case AntiAliasing_Light:
    
    476 476
             target = FT_LOAD_TARGET_LIGHT;
    
    ... ... @@ -491,33 +491,33 @@ Engine::update()
    491 491
           }
    
    492 492
         }
    
    493 493
     
    
    494
    -    loadFlags |= target;
    
    494
    +    loadFlags_ |= target;
    
    495 495
       }
    
    496 496
       else
    
    497 497
       {
    
    498
    -    loadFlags |= FT_LOAD_NO_HINTING;
    
    498
    +    loadFlags_ |= FT_LOAD_NO_HINTING;
    
    499 499
     
    
    500
    -    if (antiAliasingMode == AntiAliasing_None)
    
    501
    -      loadFlags |= FT_LOAD_MONOCHROME;
    
    500
    +    if (antiAliasingMode_ == AntiAliasing_None)
    
    501
    +      loadFlags_ |= FT_LOAD_MONOCHROME;
    
    502 502
       }
    
    503 503
     
    
    504 504
       // XXX handle color fonts also
    
    505 505
     
    
    506
    -  scaler.pixel = 0; // use 26.6 format
    
    506
    +  scaler_.pixel = 0; // use 26.6 format
    
    507 507
     
    
    508
    -  if (usingPixelSize)
    
    508
    +  if (usingPixelSize_)
    
    509 509
       {
    
    510
    -    scaler.width = static_cast<unsigned int>(pixelSize * 64.0);
    
    511
    -    scaler.height = static_cast<unsigned int>(pixelSize * 64.0);
    
    512
    -    scaler.x_res = 0;
    
    513
    -    scaler.y_res = 0;
    
    510
    +    scaler_.width = static_cast<unsigned int>(pixelSize_ * 64.0);
    
    511
    +    scaler_.height = static_cast<unsigned int>(pixelSize_ * 64.0);
    
    512
    +    scaler_.x_res = 0;
    
    513
    +    scaler_.y_res = 0;
    
    514 514
       }
    
    515 515
       else
    
    516 516
       {
    
    517
    -    scaler.width = static_cast<unsigned int>(pointSize * 64.0);
    
    518
    -    scaler.height = static_cast<unsigned int>(pointSize * 64.0);
    
    519
    -    scaler.x_res = dpi;
    
    520
    -    scaler.y_res = dpi;
    
    517
    +    scaler_.width = static_cast<unsigned int>(pointSize_ * 64.0);
    
    518
    +    scaler_.height = static_cast<unsigned int>(pointSize_ * 64.0);
    
    519
    +    scaler_.x_res = dpi_;
    
    520
    +    scaler_.y_res = dpi_;
    
    521 521
       }
    
    522 522
     }
    
    523 523
     
    
    ... ... @@ -530,15 +530,15 @@ Engine::queryEngine()
    530 530
       // query engines and check for alternatives
    
    531 531
     
    
    532 532
       // CFF
    
    533
    -  error = FT_Property_Get(library,
    
    533
    +  error = FT_Property_Get(library_,
    
    534 534
                               "cff",
    
    535 535
                               "hinting-engine",
    
    536
    -                          &defaults.cffHintingEngineDefault);
    
    536
    +                          &engineDefaults_.cffHintingEngineDefault);
    
    537 537
       if (error)
    
    538 538
       {
    
    539 539
         // no CFF engine
    
    540
    -    defaults.cffHintingEngineDefault = -1;
    
    541
    -    defaults.cffHintingEngineOther = -1;
    
    540
    +    engineDefaults_.cffHintingEngineDefault = -1;
    
    541
    +    engineDefaults_.cffHintingEngineOther = -1;
    
    542 542
       }
    
    543 543
       else
    
    544 544
       {
    
    ... ... @@ -550,36 +550,36 @@ Engine::queryEngine()
    550 550
     
    
    551 551
         int i;
    
    552 552
         for (i = 0; i < 2; i++)
    
    553
    -      if (defaults.cffHintingEngineDefault == engines[i])
    
    553
    +      if (engineDefaults_.cffHintingEngineDefault == engines[i])
    
    554 554
             break;
    
    555 555
     
    
    556
    -    defaults.cffHintingEngineOther = engines[(i + 1) % 2];
    
    556
    +    engineDefaults_.cffHintingEngineOther = engines[(i + 1) % 2];
    
    557 557
     
    
    558
    -    error = FT_Property_Set(library,
    
    558
    +    error = FT_Property_Set(library_,
    
    559 559
                                 "cff",
    
    560 560
                                 "hinting-engine",
    
    561
    -                            &defaults.cffHintingEngineOther);
    
    561
    +                            &engineDefaults_.cffHintingEngineOther);
    
    562 562
         if (error)
    
    563
    -      defaults.cffHintingEngineOther = -1;
    
    563
    +      engineDefaults_.cffHintingEngineOther = -1;
    
    564 564
     
    
    565 565
         // reset
    
    566
    -    FT_Property_Set(library,
    
    566
    +    FT_Property_Set(library_,
    
    567 567
                         "cff",
    
    568 568
                         "hinting-engine",
    
    569
    -                    &defaults.cffHintingEngineDefault);
    
    569
    +                    &engineDefaults_.cffHintingEngineDefault);
    
    570 570
       }
    
    571 571
     
    
    572 572
       // TrueType
    
    573
    -  error = FT_Property_Get(library,
    
    573
    +  error = FT_Property_Get(library_,
    
    574 574
                               "truetype",
    
    575 575
                               "interpreter-version",
    
    576
    -                          &defaults.ttInterpreterVersionDefault);
    
    576
    +                          &engineDefaults_.ttInterpreterVersionDefault);
    
    577 577
       if (error)
    
    578 578
       {
    
    579 579
         // no TrueType engine
    
    580
    -    defaults.ttInterpreterVersionDefault = -1;
    
    581
    -    defaults.ttInterpreterVersionOther = -1;
    
    582
    -    defaults.ttInterpreterVersionOther1 = -1;
    
    580
    +    engineDefaults_.ttInterpreterVersionDefault = -1;
    
    581
    +    engineDefaults_.ttInterpreterVersionOther = -1;
    
    582
    +    engineDefaults_.ttInterpreterVersionOther1 = -1;
    
    583 583
       }
    
    584 584
       else
    
    585 585
       {
    
    ... ... @@ -592,32 +592,32 @@ Engine::queryEngine()
    592 592
     
    
    593 593
         int i;
    
    594 594
         for (i = 0; i < 3; i++)
    
    595
    -      if (defaults.ttInterpreterVersionDefault == interpreters[i])
    
    595
    +      if (engineDefaults_.ttInterpreterVersionDefault == interpreters[i])
    
    596 596
             break;
    
    597 597
     
    
    598
    -    defaults.ttInterpreterVersionOther = interpreters[(i + 1) % 3];
    
    598
    +    engineDefaults_.ttInterpreterVersionOther = interpreters[(i + 1) % 3];
    
    599 599
     
    
    600
    -    error = FT_Property_Set(library,
    
    600
    +    error = FT_Property_Set(library_,
    
    601 601
                                 "truetype",
    
    602 602
                                 "interpreter-version",
    
    603
    -                            &defaults.ttInterpreterVersionOther);
    
    603
    +                            &engineDefaults_.ttInterpreterVersionOther);
    
    604 604
         if (error)
    
    605
    -      defaults.ttInterpreterVersionOther = -1;
    
    605
    +      engineDefaults_.ttInterpreterVersionOther = -1;
    
    606 606
     
    
    607
    -    defaults.ttInterpreterVersionOther1 = interpreters[(i + 2) % 3];
    
    607
    +    engineDefaults_.ttInterpreterVersionOther1 = interpreters[(i + 2) % 3];
    
    608 608
     
    
    609
    -    error = FT_Property_Set(library,
    
    609
    +    error = FT_Property_Set(library_,
    
    610 610
                                 "truetype",
    
    611 611
                                 "interpreter-version",
    
    612
    -                            &defaults.ttInterpreterVersionOther1);
    
    612
    +                            &engineDefaults_.ttInterpreterVersionOther1);
    
    613 613
         if (error)
    
    614
    -      defaults.ttInterpreterVersionOther1 = -1;
    
    614
    +      engineDefaults_.ttInterpreterVersionOther1 = -1;
    
    615 615
     
    
    616 616
         // reset
    
    617
    -    FT_Property_Set(library,
    
    617
    +    FT_Property_Set(library_,
    
    618 618
                         "truetype",
    
    619 619
                         "interpreter-version",
    
    620
    -                    &defaults.ttInterpreterVersionDefault);
    
    620
    +                    &engineDefaults_.ttInterpreterVersionDefault);
    
    621 621
       }
    
    622 622
     }
    
    623 623
     
    

  • src/ftinspect/engine/engine.hpp
    ... ... @@ -80,10 +80,10 @@ public:
    80 80
     
    
    81 81
       //////// Getters
    
    82 82
     
    
    83
    -  FT_Library ftLibrary() const { return library; }
    
    84
    -  int currentFontType() const { return fontType; }
    
    85
    -  const QString& currentFamilyName() { return curFamilyName; }
    
    86
    -  const QString& currentStyleName() { return curStyleName; }
    
    83
    +  FT_Library ftLibrary() const { return library_; }
    
    84
    +  int currentFontType() const { return fontType_; }
    
    85
    +  const QString& currentFamilyName() { return curFamilyName_; }
    
    86
    +  const QString& currentStyleName() { return curStyleName_; }
    
    87 87
       int numberOfOpenedFonts();
    
    88 88
       QString glyphName(int glyphIndex);
    
    89 89
       long numberOfFaces(int fontIndex);
    
    ... ... @@ -93,31 +93,31 @@ public:
    93 93
       // XXX We should prepend '_' to all private member variable so we can create
    
    94 94
       // getter without naming conflict... e.g. var named _fontFileManager while
    
    95 95
       // getter named fontFileManager
    
    96
    -  FontFileManager& fontFileManager() { return fileManager; }
    
    97
    -  EngineDefaultValues& engineDefaults() { return defaults; }
    
    96
    +  FontFileManager& fontFileManager() { return fontFileManager_; }
    
    97
    +  EngineDefaultValues& engineDefaults() { return engineDefaults_; }
    
    98 98
     
    
    99 99
       //////// Setters (direct or indirect)
    
    100 100
     
    
    101
    -  void setDPI(int d) { dpi = d; }
    
    101
    +  void setDPI(int d) { dpi_ = d; }
    
    102 102
       void setSizeByPixel(double pixelSize);
    
    103 103
       void setSizeByPoint(double pointSize);
    
    104
    -  void setHinting(bool hinting) { doHinting = hinting; }
    
    105
    -  void setAutoHinting(bool autoHinting) { doAutoHinting = autoHinting; }
    
    104
    +  void setHinting(bool hinting) { doHinting_ = hinting; }
    
    105
    +  void setAutoHinting(bool autoHinting) { doAutoHinting_ = autoHinting; }
    
    106 106
       void setHorizontalHinting(bool horHinting)
    
    107 107
       {
    
    108
    -    doHorizontalHinting = horHinting;
    
    108
    +    doHorizontalHinting_ = horHinting;
    
    109 109
       }
    
    110 110
       void setVerticalHinting(bool verticalHinting)
    
    111 111
       {
    
    112
    -    doVerticalHinting = verticalHinting;
    
    112
    +    doVerticalHinting_ = verticalHinting;
    
    113 113
       }
    
    114 114
       void setBlueZoneHinting(bool blueZoneHinting)
    
    115 115
       {
    
    116
    -    doBlueZoneHinting = blueZoneHinting;
    
    116
    +    doBlueZoneHinting_ = blueZoneHinting;
    
    117 117
       }
    
    118
    -  void setShowSegments(bool showSegments) { this->showSegments = showSegments; }
    
    119
    -  void setGamma(double gamma) { this->gamma = gamma; }
    
    120
    -  void setAntiAliasingMode(AntiAliasing mode) { antiAliasingMode = mode; }
    
    118
    +  void setShowSegments(bool showSegments) { showSegments_ = showSegments; }
    
    119
    +  void setGamma(double gamma) { gamma_ = gamma; }
    
    120
    +  void setAntiAliasingMode(AntiAliasing mode) { antiAliasingMode_ = mode; }
    
    121 121
     
    
    122 122
       // Note: These 3 functions now takes actual mode/version from FreeType,
    
    123 123
       // instead of values from enum in MainGUI!
    
    ... ... @@ -134,42 +134,42 @@ public:
    134 134
     
    
    135 135
     private:
    
    136 136
       using FTC_IDType = uintptr_t;
    
    137
    -  FTC_IDType faceCounter; // a running number used to initialize `faceIDMap'
    
    138
    -  QMap<FaceID, FTC_IDType> faceIDMap;
    
    137
    +  FTC_IDType faceCounter_; // a running number used to initialize `faceIDMap'
    
    138
    +  QMap<FaceID, FTC_IDType> faceIDMap_;
    
    139 139
     
    
    140
    -  FontFileManager fileManager;
    
    140
    +  FontFileManager fontFileManager_;
    
    141 141
     
    
    142
    -  QString curFamilyName;
    
    143
    -  QString curStyleName;
    
    142
    +  QString curFamilyName_;
    
    143
    +  QString curStyleName_;
    
    144 144
     
    
    145
    -  FT_Library library;
    
    146
    -  FTC_Manager cacheManager;
    
    147
    -  FTC_ImageCache imageCache;
    
    148
    -  FTC_SBitCache sbitsCache;
    
    145
    +  FT_Library library_;
    
    146
    +  FTC_Manager cacheManager_;
    
    147
    +  FTC_ImageCache imageCache_;
    
    148
    +  FTC_SBitCache sbitsCache_;
    
    149 149
     
    
    150
    -  FTC_ScalerRec scaler;
    
    151
    -  FT_Size ftSize;
    
    150
    +  FTC_ScalerRec scaler_;
    
    151
    +  FT_Size ftSize_;
    
    152 152
     
    
    153
    -  EngineDefaultValues defaults;
    
    153
    +  EngineDefaultValues engineDefaults_;
    
    154 154
     
    
    155
    -  int fontType;
    
    155
    +  int fontType_;
    
    156 156
     
    
    157
    -  bool usingPixelSize = false;
    
    158
    -  double pointSize;
    
    159
    -  double pixelSize;
    
    160
    -  unsigned int dpi;
    
    157
    +  bool usingPixelSize_ = false;
    
    158
    +  double pointSize_;
    
    159
    +  double pixelSize_;
    
    160
    +  unsigned int dpi_;
    
    161 161
     
    
    162
    -  bool doHinting;
    
    163
    -  bool doAutoHinting;
    
    164
    -  bool doHorizontalHinting;
    
    165
    -  bool doVerticalHinting;
    
    166
    -  bool doBlueZoneHinting;
    
    167
    -  bool showSegments;
    
    168
    -  AntiAliasing antiAliasingMode;
    
    162
    +  bool doHinting_;
    
    163
    +  bool doAutoHinting_;
    
    164
    +  bool doHorizontalHinting_;
    
    165
    +  bool doVerticalHinting_;
    
    166
    +  bool doBlueZoneHinting_;
    
    167
    +  bool showSegments_;
    
    168
    +  AntiAliasing antiAliasingMode_;
    
    169 169
     
    
    170
    -  double gamma;
    
    170
    +  double gamma_;
    
    171 171
     
    
    172
    -  unsigned long loadFlags;
    
    172
    +  unsigned long loadFlags_;
    
    173 173
     
    
    174 174
       void queryEngine();
    
    175 175
     
    

  • src/ftinspect/engine/fontfilemanager.cpp
    ... ... @@ -7,14 +7,14 @@
    7 7
     
    
    8 8
     FontFileManager::FontFileManager()
    
    9 9
     {
    
    10
    -  fontWatcher = new QFileSystemWatcher(this);
    
    10
    +  fontWatcher_ = new QFileSystemWatcher(this);
    
    11 11
       // if the current input file is invalid we retry once a second to load it
    
    12
    -  watchTimer = new QTimer;
    
    13
    -  watchTimer->setInterval(1000);
    
    12
    +  watchTimer_ = new QTimer;
    
    13
    +  watchTimer_->setInterval(1000);
    
    14 14
     
    
    15
    -  connect(fontWatcher, &QFileSystemWatcher::fileChanged,
    
    15
    +  connect(fontWatcher_, &QFileSystemWatcher::fileChanged,
    
    16 16
               this, &FontFileManager::onTimerOrWatcherFire);
    
    17
    -  connect(watchTimer, &QTimer::timeout,
    
    17
    +  connect(watchTimer_, &QTimer::timeout,
    
    18 18
               this, &FontFileManager::onTimerOrWatcherFire);
    
    19 19
     }
    
    20 20
     
    
    ... ... @@ -25,7 +25,7 @@ FontFileManager::~FontFileManager()
    25 25
     int
    
    26 26
     FontFileManager::size()
    
    27 27
     {
    
    28
    -  return fontFileNameList.size();
    
    28
    +  return fontFileNameList_.size();
    
    29 29
     }
    
    30 30
     
    
    31 31
     void
    
    ... ... @@ -42,7 +42,7 @@ FontFileManager::append(QStringList newFileNames)
    42 42
         // Uniquify elements
    
    43 43
         auto absPath = info.absoluteFilePath();
    
    44 44
         auto existing = false;
    
    45
    -    for (auto& existingName : fontFileNameList)
    
    45
    +    for (auto& existingName : fontFileNameList_)
    
    46 46
           if (existingName.absoluteFilePath() == absPath)
    
    47 47
           {
    
    48 48
             existing = true;
    
    ... ... @@ -51,7 +51,7 @@ FontFileManager::append(QStringList newFileNames)
    51 51
         if (existing)
    
    52 52
           continue;
    
    53 53
     
    
    54
    -    fontFileNameList.append(info);
    
    54
    +    fontFileNameList_.append(info);
    
    55 55
       }
    
    56 56
     }
    
    57 57
     
    
    ... ... @@ -61,42 +61,42 @@ FontFileManager::remove(int index)
    61 61
       if (index < 0 || index >= size())
    
    62 62
         return;
    
    63 63
     
    
    64
    -  fontWatcher->removePath(fontFileNameList[index].filePath());
    
    65
    -  fontFileNameList.removeAt(index);
    
    64
    +  fontWatcher_->removePath(fontFileNameList_[index].filePath());
    
    65
    +  fontFileNameList_.removeAt(index);
    
    66 66
     }
    
    67 67
     
    
    68 68
     QFileInfo&
    
    69 69
     FontFileManager::operator[](int index)
    
    70 70
     {
    
    71
    -  return fontFileNameList[index];
    
    71
    +  return fontFileNameList_[index];
    
    72 72
     }
    
    73 73
     
    
    74 74
     void
    
    75 75
     FontFileManager::updateWatching(int index)
    
    76 76
     {
    
    77
    -  QFileInfo& fileInfo = fontFileNameList[index];
    
    77
    +  QFileInfo& fileInfo = fontFileNameList_[index];
    
    78 78
     
    
    79
    -  auto watching = fontWatcher->files();
    
    79
    +  auto watching = fontWatcher_->files();
    
    80 80
       if (!watching.empty())
    
    81
    -    fontWatcher->removePaths(watching);
    
    81
    +    fontWatcher_->removePaths(watching);
    
    82 82
     
    
    83 83
       // Qt's file watcher doesn't handle symlinks;
    
    84 84
       // we thus fall back to polling
    
    85 85
       if (fileInfo.isSymLink() || !fileInfo.exists())
    
    86
    -    watchTimer->start();
    
    86
    +    watchTimer_->start();
    
    87 87
       else
    
    88
    -    fontWatcher->addPath(fileInfo.filePath());
    
    88
    +    fontWatcher_->addPath(fileInfo.filePath());
    
    89 89
     }
    
    90 90
     
    
    91 91
     void
    
    92 92
     FontFileManager::timerStart()
    
    93 93
     {
    
    94
    -  watchTimer->start();
    
    94
    +  watchTimer_->start();
    
    95 95
     }
    
    96 96
     
    
    97 97
     void
    
    98 98
     FontFileManager::onTimerOrWatcherFire()
    
    99 99
     {
    
    100
    -  watchTimer->stop();
    
    100
    +  watchTimer_->stop();
    
    101 101
       emit currentFileChanged();
    
    102 102
     }

  • src/ftinspect/engine/fontfilemanager.hpp
    ... ... @@ -36,7 +36,7 @@ private slots:
    36 36
       void onTimerOrWatcherFire();
    
    37 37
     
    
    38 38
     private:
    
    39
    -  QList<QFileInfo> fontFileNameList;
    
    40
    -  QFileSystemWatcher* fontWatcher;
    
    41
    -  QTimer* watchTimer;
    
    39
    +  QList<QFileInfo> fontFileNameList_;
    
    40
    +  QFileSystemWatcher* fontWatcher_;
    
    41
    +  QTimer* watchTimer_;
    
    42 42
     };
    \ No newline at end of file

  • src/ftinspect/maingui.cpp
    ... ... @@ -16,7 +16,7 @@
    16 16
     
    
    17 17
     MainGUI::MainGUI()
    
    18 18
     {
    
    19
    -  engine = NULL;
    
    19
    +  engine_ = NULL;
    
    20 20
     
    
    21 21
       setGraphicsDefaults();
    
    22 22
       createLayout();
    
    ... ... @@ -40,12 +40,12 @@ MainGUI::~MainGUI()
    40 40
     void
    
    41 41
     MainGUI::update(Engine* e)
    
    42 42
     {
    
    43
    -  if (engine)
    
    44
    -    disconnect(&engine->fontFileManager(), &FontFileManager::currentFileChanged,
    
    43
    +  if (engine_)
    
    44
    +    disconnect(&engine_->fontFileManager(), &FontFileManager::currentFileChanged,
    
    45 45
             this, &MainGUI::watchCurrentFont);
    
    46 46
     
    
    47
    -  engine = e;
    
    48
    -  connect(&engine->fontFileManager(), &FontFileManager::currentFileChanged,
    
    47
    +  engine_ = e;
    
    48
    +  connect(&engine_->fontFileManager(), &FontFileManager::currentFileChanged,
    
    49 49
               this, &MainGUI::watchCurrentFont);
    
    50 50
     }
    
    51 51
     
    
    ... ... @@ -94,7 +94,7 @@ MainGUI::aboutQt()
    94 94
     void
    
    95 95
     MainGUI::loadFonts()
    
    96 96
     {
    
    97
    -  int oldSize = engine->numberOfOpenedFonts();
    
    97
    +  int oldSize = engine_->numberOfOpenedFonts();
    
    98 98
     
    
    99 99
       QStringList files = QFileDialog::getOpenFileNames(
    
    100 100
                             this,
    
    ... ... @@ -104,11 +104,11 @@ MainGUI::loadFonts()
    104 104
                             NULL,
    
    105 105
                             QFileDialog::ReadOnly);
    
    106 106