[95] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
[659] | 3 | ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[564] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[95] | 6 | **
|
---|
[659] | 7 | ** Copyright (C) 2010 netlabs.org. OS/2 parts.
|
---|
[95] | 8 | **
|
---|
| 9 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
| 10 | **
|
---|
| 11 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 12 | ** Commercial Usage
|
---|
| 13 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 14 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 15 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 16 | ** a written agreement between you and Nokia.
|
---|
| 17 | **
|
---|
| 18 | ** GNU Lesser General Public License Usage
|
---|
| 19 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 20 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 21 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 22 | ** packaging of this file. Please review the following information to
|
---|
| 23 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 24 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 25 | **
|
---|
[564] | 26 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 27 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
[95] | 29 | **
|
---|
| 30 | ** GNU General Public License Usage
|
---|
| 31 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 32 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 33 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 34 | ** packaging of this file. Please review the following information to
|
---|
| 35 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 36 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 37 | **
|
---|
[564] | 38 | ** If you have questions regarding the use of this file, please contact
|
---|
| 39 | ** Nokia at [email protected].
|
---|
[95] | 40 | ** $QT_END_LICENSE$
|
---|
| 41 | **
|
---|
| 42 | ****************************************************************************/
|
---|
| 43 |
|
---|
[371] | 44 | #include "qt_os2.h"
|
---|
[95] | 45 | #include "qfont.h"
|
---|
| 46 | #include "qfont_p.h"
|
---|
| 47 | #include "qfontengine_p.h"
|
---|
| 48 | #include "qtextengine_p.h"
|
---|
| 49 | #include "qfontmetrics.h"
|
---|
| 50 | #include "qfontinfo.h"
|
---|
| 51 |
|
---|
| 52 | QT_BEGIN_NAMESPACE
|
---|
| 53 |
|
---|
[226] | 54 | Q_GUI_EXPORT const char *qt_fontFamilyFromStyleHint(const QFontDef &request)
|
---|
| 55 | {
|
---|
| 56 | const char *family = 0;
|
---|
| 57 | switch (request.styleHint) {
|
---|
| 58 | case QFont::Helvetica:
|
---|
| 59 | family = "Helvetica";
|
---|
| 60 | break;
|
---|
| 61 | case QFont::Times:
|
---|
| 62 | case QFont::OldEnglish:
|
---|
| 63 | family = "Times New Roman";
|
---|
| 64 | break;
|
---|
| 65 | case QFont::Courier:
|
---|
| 66 | family = "Courier";
|
---|
| 67 | break;
|
---|
| 68 | case QFont::System:
|
---|
| 69 | family = "WarpSans";
|
---|
| 70 | break;
|
---|
| 71 | case QFont::AnyStyle:
|
---|
[371] | 72 | default:
|
---|
[373] | 73 | if (request.fixedPitch)
|
---|
[226] | 74 | family = "Courier";
|
---|
| 75 | else
|
---|
| 76 | family = "Helvetica";
|
---|
| 77 | break;
|
---|
| 78 | }
|
---|
| 79 | return family;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
[95] | 82 | /*****************************************************************************
|
---|
| 83 | QFont member functions
|
---|
| 84 | *****************************************************************************/
|
---|
| 85 |
|
---|
| 86 | void QFont::initialize()
|
---|
| 87 | {
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | void QFont::cleanup()
|
---|
| 91 | {
|
---|
| 92 | QFontCache::cleanup();
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | QString QFont::rawName() const
|
---|
| 96 | {
|
---|
| 97 | return family();
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | void QFont::setRawName(const QString &name)
|
---|
| 101 | {
|
---|
| 102 | setFamily(name);
|
---|
| 103 | }
|
---|
| 104 |
|
---|
| 105 | QString QFont::defaultFamily() const
|
---|
| 106 | {
|
---|
[371] | 107 | return QString::fromLocal8Bit(qt_fontFamilyFromStyleHint(d->request));
|
---|
[95] | 108 | }
|
---|
| 109 |
|
---|
| 110 | QString QFont::lastResortFamily() const
|
---|
| 111 | {
|
---|
[226] | 112 | return QString::fromLatin1("Helvetica");
|
---|
[95] | 113 | }
|
---|
| 114 |
|
---|
| 115 | QString QFont::lastResortFont() const
|
---|
| 116 | {
|
---|
[226] | 117 | return QString::fromLatin1("Helvetica");
|
---|
[95] | 118 | }
|
---|
| 119 |
|
---|
| 120 | QT_END_NAMESPACE
|
---|