summaryrefslogtreecommitdiff
path: root/freetype
Unidiff
Diffstat (limited to 'freetype') (more/less context) (show whitespace changes)
-rw-r--r--freetype/config.in2
-rw-r--r--freetype/fontfactoryttf_qws.cpp4
-rw-r--r--freetype/fontfactoryttf_qws.h4
-rw-r--r--freetype/freetype.pro6
4 files changed, 14 insertions, 2 deletions
diff --git a/freetype/config.in b/freetype/config.in
index 68b659a..16d00eb 100644
--- a/freetype/config.in
+++ b/freetype/config.in
@@ -1,4 +1,4 @@
1 config FREETYPE 1 config FREETYPE
2 boolean "opie-freetype (support for fonts used via the freetype library)" 2 boolean "opie-freetype (support for fonts used via the freetype library)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBFREETYPE2_DEP
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;
diff --git a/freetype/fontfactoryttf_qws.h b/freetype/fontfactoryttf_qws.h
index ff0fcfc..ddf5b57 100644
--- a/freetype/fontfactoryttf_qws.h
+++ b/freetype/fontfactoryttf_qws.h
@@ -12,48 +12,52 @@
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
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 21
22#ifndef FONTFACTORY_FT_H 22#ifndef FONTFACTORY_FT_H
23#define FONTFACTORY_FT_H 23#define FONTFACTORY_FT_H
24 24
25#include <qfontmanager_qws.h> 25#include <qfontmanager_qws.h>
26#if QT_VERSION >= 0x030000 26#if QT_VERSION >= 0x030000
27# include <private/qfontdata_p.h> 27# include <private/qfontdata_p.h>
28#else 28#else
29# include "qfontdata_p.h" 29# include "qfontdata_p.h"
30#endif 30#endif
31 31
32 32
33#ifdef QT_NO_FREETYPE 33#ifdef QT_NO_FREETYPE
34 34
35extern "C" { 35extern "C" {
36
37#include <ft2build.h>
38#include FT_FREETYPE_H
39
36#include <freetype/freetype.h> 40#include <freetype/freetype.h>
37} 41}
38 42
39// ascent, descent, width(ch), width(string), maxwidth? 43// ascent, descent, width(ch), width(string), maxwidth?
40// leftbearing, rightbearing, minleftbearing,minrightbearing 44// leftbearing, rightbearing, minleftbearing,minrightbearing
41// leading 45// leading
42 46
43class QFontFactoryFT : public QFontFactory { 47class QFontFactoryFT : public QFontFactory {
44 48
45public: 49public:
46 50
47 QFontFactoryFT(); 51 QFontFactoryFT();
48 virtual ~QFontFactoryFT(); 52 virtual ~QFontFactoryFT();
49 53
50 QRenderedFont * get(const QFontDef &,QDiskFont *); 54 QRenderedFont * get(const QFontDef &,QDiskFont *);
51 virtual void load(QDiskFont *) const; 55 virtual void load(QDiskFont *) const;
52 virtual QString name(); 56 virtual QString name();
53 57
54private: 58private:
55 59
56 friend class QRenderedFontFT; 60 friend class QRenderedFontFT;
57 FT_Library library; 61 FT_Library library;
58}; 62};
59 63
diff --git a/freetype/freetype.pro b/freetype/freetype.pro
index c409577..87aaf9e 100644
--- a/freetype/freetype.pro
+++ b/freetype/freetype.pro
@@ -1,13 +1,17 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 HEADERS = fontfactoryttf_qws.h freetypefactoryimpl.h 3 HEADERS = fontfactoryttf_qws.h freetypefactoryimpl.h
4 SOURCES = fontfactoryttf_qws.cpp freetypefactoryimpl.cpp 4 SOURCES = fontfactoryttf_qws.cpp freetypefactoryimpl.cpp
5 qt2:HEADERS+= qfontdata_p.h 5 qt2:HEADERS+= qfontdata_p.h
6 TARGET = freetypefactory 6 TARGET = freetypefactory
7 DESTDIR = $(OPIEDIR)/plugins/fontfactories 7 DESTDIR = $(OPIEDIR)/plugins/fontfactories
8 INCLUDEPATH+= $(QTDIR)/src/3rdparty/freetype/include $(QTDIR)/src/3rdparty/freetype/include/freetype/config $(OPIEDIR)/include 8 INCLUDEPATH+= $(OPIEDIR)/include
9DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe -lfreetype -lopiecore2 10LIBS += -lqpe -lfreetype -lopiecore2
11 VERSION = 1.0.1 11 VERSION = 1.0.1
12 12
13include( $(OPIEDIR)/include.pro ) 13include( $(OPIEDIR)/include.pro )
14
15!isEmpty( LIBFREETYPE2_INC_DIR ) {
16 INCLUDEPATH = $$LIBFREETYPE2_INC_DIR $$INCLUDEPATH
17}