Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/text/qfontengine_ft.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    5252#include "qthreadstorage.h"
    5353#include <qmath.h>
    54 #include <private/qpdf_p.h>
    5554#include <private/qharfbuzz_p.h>
    5655
     
    5958#include FT_FREETYPE_H
    6059#include FT_OUTLINE_H
     60
    6161#include FT_TRUETYPE_TABLES_H
    6262#include FT_TYPE1_TABLES_H
     
    9292#define X_SIZE(face,i) ((face)->available_sizes[i].width << 6)
    9393#define Y_SIZE(face,i) ((face)->available_sizes[i].height << 6)
     94
     95
     96
     97
     98
     99
     100
    94101#endif
    95102
     
    618625    kerning_pairs_loaded = false;
    619626    transform = false;
     627
    620628    antialias = true;
    621629    freetype = 0;
    622     default_load_flags = 0;
     630    default_load_flags = ;
    623631    default_hint_style = HintNone;
    624632    subpixelType = Subpixel_None;
     
    680688    FT_Face face = lockFace();
    681689
    682     //underline metrics
    683690    if (FT_IS_SCALABLE(face)) {
    684         line_thickness =  QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
    685         underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale));
    686691        bool fake_oblique = (fontDef.style != QFont::StyleNormal) && !(face->style_flags & FT_STYLE_FLAG_ITALIC);
    687692        if (fake_oblique)
     
    691696        if (fake_oblique)
    692697            transform = true;
     698
     699
     700
     701
     702
     703
    693704    } else {
    694705        // copied from QFontEngineQPF
     
    747758QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph) const
    748759{
    749     Glyph *g = set->glyph_data.value(glyph);
     760    Glyph *g = set->g(glyph);
    750761    if (g)
    751762        return g;
     
    790801
    791802    FT_GlyphSlot slot = face->glyph;
     803
    792804    int left  = slot->metrics.horiBearingX;
    793805    int right = slot->metrics.horiBearingX + slot->metrics.width;
     
    859871    }
    860872
    861     Glyph *g = set->glyph_data.value(glyph);
     873    Glyph *g = set->g(glyph);
    862874    if (g && g->format == format) {
    863875        if (uploadToServer && !g->uploadedToServer) {
    864             set->glyph_data[glyph] = 0;
     876            set->;
    865877            delete g;
    866878            g = 0;
     
    935947
    936948    FT_GlyphSlot slot = face->glyph;
     949
    937950    FT_Library library = qt_getFreetype();
    938951
     
    11591172    }
    11601173
    1161     set->glyph_data[glyph] = g;
     1174    set->;
    11621175
    11631176    return g;
     
    11831196    Properties p = freetype->properties();
    11841197    if (p.postscriptName.isEmpty()) {
    1185         p.postscriptName = fontDef.family.toUtf8();
    1186 #ifndef QT_NO_PRINTER
    1187         p.postscriptName = QPdf::stripSpecialCharacters(p.postscriptName);
    1188 #endif
     1198        p.postscriptName = QFontEngine::convertToPostscriptFontFamilyName(fontDef.family.toUtf8());
    11891199    }
    11901200
     
    12101220    if ((fontDef.style != QFont::StyleNormal) && !(freetype->face->style_flags & FT_STYLE_FLAG_ITALIC))
    12111221        s = SynthesizedItalic;
     1222
     1223
    12121224    if (fontDef.stretch != 100 && FT_IS_SCALABLE(freetype->face))
    12131225        s |= SynthesizedStretch;
     
    13691381    if (!gs) {
    13701382        // don't try to load huge fonts
    1371         bool draw_as_outline = fontDef.pixelSize * qSqrt(matrix.det()) >= 64;
     1383        bool draw_as_outline = fontDef.pixelSize * qSqrt()) >= 64;
    13721384        if (draw_as_outline)
    13731385            return 0;
     
    13821394        gs = &transformedGlyphSets[0];
    13831395
    1384         qDeleteAll(gs->glyph_data);
    1385         gs->glyph_data.clear();
     1396        gs->clear();
    13861397
    13871398        gs->id = allocateServerGlyphSet();
     
    13991410
    14001411    for (int i = 0; i < num_glyphs; ++i) {
    1401         Glyph *glyph = gs->glyph_data.value(glyphs[i]);
     1412        Glyph *glyph = gs->g(glyphs[i]);
    14021413        if (glyph == 0 || glyph->format != format) {
    14031414            if (!face) {
     
    15511562        for ( int i = 0; i < len; ++i ) {
    15521563            unsigned int uc = getChar(str, i, len);
    1553             if (mirrored)
    1554                 uc = QChar::mirroredChar(uc);
    15551564            glyphs->glyphs[glyph_pos] = uc < QFreetypeFace::cmapCacheSize ? freetype->cmapCache[uc] : 0;
    15561565            if ( !glyphs->glyphs[glyph_pos] ) {
     
    16361645    if (flags & QTextEngine::DesignMetrics) {
    16371646        for (int i = 0; i < glyphs->numGlyphs; i++) {
    1638             Glyph *g = defaultGlyphSet.glyph_data.value(glyphs->glyphs[i]);
     1647            Glyph *g = defaultGlyphSet.g(glyphs->glyphs[i]);
    16391648            if (g) {
    16401649                glyphs->advances_x[i] = QFixed::fromFixed(g->linearAdvance);
     
    16491658    } else {
    16501659        for (int i = 0; i < glyphs->numGlyphs; i++) {
    1651             Glyph *g = defaultGlyphSet.glyph_data.value(glyphs->glyphs[i]);
     1660            Glyph *g = defaultGlyphSet.g(glyphs->glyphs[i]);
    16521661            if (g) {
    16531662                glyphs->advances_x[i] = QFixed(g->advance);
     
    16781687    QFixed xmax = 0;
    16791688    for (int i = 0; i < glyphs.numGlyphs; i++) {
    1680         Glyph *g = defaultGlyphSet.glyph_data.value(glyphs.glyphs[i]);
     1689        Glyph *g = defaultGlyphSet.g(glyphs.glyphs[i]);
    16811690        if (!g) {
    16821691            if (!face)
     
    17201729    FT_Face face = 0;
    17211730    glyph_metrics_t overall;
    1722     Glyph *g = defaultGlyphSet.glyph_data.value(glyph);
     1731    Glyph *g = defaultGlyphSet.g(glyph);
    17231732    if (!g) {
    17241733        face = lockFace();
     
    17841793            }
    17851794            glyphSet = &transformedGlyphSets[0];
    1786             qDeleteAll(glyphSet->glyph_data);
    1787             glyphSet->glyph_data.clear();
     1795            glyphSet->clear();
    17881796            glyphSet->id = allocateServerGlyphSet();
    17891797            glyphSet->transformationMatrix = m;
     
    17931801        glyphSet = &defaultGlyphSet;
    17941802    }
    1795     Glyph * g = glyphSet->glyph_data.value(glyph);
     1803    Glyph * g = glyphSet->g(glyph);
    17961804    if (!g) {
    17971805        face = lockFace();
     
    18821890void QFontEngineFT::removeGlyphFromCache(glyph_t glyph)
    18831891{
    1884     delete defaultGlyphSet.glyph_data.take(glyph);
     1892    dee(glyph);
    18851893}
    18861894
     
    19381946    transformationMatrix.xy = 0;
    19391947    transformationMatrix.yx = 0;
     1948
     1949
    19401950}
    19411951
    19421952QFontEngineFT::QGlyphSet::~QGlyphSet()
    19431953{
     1954
     1955
     1956
     1957
     1958
     1959
     1960
     1961
     1962
     1963
     1964
     1965
     1966
     1967
    19441968    qDeleteAll(glyph_data);
     1969
     1970
     1971
     1972
     1973
     1974
     1975
     1976
     1977
     1978
     1979
     1980
     1981
     1982
     1983
     1984
     1985
     1986
     1987
     1988
     1989
     1990
     1991
     1992
     1993
     1994
    19451995}
    19461996
Note: See TracChangeset for help on using the changeset viewer.