src/gui/text/qfont.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 8 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
  1612                 && f.d->request.pointSize == d->request.pointSize
  1612                 && f.d->request.pointSize == d->request.pointSize
  1613                 && f.d->underline == d->underline
  1613                 && f.d->underline == d->underline
  1614                 && f.d->overline  == d->overline
  1614                 && f.d->overline  == d->overline
  1615                 && f.d->strikeOut == d->strikeOut
  1615                 && f.d->strikeOut == d->strikeOut
  1616                 && f.d->kerning == d->kerning
  1616                 && f.d->kerning == d->kerning
  1617                 && f.d->capital == d->capital));
  1617                 && f.d->capital == d->capital
       
  1618                 && f.d->letterSpacingIsAbsolute == d->letterSpacingIsAbsolute
       
  1619                 && f.d->letterSpacing == d->letterSpacing
       
  1620                 && f.d->wordSpacing == d->wordSpacing
       
  1621             ));
  1618 }
  1622 }
  1619 
  1623 
  1620 
  1624 
  1621 /*!
  1625 /*!
  1622     Provides an arbitrary comparison of this font and font \a f.
  1626     Provides an arbitrary comparison of this font and font \a f.
  1646 #ifdef Q_WS_X11
  1650 #ifdef Q_WS_X11
  1647     if (r1.addStyle != r2.addStyle) return r1.addStyle < r2.addStyle;
  1651     if (r1.addStyle != r2.addStyle) return r1.addStyle < r2.addStyle;
  1648 #endif // Q_WS_X11
  1652 #endif // Q_WS_X11
  1649     if (f.d->capital != d->capital) return f.d->capital < d->capital;
  1653     if (f.d->capital != d->capital) return f.d->capital < d->capital;
  1650 
  1654 
       
  1655     if (f.d->letterSpacingIsAbsolute != d->letterSpacingIsAbsolute) return f.d->letterSpacingIsAbsolute < d->letterSpacingIsAbsolute;
       
  1656     if (f.d->letterSpacing != d->letterSpacing) return f.d->letterSpacing < d->letterSpacing;
       
  1657     if (f.d->wordSpacing != d->wordSpacing) return f.d->wordSpacing < d->wordSpacing;
       
  1658 
  1651     int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning;
  1659     int f1attrs = (f.d->underline << 3) + (f.d->overline << 2) + (f.d->strikeOut<<1) + f.d->kerning;
  1652     int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning;
  1660     int f2attrs = (d->underline << 3) + (d->overline << 2) + (d->strikeOut<<1) + d->kerning;
  1653     return f1attrs < f2attrs;
  1661     return f1attrs < f2attrs;
  1654 }
  1662 }
  1655 
  1663 
  1778 
  1786 
  1779 // create substitution dict
  1787 // create substitution dict
  1780 static void initFontSubst()
  1788 static void initFontSubst()
  1781 {
  1789 {
  1782     // default substitutions
  1790     // default substitutions
  1783     static const char *initTbl[] = {
  1791     static const char * const initTbl[] = {
  1784 
  1792 
  1785 #if defined(Q_WS_X11)
  1793 #if defined(Q_WS_X11)
  1786         "arial",        "helvetica",
  1794         "arial",        "helvetica",
  1787         "times new roman", "times",
  1795         "times new roman", "times",
  1788         "courier new",  "courier",
  1796         "courier new",  "courier",
  1809     for (int i=0; initTbl[i] != 0; i += 2) {
  1817     for (int i=0; initTbl[i] != 0; i += 2) {
  1810         QStringList &list = (*fontSubst)[QString::fromLatin1(initTbl[i])];
  1818         QStringList &list = (*fontSubst)[QString::fromLatin1(initTbl[i])];
  1811         list.append(QString::fromLatin1(initTbl[i+1]));
  1819         list.append(QString::fromLatin1(initTbl[i+1]));
  1812     }
  1820     }
  1813 }
  1821 }
  1814 
       
  1815 
  1822 
  1816 /*!
  1823 /*!
  1817     Returns the first family name to be used whenever \a familyName is
  1824     Returns the first family name to be used whenever \a familyName is
  1818     specified. The lookup is case insensitive.
  1825     specified. The lookup is case insensitive.
  1819 
  1826