1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** Copyright (C) 2009 netlabs.org. OS/2 parts.
|
---|
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 | **
|
---|
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.
|
---|
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 | **
|
---|
38 | ** If you have questions regarding the use of this file, please contact
|
---|
39 | ** Nokia at [email protected].
|
---|
40 | ** $QT_END_LICENSE$
|
---|
41 | **
|
---|
42 | ****************************************************************************/
|
---|
43 |
|
---|
44 | #include "qfontengine_p.h"
|
---|
45 | #include "qtextengine_p.h"
|
---|
46 |
|
---|
47 | #include "qfontengine_pm_p.h"
|
---|
48 |
|
---|
49 | QT_BEGIN_NAMESPACE
|
---|
50 |
|
---|
51 | #ifndef QT_NO_FREETYPE
|
---|
52 |
|
---|
53 | // ------------------------------------------------------------------
|
---|
54 | // PM FT engine
|
---|
55 | // ------------------------------------------------------------------
|
---|
56 |
|
---|
57 | QFontEnginePMFT::QFontEnginePMFT(const QFontDef &fd, const FaceId &faceId,
|
---|
58 | bool antialias, HintStyle hintStyle,
|
---|
59 | bool autoHint, SubpixelAntialiasingType subPixel,
|
---|
60 | int lcdFilter, bool useEmbeddedBitmap)
|
---|
61 | : QFontEngineFT(fd)
|
---|
62 | {
|
---|
63 | subpixelType = subPixel;
|
---|
64 |
|
---|
65 | default_hint_style = (QFontEngineFT::HintStyle)hintStyle;
|
---|
66 |
|
---|
67 | #if defined(FT_LOAD_FORCE_AUTOHINT)
|
---|
68 | if (autoHint)
|
---|
69 | default_load_flags |= FT_LOAD_FORCE_AUTOHINT;
|
---|
70 | #endif
|
---|
71 |
|
---|
72 | lcdFilterType = lcdFilter;
|
---|
73 | embeddedbitmap = useEmbeddedBitmap;
|
---|
74 |
|
---|
75 | GlyphFormat defaultFormat = Format_None;
|
---|
76 | if (subpixelType != QFontEngineFT::Subpixel_None)
|
---|
77 | defaultFormat = Format_A32;
|
---|
78 | else if (antialias)
|
---|
79 | defaultFormat = Format_A8;
|
---|
80 | else
|
---|
81 | defaultFormat = Format_Mono;
|
---|
82 |
|
---|
83 | init(faceId, antialias, defaultFormat);
|
---|
84 | }
|
---|
85 |
|
---|
86 | QFontEnginePMFT::~QFontEnginePMFT()
|
---|
87 | {
|
---|
88 | freeGlyphSets();
|
---|
89 | }
|
---|
90 |
|
---|
91 | #endif // QT_NO_FREETYPE
|
---|
92 |
|
---|
93 | QT_END_NAMESPACE
|
---|