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-3] [ftinspect] Add SFNT


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri-3] [ftinspect] Add SFNT names showing.,
Date: Mon, 15 Aug 2022 18:48:03 +0000

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

Commits:

  • 73487d96
    by Charlie Jiang at 2022-08-16T02:47:46+08:00
    [ftinspect] Add SFNT names showing.,
    
    Commit message WIP.
    

13 changed files:

Changes:

  • src/ftinspect/CMakeLists.txt
    ... ... @@ -26,6 +26,7 @@ add_executable(ftinspect
    26 26
       "engine/paletteinfo.cpp"
    
    27 27
       "engine/stringrenderer.cpp"
    
    28 28
       "engine/fontinfo.cpp"
    
    29
    +  "engine/fontinfonamesmapping.cpp"
    
    29 30
     
    
    30 31
       "rendering/glyphbitmap.cpp"
    
    31 32
       "rendering/glyphoutline.cpp"
    

  • src/ftinspect/engine/charmap.cpp
    ... ... @@ -8,6 +8,7 @@
    8 8
     #include <freetype/freetype.h>
    
    9 9
     #include <freetype/tttables.h>
    
    10 10
     
    
    11
    +// Mapping for `FT_Encoding` is placed here since it's only for the charmap.
    
    11 12
     QHash<FT_Encoding, QString> encodingNamesCache;
    
    12 13
     QHash<FT_Encoding, QString>&
    
    13 14
     encodingNames()
    

  • src/ftinspect/engine/engine.cpp
    ... ... @@ -323,6 +323,7 @@ Engine::loadFont(int fontIndex,
    323 323
     
    
    324 324
         curCharMaps_.clear();
    
    325 325
         curPaletteInfos_.clear();
    
    326
    +    curSFNTNames_.clear();
    
    326 327
       }
    
    327 328
       else
    
    328 329
       {
    
    ... ... @@ -343,6 +344,8 @@ Engine::loadFont(int fontIndex,
    343 344
         for (int i = 0; i < face->num_charmaps; i++)
    
    344 345
           curCharMaps_.emplace_back(i, face->charmaps[i]);
    
    345 346
     
    
    347
    +    SFNTName::get(this, curSFNTNames_);
    
    348
    +
    
    346 349
         loadPaletteInfos();
    
    347 350
       }
    
    348 351
     
    

  • src/ftinspect/engine/engine.hpp
    ... ... @@ -8,6 +8,7 @@
    8 8
     #include "fontfilemanager.hpp"
    
    9 9
     #include "charmap.hpp"
    
    10 10
     #include "paletteinfo.hpp"
    
    11
    +#include "fontinfo.hpp"
    
    11 12
     
    
    12 13
     #include <vector>
    
    13 14
     #include <utility>
    
    ... ... @@ -153,6 +154,7 @@ public:
    153 154
       
    
    154 155
       std::vector<CharMapInfo>& currentFontCharMaps() { return curCharMaps_; }
    
    155 156
       std::vector<PaletteInfo>& currentFontPalettes() { return curPaletteInfos_; }
    
    157
    +  std::vector<SFNTName>& currentFontSFNTNames() { return curSFNTNames_; }
    
    156 158
       FontFileManager& fontFileManager() { return fontFileManager_; }
    
    157 159
       EngineDefaultValues& engineDefaults() { return engineDefaults_; }
    
    158 160
       bool antiAliasingEnabled() { return antiAliasingEnabled_; }
    
    ... ... @@ -221,6 +223,7 @@ private:
    221 223
       QString curFamilyName_;
    
    222 224
       QString curStyleName_;
    
    223 225
       int curNumGlyphs_ = -1;
    
    226
    +  std::vector<SFNTName> curSFNTNames_;
    
    224 227
       std::vector<CharMapInfo> curCharMaps_;
    
    225 228
       std::vector<PaletteInfo> curPaletteInfos_;
    
    226 229
     
    

  • src/ftinspect/engine/fontinfo.cpp
    ... ... @@ -6,10 +6,116 @@
    6 6
     
    
    7 7
     #include "engine.hpp"
    
    8 8
     
    
    9
    +#include <unordered_map>
    
    10
    +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    
    11
    +#include <QTextCodec>
    
    12
    +#else
    
    13
    +#include <QStringConverter>
    
    14
    +#include <QByteArrayView>
    
    15
    +#endif
    
    9 16
     #include <freetype/ftmodapi.h>
    
    17
    +#include <freetype/ttnameid.h>
    
    10 18
     #include <freetype/tttables.h>
    
    11 19
     
    
    12 20
     
    
    21
    +void
    
    22
    +SFNTName::get(Engine* engine,
    
    23
    +  std::vector<SFNTName>& list)
    
    24
    +{
    
    25
    +  auto size = engine->currentFtSize();
    
    26
    +  if (!size || !FT_IS_SFNT(size->face))
    
    27
    +  {
    
    28
    +    list.clear();
    
    29
    +    return;
    
    30
    +  }
    
    31
    +
    
    32
    +  auto face = size->face;
    
    33
    +  auto newSize = FT_Get_Sfnt_Name_Count(face);
    
    34
    +  if (list.size() != static_cast<size_t>(newSize))
    
    35
    +    list.resize(newSize);
    
    36
    +
    
    37
    +  FT_SfntName sfntName;
    
    38
    +  FT_SfntLangTag langTag;
    
    39
    +  for (unsigned int i = 0; i < newSize; ++i)
    
    40
    +  {
    
    41
    +    FT_Get_Sfnt_Name(face, i, &sfntName);
    
    42
    +    auto& obj = list[i];
    
    43
    +    obj.platformID = sfntName.platform_id;
    
    44
    +    obj.encodingID = sfntName.encoding_id;
    
    45
    +    obj.languageID = sfntName.language_id;
    
    46
    +    obj.nameID = sfntName.name_id;
    
    47
    +    obj.str = sfntNameToQString(sfntName);
    
    48
    +
    
    49
    +    if (obj.languageID >= 0x8000)
    
    50
    +    {
    
    51
    +      auto err = FT_Get_Sfnt_LangTag(face, obj.languageID, &langTag);
    
    52
    +      if (!err)
    
    53
    +        obj.langTag = utf16BEToQString(langTag.string, langTag.string_len);
    
    54
    +    }
    
    55
    +  }
    
    56
    +}
    
    57
    +
    
    58
    +
    
    59
    +QString
    
    60
    +SFNTName::sfntNameToQString(FT_SfntName& sfntName)
    
    61
    +{
    
    62
    +  switch (sfntName.platform_id)
    
    63
    +  {
    
    64
    +  case TT_PLATFORM_APPLE_UNICODE:
    
    65
    +    // All UTF-16BE.
    
    66
    +    return utf16BEToQString(sfntName.string, sfntName.string_len);
    
    67
    +  case TT_PLATFORM_MACINTOSH:
    
    68
    +    return QString::fromLatin1(reinterpret_cast<char*>(sfntName.string),
    
    69
    +                               sfntName.string_len);
    
    70
    +  case TT_PLATFORM_ISO:
    
    71
    +    switch (sfntName.encoding_id)
    
    72
    +    {
    
    73
    +    case TT_ISO_ID_7BIT_ASCII:
    
    74
    +    case TT_ISO_ID_8859_1:
    
    75
    +      return QString::fromLatin1(reinterpret_cast<char*>(sfntName.string),
    
    76
    +                                 sfntName.string_len);
    
    77
    +    case TT_ISO_ID_10646:
    
    78
    +      return utf16BEToQString(sfntName.string, sfntName.string_len);
    
    79
    +    default:
    
    80
    +      return "<encoding unsupported>";
    
    81
    +    }
    
    82
    +  case TT_PLATFORM_MICROSOFT:
    
    83
    +    switch (sfntName.encoding_id)
    
    84
    +    {
    
    85
    +      /* TT_MS_ID_SYMBOL_CS is Unicode, similar to PID/EID=3/1 */
    
    86
    +    case TT_MS_ID_SYMBOL_CS:
    
    87
    +    case TT_MS_ID_UNICODE_CS:
    
    88
    +      return utf16BEToQString(sfntName.string, sfntName.string_len);
    
    89
    +
    
    90
    +    default:
    
    91
    +      return "<encoding unsupported>";
    
    92
    +    }
    
    93
    +  }
    
    94
    +  return "<platform unsupported>";
    
    95
    +}
    
    96
    +
    
    97
    +
    
    98
    +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    
    99
    +QTextCodec* utf16BECodec = QTextCodec::codecForName("UTF-16BE");
    
    100
    +#else
    
    101
    +QStringDecoder utf16BECvt = (QStringDecoder(QStringDecoder::Utf16BE))(size);
    
    102
    +#endif
    
    103
    +
    
    104
    +QString
    
    105
    +SFNTName::utf16BEToQString(unsigned char* str,
    
    106
    +                           size_t size)
    
    107
    +{
    
    108
    +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    
    109
    +  if (size >= INT_MAX)
    
    110
    +    size = INT_MAX - 1;
    
    111
    +  return utf16BECodec->toUnicode(reinterpret_cast<char*>(str),
    
    112
    +                                 static_cast<int>(size));
    
    113
    +#else
    
    114
    +  return utf16BECvt(QByteArrayView(reinterpret_cast<char*>(str), size));
    
    115
    +#endif
    
    116
    +}
    
    117
    +
    
    118
    +
    
    13 119
     FontBasicInfo
    
    14 120
     FontBasicInfo::get(Engine* engine)
    
    15 121
     {
    

  • src/ftinspect/engine/fontinfo.hpp
    ... ... @@ -7,14 +7,47 @@
    7 7
     #include <QDateTime>
    
    8 8
     #include <QString>
    
    9 9
     #include <freetype/freetype.h>
    
    10
    +#include <freetype/ftsnames.h>
    
    10 11
     
    
    11 12
     class Engine;
    
    12 13
     
    
    13
    -struct SFNTNameTable
    
    14
    +struct SFNTName
    
    14 15
     {
    
    15
    -  
    
    16
    +  unsigned short nameID;
    
    17
    +  unsigned short platformID;
    
    18
    +  unsigned short encodingID;
    
    19
    +  unsigned short languageID;
    
    20
    +  QString str;
    
    21
    +  QString langTag;
    
    22
    +
    
    23
    +  static void get(Engine* engine,
    
    24
    +                  std::vector<SFNTName>& list);
    
    25
    +  static QString sfntNameToQString(FT_SfntName& sfntName);
    
    26
    +  static QString utf16BEToQString(unsigned char* str, size_t size);
    
    27
    +
    
    28
    +
    
    29
    +  friend bool
    
    30
    +  operator==(const SFNTName& lhs,
    
    31
    +             const SFNTName& rhs)
    
    32
    +  {
    
    33
    +    return lhs.nameID == rhs.nameID
    
    34
    +      && lhs.platformID == rhs.platformID
    
    35
    +      && lhs.encodingID == rhs.encodingID
    
    36
    +      && lhs.languageID == rhs.languageID
    
    37
    +      && lhs.str == rhs.str
    
    38
    +      && lhs.langTag == rhs.langTag;
    
    39
    +  }
    
    40
    +
    
    41
    +
    
    42
    +  friend bool
    
    43
    +  operator!=(const SFNTName& lhs,
    
    44
    +             const SFNTName& rhs)
    
    45
    +  {
    
    46
    +    return !(lhs == rhs);
    
    47
    +  }
    
    16 48
     };
    
    17 49
     
    
    50
    +
    
    18 51
     struct FontBasicInfo
    
    19 52
     {
    
    20 53
       int numFaces = -1;
    
    ... ... @@ -159,4 +192,12 @@ struct FontFixedSize
    159 192
     };
    
    160 193
     
    
    161 194
     
    
    195
    +QString* mapSFNTNameIDToName(unsigned short nameID);
    
    196
    +QString* mapTTPlatformIDToName(unsigned short platformID);
    
    197
    +QString* mapTTEncodingIDToName(unsigned short platformID,
    
    198
    +                               unsigned short encodingID);
    
    199
    +QString* mapTTLanguageIDToName(unsigned short platformID,
    
    200
    +                               unsigned short languageID);
    
    201
    +
    
    202
    +
    
    162 203
     // end of fontinfo.hpp

  • src/ftinspect/engine/fontinfonamesmapping.cpp
    1
    +// fontinfonamesmapping.cpp
    
    2
    +
    
    3
    +// Copyright (C) 2022 by Charlie Jiang.
    
    4
    +
    
    5
    +#include "fontinfo.hpp"
    
    6
    +
    
    7
    +#include <unordered_map>
    
    8
    +#include <freetype/ttnameid.h>
    
    9
    +
    
    10
    +#define FTI_UnknownID 0xFFFE
    
    11
    +
    
    12
    +// No more Qt containers since there's no any apparent advantage.
    
    13
    +using TableType = std::unordered_map<unsigned short, QString>;
    
    14
    +TableType ttSFNTNames;
    
    15
    +
    
    16
    +TableType ttPlatformNames;
    
    17
    +TableType ttEncodingUnicodeNames;
    
    18
    +TableType ttEncodingMacNames;
    
    19
    +TableType ttEncodingWindowsNames;
    
    20
    +TableType ttEncodingISONames;
    
    21
    +TableType ttEncodingAdobeNames;
    
    22
    +
    
    23
    +TableType ttLanguageMacNames;
    
    24
    +TableType ttLanguageWindowsNames;
    
    25
    +
    
    26
    +QString*
    
    27
    +mapSFNTNameIDToName(unsigned short nameID)
    
    28
    +{
    
    29
    +  if (ttSFNTNames.empty())
    
    30
    +  {
    
    31
    +    ttSFNTNames[FTI_UnknownID] = "Unknown";
    
    32
    +    ttSFNTNames[TT_NAME_ID_COPYRIGHT] = "Copyright";
    
    33
    +    ttSFNTNames[TT_NAME_ID_FONT_FAMILY] = "Font Family";
    
    34
    +    ttSFNTNames[TT_NAME_ID_FONT_SUBFAMILY] = "Font Subfamily";
    
    35
    +    ttSFNTNames[TT_NAME_ID_UNIQUE_ID] = "Unique Font ID";
    
    36
    +    ttSFNTNames[TT_NAME_ID_FULL_NAME] = "Full Name";
    
    37
    +    ttSFNTNames[TT_NAME_ID_VERSION_STRING] = "Version String";
    
    38
    +    ttSFNTNames[TT_NAME_ID_PS_NAME] = "PostScript Name";
    
    39
    +    ttSFNTNames[TT_NAME_ID_TRADEMARK] = "Trademark";
    
    40
    +    ttSFNTNames[TT_NAME_ID_MANUFACTURER] = "Manufacturer";
    
    41
    +    ttSFNTNames[TT_NAME_ID_DESIGNER] = "Designer";
    
    42
    +    ttSFNTNames[TT_NAME_ID_DESCRIPTION] = "Description";
    
    43
    +    ttSFNTNames[TT_NAME_ID_VENDOR_URL] = "Vendor URL";
    
    44
    +    ttSFNTNames[TT_NAME_ID_DESIGNER_URL] = "Designer URL";
    
    45
    +    ttSFNTNames[TT_NAME_ID_LICENSE] = "License";
    
    46
    +    ttSFNTNames[TT_NAME_ID_LICENSE_URL] = "License URL";
    
    47
    +    ttSFNTNames[TT_NAME_ID_TYPOGRAPHIC_FAMILY] = "Typographic Family";
    
    48
    +    ttSFNTNames[TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY] = "Typographic Subfamily";
    
    49
    +    ttSFNTNames[TT_NAME_ID_MAC_FULL_NAME] = "Mac Full Name";
    
    50
    +    ttSFNTNames[TT_NAME_ID_SAMPLE_TEXT] = "Sample Text";
    
    51
    +    ttSFNTNames[TT_NAME_ID_WWS_FAMILY] = "WWS Family Name";
    
    52
    +    ttSFNTNames[TT_NAME_ID_WWS_SUBFAMILY] = "WWS Subfamily Name";
    
    53
    +    ttSFNTNames[TT_NAME_ID_LIGHT_BACKGROUND] = "Light Background Palette";
    
    54
    +    ttSFNTNames[TT_NAME_ID_DARK_BACKGROUND] = "Dark Background Palette";
    
    55
    +    ttSFNTNames[TT_NAME_ID_VARIATIONS_PREFIX]
    
    56
    +      = "Variations PostScript Name Prefix";
    
    57
    +  }
    
    58
    +
    
    59
    +  auto it = ttSFNTNames.find(nameID);
    
    60
    +  if (it == ttSFNTNames.end())
    
    61
    +    return &ttSFNTNames[FTI_UnknownID];
    
    62
    +  return &it->second;
    
    63
    +}
    
    64
    +
    
    65
    +QString*
    
    66
    +mapTTPlatformIDToName(unsigned short platformID)
    
    67
    +{
    
    68
    +  if (ttPlatformNames.empty())
    
    69
    +  {
    
    70
    +    ttPlatformNames[FTI_UnknownID] = "Unknown Platform";
    
    71
    +    // Unicode codepoints are encoded as UTF-16BE
    
    72
    +    ttPlatformNames[TT_PLATFORM_APPLE_UNICODE] = "Apple (Unicode)";
    
    73
    +    ttPlatformNames[TT_PLATFORM_MACINTOSH] = "Macintosh";
    
    74
    +    ttPlatformNames[TT_PLATFORM_ISO] = "ISO (deprecated)";
    
    75
    +    ttPlatformNames[TT_PLATFORM_MICROSOFT] = "Microsoft";
    
    76
    +    ttPlatformNames[TT_PLATFORM_CUSTOM] = "Custom";
    
    77
    +    ttPlatformNames[TT_PLATFORM_ADOBE] = "Adobe";
    
    78
    +  }
    
    79
    +  
    
    80
    +  auto it = ttPlatformNames.find(platformID);
    
    81
    +  if (it == ttPlatformNames.end())
    
    82
    +    return &ttPlatformNames[FTI_UnknownID];
    
    83
    +  return &it->second;
    
    84
    +}
    
    85
    +
    
    86
    +
    
    87
    +QString*
    
    88
    +mapTTEncodingIDToName(unsigned short platformID, 
    
    89
    +                      unsigned short encodingID)
    
    90
    +{
    
    91
    +  if (ttEncodingUnicodeNames.empty())
    
    92
    +  {
    
    93
    +    // Note: different from the Apple doc.
    
    94
    +    ttEncodingUnicodeNames[FTI_UnknownID] = "Unknown Encoding";
    
    95
    +    ttEncodingUnicodeNames[TT_APPLE_ID_DEFAULT] = "Unicode 1.0";
    
    96
    +    ttEncodingUnicodeNames[TT_APPLE_ID_UNICODE_1_1] = "Unicode 1.1";
    
    97
    +    ttEncodingUnicodeNames[TT_APPLE_ID_ISO_10646] = "ISO/IEC 10646";
    
    98
    +    ttEncodingUnicodeNames[TT_APPLE_ID_UNICODE_2_0]
    
    99
    +        = "Unicode 2.0 or later (BMP only)";
    
    100
    +    ttEncodingUnicodeNames[TT_APPLE_ID_UNICODE_32]
    
    101
    +        = "Unicode 2.0 or later (non-BMP characters allowed)";
    
    102
    +    //ttEncodingUnicodeNames[TT_APPLE_ID_VARIANT_SELECTOR] = "Variant Selector";
    
    103
    +    //ttEncodingUnicodeNames[TT_APPLE_ID_FULL_UNICODE] = ???;
    
    104
    +  }
    
    105
    +
    
    106
    +  if (ttEncodingMacNames.empty())
    
    107
    +  {
    
    108
    +    ttEncodingMacNames[FTI_UnknownID] = "Unknown Encoding";
    
    109
    +    ttEncodingMacNames[0] = "Roman";
    
    110
    +    ttEncodingMacNames[1] = "Japanese";
    
    111
    +    ttEncodingMacNames[2] = "Chinese (Traditional)";
    
    112
    +    ttEncodingMacNames[3] = "Korean";
    
    113
    +    ttEncodingMacNames[4] = "Arabic";
    
    114
    +    ttEncodingMacNames[5] = "Hebrew";
    
    115
    +    ttEncodingMacNames[6] = "Greek";
    
    116
    +    ttEncodingMacNames[7] = "Russian";
    
    117
    +    ttEncodingMacNames[8] = "RSymbol";
    
    118
    +    ttEncodingMacNames[9] = "Devanagari";
    
    119
    +    ttEncodingMacNames[10] = "Gurmukhi";
    
    120
    +    ttEncodingMacNames[11] = "Gujarati";
    
    121
    +    ttEncodingMacNames[12] = "Oriya";
    
    122
    +    ttEncodingMacNames[13] = "Bengali";
    
    123
    +    ttEncodingMacNames[14] = "Tamil";
    
    124
    +    ttEncodingMacNames[15] = "Telugu";
    
    125
    +    ttEncodingMacNames[16] = "Kannada";
    
    126
    +    ttEncodingMacNames[17] = "Malayalam";
    
    127
    +    ttEncodingMacNames[18] = "Sinhalese";
    
    128
    +    ttEncodingMacNames[19] = "Burmese";
    
    129
    +    ttEncodingMacNames[20] = "Khmer";
    
    130
    +    ttEncodingMacNames[21] = "Thai";
    
    131
    +    ttEncodingMacNames[22] = "Laotian";
    
    132
    +    ttEncodingMacNames[23] = "Georgian";
    
    133
    +    ttEncodingMacNames[24] = "Armenian";
    
    134
    +    ttEncodingMacNames[25] = "Chinese (Simplified)";
    
    135
    +    ttEncodingMacNames[26] = "Tibetan";
    
    136
    +    ttEncodingMacNames[27] = "Mongolian";
    
    137
    +    ttEncodingMacNames[28] = "Geez";
    
    138
    +    ttEncodingMacNames[29] = "Slavic";
    
    139
    +    ttEncodingMacNames[30] = "Vietnamese";
    
    140
    +    ttEncodingMacNames[31] = "Sindhi";
    
    141
    +    ttEncodingMacNames[32] = "Uninterpreted";
    
    142
    +  }
    
    143
    +
    
    144
    +  if (ttEncodingWindowsNames.empty())
    
    145
    +  {
    
    146
    +    ttEncodingMacNames[FTI_UnknownID] = "Unknown Encoding";
    
    147
    +    ttEncodingWindowsNames[0] = "Symbol";
    
    148
    +    ttEncodingWindowsNames[1] = "Unicode BMP";
    
    149
    +    ttEncodingWindowsNames[2] = "ShiftJIS";
    
    150
    +    ttEncodingWindowsNames[3] = "PRC";
    
    151
    +    ttEncodingWindowsNames[4] = "Big5";
    
    152
    +    ttEncodingWindowsNames[5] = "Wansung";
    
    153
    +    ttEncodingWindowsNames[6] = "Johab";
    
    154
    +    ttEncodingWindowsNames[7] = "Reserved";
    
    155
    +    ttEncodingWindowsNames[8] = "Reserved";
    
    156
    +    ttEncodingWindowsNames[9] = "Reserved";
    
    157
    +    ttEncodingWindowsNames[10] = "Unicode full repertoire";
    
    158
    +  }
    
    159
    +
    
    160
    +  if (ttEncodingISONames.empty())
    
    161
    +  {
    
    162
    +    ttEncodingISONames[FTI_UnknownID] = "Unknown Encoding";
    
    163
    +    ttEncodingISONames[TT_ISO_ID_7BIT_ASCII] = "ASCII";
    
    164
    +    ttEncodingISONames[TT_ISO_ID_10646] = "ISO/IEC 10646";
    
    165
    +    ttEncodingISONames[TT_ISO_ID_8859_1] = "ISO 8859-1";
    
    166
    +  }
    
    167
    +
    
    168
    +  if (ttEncodingAdobeNames.empty())
    
    169
    +  {
    
    170
    +    ttEncodingAdobeNames[FTI_UnknownID] = "Unknown Encoding";
    
    171
    +    ttEncodingAdobeNames[TT_ADOBE_ID_STANDARD] = "Adobe Standard";
    
    172
    +    ttEncodingAdobeNames[TT_ADOBE_ID_EXPERT] = "Adobe Expert";
    
    173
    +    ttEncodingAdobeNames[TT_ADOBE_ID_CUSTOM] = "Adobe Custom";
    
    174
    +    ttEncodingAdobeNames[TT_ADOBE_ID_LATIN_1] = "Adobe Latin 1";
    
    175
    +  }
    
    176
    +
    
    177
    +  TableType* table = NULL;
    
    178
    +
    
    179
    +  switch (platformID)
    
    180
    +  {
    
    181
    +  case TT_PLATFORM_APPLE_UNICODE:
    
    182
    +    table = &ttEncodingUnicodeNames;
    
    183
    +    break;
    
    184
    +  case TT_PLATFORM_MACINTOSH:
    
    185
    +    table = &ttEncodingMacNames;
    
    186
    +    break;
    
    187
    +  case TT_PLATFORM_MICROSOFT:
    
    188
    +    table = &ttEncodingWindowsNames;
    
    189
    +    break;
    
    190
    +  case TT_PLATFORM_ISO:
    
    191
    +    table = &ttEncodingISONames;
    
    192
    +    break;
    
    193
    +  case TT_PLATFORM_ADOBE:
    
    194
    +    table = &ttEncodingAdobeNames;
    
    195
    +    break;
    
    196
    +
    
    197
    +  default:
    
    198
    +    return &ttEncodingUnicodeNames[FTI_UnknownID];
    
    199
    +  }
    
    200
    +
    
    201
    +  auto it = table->find(encodingID);
    
    202
    +  if (it == table->end())
    
    203
    +    return &(*table)[FTI_UnknownID];
    
    204
    +  return &it->second;
    
    205
    +}
    
    206
    +
    
    207
    +
    
    208
    +QString*
    
    209
    +mapTTLanguageIDToName(unsigned short platformID,
    
    210
    +                      unsigned short languageID)
    
    211
    +{
    
    212
    +  if (ttLanguageMacNames.empty())
    
    213
    +  {
    
    214
    +    ttLanguageMacNames[FTI_UnknownID] = "Unknown Language";
    
    215
    +    ttLanguageMacNames[0] = "English";
    
    216
    +    ttLanguageMacNames[1] = "French";
    
    217
    +    ttLanguageMacNames[2] = "German";
    
    218
    +    ttLanguageMacNames[3] = "Italian";
    
    219
    +    ttLanguageMacNames[4] = "Dutch";
    
    220
    +    ttLanguageMacNames[5] = "Swedish";
    
    221
    +    ttLanguageMacNames[6] = "Spanish";
    
    222
    +    ttLanguageMacNames[7] = "Danish";
    
    223
    +    ttLanguageMacNames[8] = "Portuguese";
    
    224
    +    ttLanguageMacNames[9] = "Norwegian";
    
    225
    +    ttLanguageMacNames[10] = "Hebrew";
    
    226
    +    ttLanguageMacNames[11] = "Japanese";
    
    227
    +    ttLanguageMacNames[12] = "Arabic";
    
    228
    +    ttLanguageMacNames[13] = "Finnish";
    
    229
    +    ttLanguageMacNames[14] = "Greek";
    
    230
    +    ttLanguageMacNames[15] = "Icelandic";
    
    231
    +    ttLanguageMacNames[16] = "Maltese";
    
    232
    +    ttLanguageMacNames[17] = "Turkish";
    
    233
    +    ttLanguageMacNames[18] = "Croatian";
    
    234
    +    ttLanguageMacNames[19] = "Chinese (Traditional)";
    
    235
    +    ttLanguageMacNames[20] = "Urdu";
    
    236
    +    ttLanguageMacNames[21] = "Hindi";
    
    237
    +    ttLanguageMacNames[22] = "Thai";
    
    238
    +    ttLanguageMacNames[23] = "Korean";
    
    239
    +    ttLanguageMacNames[24] = "Lithuanian";
    
    240
    +    ttLanguageMacNames[25] = "Polish";
    
    241
    +    ttLanguageMacNames[26] = "Hungarian";
    
    242
    +    ttLanguageMacNames[27] = "Estonian";
    
    243
    +    ttLanguageMacNames[28] = "Latvian";
    
    244
    +    ttLanguageMacNames[29] = "Sami";
    
    245
    +    ttLanguageMacNames[30] = "Faroese";
    
    246
    +    ttLanguageMacNames[31] = "Farsi/Persian";
    
    247
    +    ttLanguageMacNames[32] = "Russian";
    
    248
    +    ttLanguageMacNames[33] = "Chinese (Simplified)";
    
    249
    +    ttLanguageMacNames[34] = "Flemish";
    
    250
    +    ttLanguageMacNames[35] = "Irish Gaelic";
    
    251
    +    ttLanguageMacNames[36] = "Albanian";
    
    252
    +    ttLanguageMacNames[37] = "Romanian";
    
    253
    +    ttLanguageMacNames[38] = "Czech";
    
    254
    +    ttLanguageMacNames[39] = "Slovak";
    
    255
    +    ttLanguageMacNames[40] = "Slovenian";
    
    256
    +    ttLanguageMacNames[41] = "Yiddish";
    
    257
    +    ttLanguageMacNames[42] = "Serbian";
    
    258
    +    ttLanguageMacNames[43] = "Macedonian";
    
    259
    +    ttLanguageMacNames[44] = "Bulgarian";
    
    260
    +    ttLanguageMacNames[45] = "Ukrainian";
    
    261
    +    ttLanguageMacNames[46] = "Byelorussian";
    
    262
    +    ttLanguageMacNames[47] = "Uzbek";
    
    263
    +    ttLanguageMacNames[48] = "Kazakh";
    
    264
    +    ttLanguageMacNames[49] = "Azerbaijani (Cyrillic script)";
    
    265
    +    ttLanguageMacNames[50] = "Azerbaijani (Arabic script)";
    
    266
    +    ttLanguageMacNames[51] = "Armenian";
    
    267
    +    ttLanguageMacNames[52] = "Georgian";
    
    268
    +    ttLanguageMacNames[53] = "Moldavian";
    
    269
    +    ttLanguageMacNames[54] = "Kirghiz";
    
    270
    +    ttLanguageMacNames[55] = "Tajiki";
    
    271
    +    ttLanguageMacNames[56] = "Turkmen";
    
    272
    +    ttLanguageMacNames[57] = "Mongolian (Mongolian script)";
    
    273
    +    ttLanguageMacNames[58] = "Mongolian (Cyrillic script)";
    
    274
    +    ttLanguageMacNames[59] = "Pashto";
    
    275
    +    ttLanguageMacNames[60] = "Kurdish";
    
    276
    +    ttLanguageMacNames[61] = "Kashmiri";
    
    277
    +    ttLanguageMacNames[62] = "Sindhi";
    
    278
    +    ttLanguageMacNames[63] = "Tibetan";
    
    279
    +    ttLanguageMacNames[64] = "Nepali";
    
    280
    +    ttLanguageMacNames[65] = "Sanskrit";
    
    281
    +    ttLanguageMacNames[66] = "Marathi";
    
    282
    +    ttLanguageMacNames[67] = "Bengali";
    
    283
    +    ttLanguageMacNames[68] = "Assamese";
    
    284
    +    ttLanguageMacNames[69] = "Gujarati";
    
    285
    +    ttLanguageMacNames[70] = "Punjabi";
    
    286
    +    ttLanguageMacNames[71] = "Oriya";
    
    287
    +    ttLanguageMacNames[72] = "Malayalam";
    
    288
    +    ttLanguageMacNames[73] = "Kannada";
    
    289
    +    ttLanguageMacNames[74] = "Tamil";
    
    290
    +    ttLanguageMacNames[75] = "Telugu";
    
    291
    +    ttLanguageMacNames[76] = "Sinhalese";
    
    292
    +    ttLanguageMacNames[77] = "Burmese";
    
    293
    +    ttLanguageMacNames[78] = "Khmer";
    
    294
    +    ttLanguageMacNames[79] = "Lao";
    
    295
    +    ttLanguageMacNames[80] = "Vietnamese";
    
    296
    +    ttLanguageMacNames[81] = "Indonesian";
    
    297
    +    ttLanguageMacNames[82] = "Tagalog";
    
    298
    +    ttLanguageMacNames[83] = "Malay (Roman script)";
    
    299
    +    ttLanguageMacNames[84] = "Malay (Arabic script)";
    
    300
    +    ttLanguageMacNames[85] = "Amharic";
    
    301
    +    ttLanguageMacNames[86] = "Tigrinya";
    
    302
    +    ttLanguageMacNames[87] = "Galla";
    
    303
    +    ttLanguageMacNames[88] = "Somali";
    
    304
    +    ttLanguageMacNames[89] = "Swahili";
    
    305
    +    ttLanguageMacNames[90] = "Kinyarwanda/Ruanda";
    
    306
    +    ttLanguageMacNames[91] = "Rundi";
    
    307
    +    ttLanguageMacNames[92] = "Nyanja/Chewa";
    
    308
    +    ttLanguageMacNames[93] = "Malagasy";
    
    309
    +    ttLanguageMacNames[94] = "Esperanto";
    
    310
    +    ttLanguageMacNames[128] = "Welsh";
    
    311
    +    ttLanguageMacNames[129] = "Basque";
    
    312
    +    ttLanguageMacNames[130] = "Catalan";
    
    313
    +    ttLanguageMacNames[131] = "Latin";
    
    314
    +    ttLanguageMacNames[132] = "Quechua";
    
    315
    +    ttLanguageMacNames[133] = "Guarani";
    
    316
    +    ttLanguageMacNames[134] = "Aymara";
    
    317
    +    ttLanguageMacNames[135] = "Tatar";
    
    318
    +    ttLanguageMacNames[136] = "Uighur";
    
    319
    +    ttLanguageMacNames[137] = "Dzongkha";
    
    320
    +    ttLanguageMacNames[138] = "Javanese (Roman script)";
    
    321
    +    ttLanguageMacNames[139] = "Sundanese (Roman script)";
    
    322
    +    ttLanguageMacNames[140] = "Galician";
    
    323
    +    ttLanguageMacNames[141] = "Afrikaans";
    
    324
    +    ttLanguageMacNames[142] = "Breton";
    
    325
    +    ttLanguageMacNames[143] = "Inuktitut";
    
    326
    +    ttLanguageMacNames[144] = "Scottish Gaelic";
    
    327
    +    ttLanguageMacNames[145] = "Manx Gaelic";
    
    328
    +    ttLanguageMacNames[146] = "Irish Gaelic (with dot above)";
    
    329
    +    ttLanguageMacNames[147] = "Tongan";
    
    330
    +    ttLanguageMacNames[148] = "Greek (polytonic)";
    
    331
    +    ttLanguageMacNames[149] = "Greenlandic";
    
    332
    +    ttLanguageMacNames[150] = "Azerbaijani (Roman script)";
    
    333
    +  }
    
    334
    +
    
    335
    +  if (ttLanguageWindowsNames.empty())
    
    336
    +  {
    
    337
    +    ttLanguageWindowsNames[FTI_UnknownID] = "Unknown Language";
    
    338
    +    ttLanguageWindowsNames[0x0436] = "Afrikaans";
    
    339
    +    ttLanguageWindowsNames[0x041C] = "Albanian";
    
    340
    +    ttLanguageWindowsNames[0x0402] = "Bulgarian";
    
    341
    +    ttLanguageWindowsNames[0x0484] = "Alsatian";
    
    342
    +    ttLanguageWindowsNames[0x045E] = "Amharic";
    
    343
    +    ttLanguageWindowsNames[0x0405] = "Czech";
    
    344
    +    ttLanguageWindowsNames[0x1401] = "Arabic";
    
    345
    +    ttLanguageWindowsNames[0x3C01] = "Arabic";
    
    346
    +    ttLanguageWindowsNames[0x0C01] = "Arabic";
    
    347
    +    ttLanguageWindowsNames[0x0401] = "Arabic";
    
    348
    +    ttLanguageWindowsNames[0x0404] = "Chinese";
    
    349
    +    ttLanguageWindowsNames[0x0406] = "Danish";
    
    350
    +    ttLanguageWindowsNames[0x0423] = "Belarusian";
    
    351
    +    ttLanguageWindowsNames[0x0445] = "Bengali";
    
    352
    +    ttLanguageWindowsNames[0x0465] = "Divehi";
    
    353
    +    ttLanguageWindowsNames[0x0801] = "Arabic";
    
    354
    +    ttLanguageWindowsNames[0x2C01] = "Arabic";
    
    355
    +    ttLanguageWindowsNames[0x0403] = "Catalan";
    
    356
    +    ttLanguageWindowsNames[0x0413] = "Dutch";
    
    357
    +    ttLanguageWindowsNames[0x0483] = "Corsican";
    
    358
    +    ttLanguageWindowsNames[0x0804] = "Chinese";
    
    359
    +    ttLanguageWindowsNames[0x0813] = "Dutch";
    
    360
    +    ttLanguageWindowsNames[0x0845] = "Bengali";
    
    361
    +    ttLanguageWindowsNames[0x1001] = "Arabic";
    
    362
    +    ttLanguageWindowsNames[0x1004] = "Chinese";
    
    363
    +    ttLanguageWindowsNames[0x1009] = "English";
    
    364
    +    ttLanguageWindowsNames[0x1404] = "Chinese";
    
    365
    +    ttLanguageWindowsNames[0x1801] = "Arabic";
    
    366
    +    ttLanguageWindowsNames[0x2001] = "Arabic";
    
    367
    +    ttLanguageWindowsNames[0x2401] = "Arabic";
    
    368
    +    ttLanguageWindowsNames[0x2801] = "Arabic";
    
    369
    +    ttLanguageWindowsNames[0x3001] = "Arabic";
    
    370
    +    ttLanguageWindowsNames[0x3401] = "Arabic";
    
    371
    +    ttLanguageWindowsNames[0x3801] = "Arabic";
    
    372
    +    ttLanguageWindowsNames[0x4001] = "Arabic";
    
    373
    +    ttLanguageWindowsNames[0x1C01] = "Arabic";
    
    374
    +    ttLanguageWindowsNames[0x042B] = "Armenian";
    
    375
    +    ttLanguageWindowsNames[0x044D] = "Assamese";
    
    376
    +    ttLanguageWindowsNames[0x082C] = "Azeri (Cyrillic)";
    
    377
    +    ttLanguageWindowsNames[0x042C] = "Azeri (Latin)";
    
    378
    +    ttLanguageWindowsNames[0x046D] = "Bashkir";
    
    379
    +    ttLanguageWindowsNames[0x042D] = "Basque";
    
    380
    +    ttLanguageWindowsNames[0x201A] = "Bosnian (Cyrillic)";
    
    381
    +    ttLanguageWindowsNames[0x141A] = "Bosnian (Latin)";
    
    382
    +    ttLanguageWindowsNames[0x047E] = "Breton";
    
    383
    +    ttLanguageWindowsNames[0x0C04] = "Chinese";
    
    384
    +    ttLanguageWindowsNames[0x041A] = "Croatian";
    
    385
    +    ttLanguageWindowsNames[0x101A] = "Croatian (Latin)";
    
    386
    +    ttLanguageWindowsNames[0x048C] = "Dari";
    
    387
    +    ttLanguageWindowsNames[0x0C09] = "English";
    
    388
    +    ttLanguageWindowsNames[0x0407] = "German";
    
    389
    +    ttLanguageWindowsNames[0x0408] = "Greek";
    
    390
    +    ttLanguageWindowsNames[0x0409] = "English";
    
    391
    +    ttLanguageWindowsNames[0x0410] = "Italian";
    
    392
    +    ttLanguageWindowsNames[0x0411] = "Japanese";
    
    393
    +    ttLanguageWindowsNames[0x0421] = "Indonesian";
    
    394
    +    ttLanguageWindowsNames[0x0425] = "Estonian";
    
    395
    +    ttLanguageWindowsNames[0x0434] = "isiXhosa";
    
    396
    +    ttLanguageWindowsNames[0x0435] = "isiZulu";
    
    397
    +    ttLanguageWindowsNames[0x0437] = "Georgian";
    
    398
    +    ttLanguageWindowsNames[0x0438] = "Faroese";
    
    399
    +    ttLanguageWindowsNames[0x0439] = "Hindi";
    
    400
    +    ttLanguageWindowsNames[0x0447] = "Gujarati";
    
    401
    +    ttLanguageWindowsNames[0x0453] = "Khmer";
    
    402
    +    ttLanguageWindowsNames[0x0456] = "Galician";
    
    403
    +    ttLanguageWindowsNames[0x0462] = "Frisian";
    
    404
    +    ttLanguageWindowsNames[0x0464] = "Filipino";
    
    405
    +    ttLanguageWindowsNames[0x0468] = "Hausa (Latin)";
    
    406
    +    ttLanguageWindowsNames[0x0470] = "Igbo";
    
    407
    +    ttLanguageWindowsNames[0x0486] = "K’iche";
    
    408
    +    ttLanguageWindowsNames[0x0807] = "German";
    
    409
    +    ttLanguageWindowsNames[0x0809] = "English";
    
    410
    +    ttLanguageWindowsNames[0x0810] = "Italian";
    
    411
    +    ttLanguageWindowsNames[0x1007] = "German";
    
    412
    +    ttLanguageWindowsNames[0x1407] = "German";
    
    413
    +    ttLanguageWindowsNames[0x1409] = "English";
    
    414
    +    ttLanguageWindowsNames[0x1809] = "English";
    
    415
    +    ttLanguageWindowsNames[0x2009] = "English";
    
    416
    +    ttLanguageWindowsNames[0x2409] = "English";
    
    417
    +    ttLanguageWindowsNames[0x2809] = "English";
    
    418
    +    ttLanguageWindowsNames[0x3009] = "English";
    
    419
    +    ttLanguageWindowsNames[0x3409] = "English";
    
    420
    +    ttLanguageWindowsNames[0x4009] = "English";
    
    421
    +    ttLanguageWindowsNames[0x4409] = "English";
    
    422
    +    ttLanguageWindowsNames[0x4809] = "English";
    
    423
    +    ttLanguageWindowsNames[0x1C09] = "English";
    
    424
    +    ttLanguageWindowsNames[0x2C09] = "English";
    
    425
    +    ttLanguageWindowsNames[0x040B] = "Finnish";
    
    426
    +    ttLanguageWindowsNames[0x080C] = "French";
    
    427
    +    ttLanguageWindowsNames[0x0C0C] = "French";
    
    428
    +    ttLanguageWindowsNames[0x040C] = "French";
    
    429
    +    ttLanguageWindowsNames[0x140c] = "French";
    
    430
    +    ttLanguageWindowsNames[0x180C] = "French";
    
    431
    +    ttLanguageWindowsNames[0x100C] = "French";
    
    432
    +    ttLanguageWindowsNames[0x0C07] = "German";
    
    433
    +    ttLanguageWindowsNames[0x046F] = "Greenlandic";
    
    434
    +    ttLanguageWindowsNames[0x040D] = "Hebrew";
    
    435
    +    ttLanguageWindowsNames[0x040E] = "Hungarian";
    
    436
    +    ttLanguageWindowsNames[0x040F] = "Icelandic";
    
    437
    +    ttLanguageWindowsNames[0x045D] = "Inuktitut";
    
    438
    +    ttLanguageWindowsNames[0x085D] = "Inuktitut (Latin)";
    
    439
    +    ttLanguageWindowsNames[0x083C] = "Irish";
    
    440
    +    ttLanguageWindowsNames[0x044B] = "Kannada";
    
    441
    +    ttLanguageWindowsNames[0x043F] = "Kazakh";
    
    442
    +    ttLanguageWindowsNames[0x0412] = "Korean";
    
    443
    +    ttLanguageWindowsNames[0x0426] = "Latvian";
    
    444
    +    ttLanguageWindowsNames[0x0427] = "Lithuanian";
    
    445
    +    ttLanguageWindowsNames[0x0440] = "Kyrgyz";
    
    446
    +    ttLanguageWindowsNames[0x0441] = "Kiswahili";
    
    447
    +    ttLanguageWindowsNames[0x0454] = "Lao";
    
    448
    +    ttLanguageWindowsNames[0x0457] = "Konkani";
    
    449
    +    ttLanguageWindowsNames[0x0481] = "Maori";
    
    450
    +    ttLanguageWindowsNames[0x0487] = "Kinyarwanda";
    
    451
    +    ttLanguageWindowsNames[0x082E] = "Lower Sorbian";
    
    452
    +    ttLanguageWindowsNames[0x046E] = "Luxembourgish";
    
    453
    +    ttLanguageWindowsNames[0x042F] = "Macedonian";
    
    454
    +    ttLanguageWindowsNames[0x083E] = "Malay";
    
    455
    +    ttLanguageWindowsNames[0x043E] = "Malay";
    
    456
    +    ttLanguageWindowsNames[0x044C] = "Malayalam";
    
    457
    +    ttLanguageWindowsNames[0x043A] = "Maltese";
    
    458
    +    ttLanguageWindowsNames[0x047A] = "Mapudungun";
    
    459
    +    ttLanguageWindowsNames[0x044E] = "Marathi";
    
    460
    +    ttLanguageWindowsNames[0x047C] = "Mohawk";
    
    461
    +    ttLanguageWindowsNames[0x0414] = "Norwegian (Bokmal)";
    
    462
    +    ttLanguageWindowsNames[0x0415] = "Polish";
    
    463
    +    ttLanguageWindowsNames[0x0416] = "Portuguese";
    
    464
    +    ttLanguageWindowsNames[0x0417] = "Romansh";
    
    465
    +    ttLanguageWindowsNames[0x0418] = "Romanian";
    
    466
    +    ttLanguageWindowsNames[0x0419] = "Russian";
    
    467
    +    ttLanguageWindowsNames[0x0446] = "Punjabi";
    
    468
    +    ttLanguageWindowsNames[0x0448] = "Odia (formerly Oriya)";
    
    469
    +    ttLanguageWindowsNames[0x0450] = "Mongolian (Cyrillic)";
    
    470
    +    ttLanguageWindowsNames[0x0461] = "Nepali";
    
    471
    +    ttLanguageWindowsNames[0x0463] = "Pashto";
    
    472
    +    ttLanguageWindowsNames[0x0482] = "Occitan";
    
    473
    +    ttLanguageWindowsNames[0x0814] = "Norwegian (Nynorsk)";
    
    474
    +    ttLanguageWindowsNames[0x0816] = "Portuguese";
    
    475
    +    ttLanguageWindowsNames[0x0850] = "Mongolian (Traditional)";
    
    476
    +    ttLanguageWindowsNames[0x046B] = "Quechua";
    
    477
    +    ttLanguageWindowsNames[0x086B] = "Quechua";
    
    478
    +    ttLanguageWindowsNames[0x0C6B] = "Quechua";
    
    479
    +    ttLanguageWindowsNames[0x243B] = "Sami (Inari)";
    
    480
    +    ttLanguageWindowsNames[0x103B] = "Sami (Lule)";
    
    481
    +    ttLanguageWindowsNames[0x143B] = "Sami (Lule)";
    
    482
    +    ttLanguageWindowsNames[0x0C3B] = "Sami (Northern)";
    
    483
    +    ttLanguageWindowsNames[0x043B] = "Sami (Northern)";
    
    484
    +    ttLanguageWindowsNames[0x083B] = "Sami (Northern)";
    
    485
    +    ttLanguageWindowsNames[0x203B] = "Sami (Skolt)";
    
    486
    +    ttLanguageWindowsNames[0x183B] = "Sami (Southern)";
    
    487
    +    ttLanguageWindowsNames[0x1C3B] = "Sami (Southern)";
    
    488
    +    ttLanguageWindowsNames[0x044F] = "Sanskrit";
    
    489
    +    ttLanguageWindowsNames[0x1C1A] = "Serbian (Cyrillic)";
    
    490
    +    ttLanguageWindowsNames[0x0C1A] = "Serbian (Cyrillic)";
    
    491
    +    ttLanguageWindowsNames[0x181A] = "Serbian (Latin)";
    
    492
    +    ttLanguageWindowsNames[0x081A] = "Serbian (Latin)";
    
    493
    +    ttLanguageWindowsNames[0x046C] = "Sesotho sa Leboa";
    
    494
    +    ttLanguageWindowsNames[0x0432] = "Setswana";
    
    495
    +    ttLanguageWindowsNames[0x045B] = "Sinhala";
    
    496
    +    ttLanguageWindowsNames[0x041B] = "Slovak";
    
    497
    +    ttLanguageWindowsNames[0x0424] = "Slovenian";
    
    498
    +    ttLanguageWindowsNames[0x2C0A] = "Spanish";
    
    499
    +    ttLanguageWindowsNames[0x400A] = "Spanish";
    
    500
    +    ttLanguageWindowsNames[0x340A] = "Spanish";
    
    501
    +    ttLanguageWindowsNames[0x240A] = "Spanish";
    
    502
    +    ttLanguageWindowsNames[0x140A] = "Spanish";
    
    503
    +    ttLanguageWindowsNames[0x1C0A] = "Spanish";
    
    504
    +    ttLanguageWindowsNames[0x300A] = "Spanish";
    
    505
    +    ttLanguageWindowsNames[0x440A] = "Spanish";
    
    506
    +    ttLanguageWindowsNames[0x100A] = "Spanish";
    
    507
    +    ttLanguageWindowsNames[0x480A] = "Spanish";
    
    508
    +    ttLanguageWindowsNames[0x080A] = "Spanish";
    
    509
    +    ttLanguageWindowsNames[0x4C0A] = "Spanish";
    
    510
    +    ttLanguageWindowsNames[0x180A] = "Spanish";
    
    511
    +    ttLanguageWindowsNames[0x3C0A] = "Spanish";
    
    512
    +    ttLanguageWindowsNames[0x280A] = "Spanish";
    
    513
    +    ttLanguageWindowsNames[0x500A] = "Spanish";
    
    514
    +    ttLanguageWindowsNames[0x0C0A] = "Spanish (Modern Sort)";
    
    515
    +    ttLanguageWindowsNames[0x040A] = "Spanish (Traditional Sort)";
    
    516
    +    ttLanguageWindowsNames[0x540A] = "Spanish";
    
    517
    +    ttLanguageWindowsNames[0x380A] = "Spanish";
    
    518
    +    ttLanguageWindowsNames[0x200A] = "Spanish";
    
    519
    +    ttLanguageWindowsNames[0x081D] = "Swedish";
    
    520
    +    ttLanguageWindowsNames[0x041D] = "Swedish";
    
    521
    +    ttLanguageWindowsNames[0x045A] = "Syriac";
    
    522
    +    ttLanguageWindowsNames[0x0420] = "Urdu";
    
    523
    +    ttLanguageWindowsNames[0x0428] = "Tajik (Cyrillic)";
    
    524
    +    ttLanguageWindowsNames[0x085F] = "Tamazight (Latin)";
    
    525
    +    ttLanguageWindowsNames[0x0443] = "Uzbek (Latin)";
    
    526
    +    ttLanguageWindowsNames[0x0444] = "Tatar";
    
    527
    +    ttLanguageWindowsNames[0x0449] = "Tamil";
    
    528
    +    ttLanguageWindowsNames[0x044A] = "Telugu";
    
    529
    +    ttLanguageWindowsNames[0x041E] = "Thai";
    
    530
    +    ttLanguageWindowsNames[0x0422] = "Ukrainian";
    
    531
    +    ttLanguageWindowsNames[0x0442] = "Turkmen";
    
    532
    +    ttLanguageWindowsNames[0x0451] = "Tibetan";
    
    533
    +    ttLanguageWindowsNames[0x041F] = "Turkish";
    
    534
    +    ttLanguageWindowsNames[0x0480] = "Uighur";
    
    535
    +    ttLanguageWindowsNames[0x042E] = "Upper Sorbian";
    
    536
    +    ttLanguageWindowsNames[0x0452] = "Welsh";
    
    537
    +    ttLanguageWindowsNames[0x0478] = "Yi";
    
    538
    +    ttLanguageWindowsNames[0x0485] = "Yakut";
    
    539
    +    ttLanguageWindowsNames[0x0488] = "Wolof";
    
    540
    +    ttLanguageWindowsNames[0x0843] = "Uzbek (Cyrillic)";
    
    541
    +    ttLanguageWindowsNames[0x042A] = "Vietnamese";
    
    542
    +    ttLanguageWindowsNames[0x046A] = "Yoruba";
    
    543
    +  }
    
    544
    +
    
    545
    +  TableType* table = NULL;
    
    546
    +
    
    547
    +  switch (platformID)
    
    548
    +  {
    
    549
    +  case TT_PLATFORM_MACINTOSH:
    
    550
    +    table = &ttLanguageMacNames;
    
    551
    +    break;
    
    552
    +  case TT_PLATFORM_MICROSOFT:
    
    553
    +    table = &ttLanguageWindowsNames;
    
    554
    +    break;
    
    555
    +
    
    556
    +  default:
    
    557
    +    return &ttLanguageWindowsNames[FTI_UnknownID];
    
    558
    +  }
    
    559
    +
    
    560
    +  auto it = table->find(languageID);
    
    561
    +  if (it == table->end())
    
    562
    +    return &(*table)[FTI_UnknownID];
    
    563
    +  return &it->second;
    
    564
    +}
    
    565
    +
    
    566
    +
    
    567
    +// end of fontinfonamesmapping.cpp

  • src/ftinspect/engine/paletteinfo.cpp
    ... ...