のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

optimizelegibility

    117     TypesettingFeatures typesettingFeatures() const
    118     {
    119         TextRenderingMode textRenderingMode = m_fontDescription.textRenderingMode();
    120         return textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? Kerning | Ligatures : 0;
    121     }
    273 Font::CodePath Font::codePath(const TextRun& run) const
    274 {
    275     if (s_codePath != Auto)
    276         return s_codePath;
    277 
    278 #if PLATFORM(QT)
    279     if (run.expansion() || run.rtl() || isSmallCaps() || wordSpacing() || letterSpacing())
    280         return Complex;
    281 #endif
    282 
    283     CodePath result = Simple; <===========
    284 
    285     // Start from 0 since drawing and highlighting also measure the characters before run->from
    286     for (int i = 0; i < run.length(); i++) {
    287         const UChar c = run[i];
    288         if (c < 0x300) // U+0300 through U+036F Combining diacritical marks
    289             continue; <===========
    290         if (c <= 0x36F)
    291             return Complex;
    292 
    293         if (c < 0x0591 || c == 0x05BE) // U+0591 through U+05CF excluding U+05BE Hebrew combining marks, Hebrew punctuation Paseq, Sof Pasuq and Nun Hafukha
    294             continue;
    295         if (c <= 0x05CF)
    296             return Complex;
    297 
    298         if (c < 0x0600) // U+0600 through U+1059 Arabic, Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar
    299             continue;
    300         if (c <= 0x1059)
    301             return Complex;
    302 
    303         if (c < 0x1100) // U+1100 through U+11FF Hangul Jamo (only Ancient Korean should be left here if you precompose; Modern Korean will be precomposed as a result of step A)
    304             continue;
    305         if (c <= 0x11FF)
    306             return Complex;
    307 
    308         if (c < 0x1780) // U+1780 through U+18AF Khmer, Mongolian
    309             continue;
    310         if (c <= 0x18AF)
    311             return Complex;
    312 
    313         if (c < 0x1900) // U+1900 through U+194F Limbu (Unicode 4.0)
    314             continue;
    315         if (c <= 0x194F)
    316             return Complex;
    317 
    318         if (c < 0x1E00) // U+1E00 through U+2000 characters with diacritics and stacked diacritics
    319             continue; <===========
    320         if (c <= 0x2000) {
    321             result = SimpleWithGlyphOverflow;
    322             continue; <===========
    323         }
    324 
    325         if (c < 0x20D0) // U+20D0 through U+20FF Combining marks for symbols
    326             continue; <===========
    327         if (c <= 0x20FF)
    328             return Complex;
    329 
    330         if (c < 0xFE20) // U+FE20 through U+FE2F Combining half marks
    331             continue; <===========
    332         if (c <= 0xFE2F)
    333             return Complex;
    334     }
    335 
    336     if (typesettingFeatures())
    337         return Complex;
    338 
    339     return result; <===========
    340 }