summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--freetype/fontfactoryttf_qws.cpp19
-rw-r--r--freetype/fontfactoryttf_qws.h3
-rw-r--r--freetype/freetype.pro2
-rw-r--r--freetype/freetypefactoryimpl.cpp2
-rw-r--r--freetype/opie-freetype.control2
5 files changed, 17 insertions, 11 deletions
diff --git a/freetype/fontfactoryttf_qws.cpp b/freetype/fontfactoryttf_qws.cpp
index 5aa53fb..1f082a9 100644
--- a/freetype/fontfactoryttf_qws.cpp
+++ b/freetype/fontfactoryttf_qws.cpp
@@ -32,13 +32,12 @@
32#define TRUNC(x) ((x) >> 6) 32#define TRUNC(x) ((x) >> 6)
33 33
34 34
35extern "C" { 35extern "C" {
36#include <ft2build.h> 36#include <freetype/freetype.h>
37#include FT_FREETYPE_H 37#include <freetype/ftglyph.h>
38#include FT_GLYPH_H 38#include <freetype/ftoutln.h>
39#include FT_OUTLINE_H 39#include <freetype/ftbbox.h>
40#include FT_BBOX_H
41} 40}
42 41
43class QDiskFontFT : public QDiskFontPrivate { 42class QDiskFontFT : public QDiskFontPrivate {
44public: 43public:
@@ -68,8 +67,10 @@ public:
68 } 67 }
69 68
70 ~QRenderedFontFT() 69 ~QRenderedFontFT()
71 { 70 {
71 // When inter-process glyph sharing is implemented, the glyph data
72 // for this font can be dereferenced here.
72 } 73 }
73 74
74 bool unicode(int & i) const 75 bool unicode(int & i) const
75 { 76 {
@@ -107,9 +108,9 @@ public:
107 err=FT_Load_Glyph(myface,index,FT_LOAD_DEFAULT); 108 err=FT_Load_Glyph(myface,index,FT_LOAD_DEFAULT);
108 if(err) 109 if(err)
109 qFatal("Load glyph error %x",err); 110 qFatal("Load glyph error %x",err);
110 111
111 int width,height,pitch,size = 0; 112 int width=0,height=0,pitch=0,size=0;
112 FT_Glyph glyph; 113 FT_Glyph glyph;
113 err=FT_Get_Glyph( myface->glyph, &glyph ); 114 err=FT_Get_Glyph( myface->glyph, &glyph );
114 if(err) 115 if(err)
115 qFatal("Get glyph error %x",err); 116 qFatal("Get glyph error %x",err);
@@ -154,8 +155,14 @@ public:
154 result.metrics->linestep=pitch; 155 result.metrics->linestep=pitch;
155 result.metrics->width=width; 156 result.metrics->width=width;
156 result.metrics->height=height; 157 result.metrics->height=height;
157 158
159 // XXX memory manage me
160 // At some point inter-process glyph data sharing must be implemented
161 // and the flag below can be set to prevent Qt from deleting the glyph
162 // data.
163 // result.metrics->flags = QGlyphMetrics::RendererOwnsData;
164
158 FT_Done_Glyph( glyph ); 165 FT_Done_Glyph( glyph );
159 166
160 return result; 167 return result;
161 } 168 }
diff --git a/freetype/fontfactoryttf_qws.h b/freetype/fontfactoryttf_qws.h
index 4ba8ce5..208ab61 100644
--- a/freetype/fontfactoryttf_qws.h
+++ b/freetype/fontfactoryttf_qws.h
@@ -32,10 +32,9 @@
32 32
33#ifdef QT_NO_FREETYPE 33#ifdef QT_NO_FREETYPE
34 34
35extern "C" { 35extern "C" {
36#include <ft2build.h> 36#include <freetype/freetype.h>
37#include FT_FREETYPE_H
38} 37}
39 38
40// ascent, descent, width(ch), width(string), maxwidth? 39// ascent, descent, width(ch), width(string), maxwidth?
41// leftbearing, rightbearing, minleftbearing,minrightbearing 40// leftbearing, rightbearing, minleftbearing,minrightbearing
diff --git a/freetype/freetype.pro b/freetype/freetype.pro
index 5800b48..ca7edd3 100644
--- a/freetype/freetype.pro
+++ b/freetype/freetype.pro
@@ -4,8 +4,8 @@ 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+= $(OPIEDIR)/include 8 INCLUDEPATH+= $(QTDIR)/src/3rdparty/freetype/include $(QTDIR)/src/3rdparty/freetype/include/freetype/config $(OPIEDIR)/include
9DEPENDPATH += $(OPIEDIR)/include 9DEPENDPATH += $(OPIEDIR)/include
10LIBS += -lqpe -lfreetype 10LIBS += -lqpe -lfreetype
11 VERSION = 1.0.0 11 VERSION = 1.0.0
diff --git a/freetype/freetypefactoryimpl.cpp b/freetype/freetypefactoryimpl.cpp
index 71460b2..24fb13a 100644
--- a/freetype/freetypefactoryimpl.cpp
+++ b/freetype/freetypefactoryimpl.cpp
@@ -47,9 +47,9 @@ QRESULT FreeTypeFactoryImpl::queryInterface( const QUuid &uuid, QUnknownInterfac
47 *iface = this; 47 *iface = this;
48 48
49 if ( *iface ) 49 if ( *iface )
50 (*iface)->addRef(); 50 (*iface)->addRef();
51 return QS_OK; 51 return (*iface) ? QS_OK : QS_FALSE;
52} 52}
53 53
54Q_EXPORT_INTERFACE() 54Q_EXPORT_INTERFACE()
55{ 55{
diff --git a/freetype/opie-freetype.control b/freetype/opie-freetype.control
index f1ce408..2863adb 100644
--- a/freetype/opie-freetype.control
+++ b/freetype/opie-freetype.control
@@ -3,6 +3,6 @@ Priority: optional
3Section: opie/plugins 3Section: opie/plugins
4Maintainer: Opie <opie@llornkcor.com> 4Maintainer: Opie <opie@llornkcor.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION), libfreetype6
8Description: Freetype fontfactory plugin 8Description: Freetype fontfactory plugin