summaryrefslogtreecommitdiff
path: root/freetype/fontfactoryttf_qws.cpp
authorar <ar>2005-01-22 21:53:54 (UTC)
committer ar <ar>2005-01-22 21:53:54 (UTC)
commit687b18f07228aac2b168ea5e3204c1c3518929a7 (patch) (unidiff)
tree485b49ef6150e7aad4bde0a942c0b17d863b240c /freetype/fontfactoryttf_qws.cpp
parent6d08fa658ab487426eebe934fdd92cd3bbb925b3 (diff)
downloadopie-687b18f07228aac2b168ea5e3204c1c3518929a7.zip
opie-687b18f07228aac2b168ea5e3204c1c3518929a7.tar.gz
opie-687b18f07228aac2b168ea5e3204c1c3518929a7.tar.bz2
- build opie-freetype against freetype2
you must specified <prefix>/include/freetype2 in dependencies menu (make menuconfig)
Diffstat (limited to 'freetype/fontfactoryttf_qws.cpp') (more/less context) (show whitespace changes)
-rw-r--r--freetype/fontfactoryttf_qws.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/freetype/fontfactoryttf_qws.cpp b/freetype/fontfactoryttf_qws.cpp
index 1ed0d2c..6d41c33 100644
--- a/freetype/fontfactoryttf_qws.cpp
+++ b/freetype/fontfactoryttf_qws.cpp
@@ -14,48 +14,52 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "fontfactoryttf_qws.h" 21#include "fontfactoryttf_qws.h"
22 22
23#include <opie2/odebug.h> 23#include <opie2/odebug.h>
24using namespace Opie::Core; 24using namespace Opie::Core;
25 25
26#ifdef QT_NO_FREETYPE 26#ifdef QT_NO_FREETYPE
27 27
28#include "qfontdata_p.h" 28#include "qfontdata_p.h"
29#include <string.h> 29#include <string.h>
30#include <stdio.h> 30#include <stdio.h>
31 31
32#define FLOOR(x) ((x) & -64) 32#define FLOOR(x) ((x) & -64)
33#define CEIL(x) (((x)+63) & -64) 33#define CEIL(x) (((x)+63) & -64)
34#define TRUNC(x) ((x) >> 6) 34#define TRUNC(x) ((x) >> 6)
35 35
36 36
37extern "C" { 37extern "C" {
38
39#include <ft2build.h>
40#include FT_FREETYPE_H
41
38#include <freetype/freetype.h> 42#include <freetype/freetype.h>
39#include <freetype/ftglyph.h> 43#include <freetype/ftglyph.h>
40#include <freetype/ftoutln.h> 44#include <freetype/ftoutln.h>
41#include <freetype/ftbbox.h> 45#include <freetype/ftbbox.h>
42} 46}
43 47
44class QDiskFontFT : public QDiskFontPrivate { 48class QDiskFontFT : public QDiskFontPrivate {
45public: 49public:
46 FT_Face face; 50 FT_Face face;
47}; 51};
48 52
49class QRenderedFontFT : public QRenderedFont { 53class QRenderedFontFT : public QRenderedFont {
50public: 54public:
51 QRenderedFontFT(QDiskFont* f, const QFontDef &d) : 55 QRenderedFontFT(QDiskFont* f, const QFontDef &d) :
52 QRenderedFont(f,d) 56 QRenderedFont(f,d)
53 { 57 {
54 QDiskFontFT *df = (QDiskFontFT*)(f->p); 58 QDiskFontFT *df = (QDiskFontFT*)(f->p);
55 myface=df->face; 59 myface=df->face;
56 selectThisSize(); 60 selectThisSize();
57 // A 1-pixel baseline is excluded in Qt/Windows/X11 fontmetrics 61 // A 1-pixel baseline is excluded in Qt/Windows/X11 fontmetrics
58 // (see QFontMetrics::height()) 62 // (see QFontMetrics::height())
59 // 63 //
60 fascent=CEIL(myface->size->metrics.ascender)/64; 64 fascent=CEIL(myface->size->metrics.ascender)/64;
61 fdescent=-FLOOR(myface->size->metrics.descender)/64-1; 65 fdescent=-FLOOR(myface->size->metrics.descender)/64-1;