Ignore:
Timestamp:
Oct 14, 2009, 11:07:33 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Use single source for mapping font style hints to default family names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/text/qfontdatabase_pm.cpp

    r223 r226  
    302302}
    303303
    304 static const char *styleHint(const QFontDef &request)
    305 {
    306     const char *stylehint = 0;
    307     switch (request.styleHint) {
    308     case QFont::SansSerif:
    309         stylehint = "Helvetica";
    310         break;
    311     case QFont::Serif:
    312         stylehint = "Roman";
    313         break;
    314     case QFont::TypeWriter:
    315         stylehint = "Courier";
    316         break;
    317     default:
    318         if (request.fixedPitch)
    319             stylehint = "Courier";
    320         else
    321             stylehint = "Helvetica";
    322         break;
    323     }
    324     return stylehint;
    325 }
    326 
    327304static QFontDef fontDescToFontDef(const QFontDef &req, const QtFontDesc &desc)
    328305{
     
    387364    QStringList families = familyList(req);
    388365
    389     const char *stylehint = styleHint(d->request);
    390     if (stylehint)
    391         families << QLatin1String(stylehint);
     366    const char *styleHint = qt_fontFamilyFromStyleHint(d->request);
     367    if (styleHint)
     368        families << QLatin1String(styleHint);
    392369
    393370    // add the default family
Note: See TracChangeset for help on using the changeset viewer.