summaryrefslogtreecommitdiff
path: root/freetype
authormickeyl <mickeyl>2004-04-05 10:36:31 (UTC)
committer mickeyl <mickeyl>2004-04-05 10:36:31 (UTC)
commit900fb3d498891d9aca81c362b2ea3460d1dc3f59 (patch) (unidiff)
tree35675d48a982d60934778b04983743759f694e2f /freetype
parent5a07a653948bfbfa5091a182ad62939c01624e38 (diff)
downloadopie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.zip
opie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.tar.gz
opie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.tar.bz2
convert to odebug
Diffstat (limited to 'freetype') (more/less context) (ignore whitespace changes)
-rw-r--r--freetype/config.in2
-rw-r--r--freetype/fontfactoryttf_qws.cpp18
-rw-r--r--freetype/freetype.pro8
3 files changed, 14 insertions, 14 deletions
diff --git a/freetype/config.in b/freetype/config.in
index 71c5df7..68b659a 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 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/freetype/fontfactoryttf_qws.cpp b/freetype/fontfactoryttf_qws.cpp
index 1f082a9..1ed0d2c 100644
--- a/freetype/fontfactoryttf_qws.cpp
+++ b/freetype/fontfactoryttf_qws.cpp
@@ -15,15 +15,17 @@
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
22#include "fontfactoryttf_qws.h" 21#include "fontfactoryttf_qws.h"
23 22
23#include <opie2/odebug.h>
24using namespace Opie::Core;
25
24#ifdef QT_NO_FREETYPE 26#ifdef QT_NO_FREETYPE
25 27
26#include "qfontdata_p.h" 28#include "qfontdata_p.h"
27#include <string.h> 29#include <string.h>
28#include <stdio.h> 30#include <stdio.h>
29 31
@@ -104,19 +106,19 @@ public:
104 QGlyph result; 106 QGlyph result;
105 107
106 FT_Error err; 108 FT_Error err;
107 109
108 err=FT_Load_Glyph(myface,index,FT_LOAD_DEFAULT); 110 err=FT_Load_Glyph(myface,index,FT_LOAD_DEFAULT);
109 if(err) 111 if(err)
110 qFatal("Load glyph error %x",err); 112 ofatal << "Load glyph error " << err << "" << oendl;
111 113
112 int width=0,height=0,pitch=0,size=0; 114 int width=0,height=0,pitch=0,size=0;
113 FT_Glyph glyph; 115 FT_Glyph glyph;
114 err=FT_Get_Glyph( myface->glyph, &glyph ); 116 err=FT_Get_Glyph( myface->glyph, &glyph );
115 if(err) 117 if(err)
116 qFatal("Get glyph error %x",err); 118 ofatal << "Get glyph error " << err << "" << oendl;
117 119
118 FT_BBox bbox; 120 FT_BBox bbox;
119 FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_gridfit, &bbox); 121 FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_gridfit, &bbox);
120 122
121 FT_Vector origin; 123 FT_Vector origin;
122 origin.x = -bbox.xMin; 124 origin.x = -bbox.xMin;
@@ -124,13 +126,13 @@ public:
124 126
125 if ( FT_IS_SCALABLE(myface) ) { 127 if ( FT_IS_SCALABLE(myface) ) {
126 err=FT_Glyph_To_Bitmap(&glyph, 128 err=FT_Glyph_To_Bitmap(&glyph,
127 smooth ? ft_render_mode_normal : ft_render_mode_mono, 129 smooth ? ft_render_mode_normal : ft_render_mode_mono,
128 &origin, 1); // destroy original glyph 130 &origin, 1); // destroy original glyph
129 if(err) 131 if(err)
130 qWarning("Get bitmap error %d",err); 132 owarn << "Get bitmap error " << err << "" << oendl;
131 } 133 }
132 134
133 if ( !err ) { 135 if ( !err ) {
134 FT_Bitmap bm = ((FT_BitmapGlyph)glyph)->bitmap; 136 FT_Bitmap bm = ((FT_BitmapGlyph)glyph)->bitmap;
135 pitch = bm.pitch; 137 pitch = bm.pitch;
136 size=pitch*bm.rows; 138 size=pitch*bm.rows;
@@ -177,13 +179,13 @@ private:
177 // Assume 72 dpi for now 179 // Assume 72 dpi for now
178 const int dpi=72; 180 const int dpi=72;
179 FT_Error err; 181 FT_Error err;
180 err=FT_Set_Char_Size(myface, psize,psize,dpi,dpi); 182 err=FT_Set_Char_Size(myface, psize,psize,dpi,dpi);
181 if (err) { 183 if (err) {
182 if (FT_IS_SCALABLE(myface) ) { 184 if (FT_IS_SCALABLE(myface) ) {
183 qWarning("Set char size error %x for size %d",err,ptsize); 185 owarn << "Set char size error " << err << " for size " << ptsize << "" << oendl;
184 } else { 186 } else {
185 int best=-1; 187 int best=-1;
186 int bdh=99; 188 int bdh=99;
187 for (int i=0; i<myface->num_fixed_sizes; i++) { 189 for (int i=0; i<myface->num_fixed_sizes; i++) {
188 FT_Bitmap_Size& sz=myface->available_sizes[i]; 190 FT_Bitmap_Size& sz=myface->available_sizes[i];
189 int dh = sz.height - ptsize*dpi/72/10; 191 int dh = sz.height - ptsize*dpi/72/10;
@@ -195,24 +197,24 @@ private:
195 } 197 }
196 if ( best >= 0 ) 198 if ( best >= 0 )
197 err=FT_Set_Pixel_Sizes(myface, 199 err=FT_Set_Pixel_Sizes(myface,
198 myface->available_sizes[best].width, 200 myface->available_sizes[best].width,
199 myface->available_sizes[best].height); 201 myface->available_sizes[best].height);
200 if ( err ) 202 if ( err )
201 qWarning("Set char size error %x for size %d",err,ptsize); 203 owarn << "Set char size error " << err << " for size " << ptsize << "" << oendl;
202 } 204 }
203 } 205 }
204 } 206 }
205}; 207};
206 208
207QFontFactoryFT::QFontFactoryFT() 209QFontFactoryFT::QFontFactoryFT()
208{ 210{
209 FT_Error err; 211 FT_Error err;
210 err=FT_Init_FreeType(&library); 212 err=FT_Init_FreeType(&library);
211 if(err) { 213 if(err) {
212 qFatal("Couldn't initialise Freetype library"); 214 ofatal << "Couldn't initialise Freetype library" << oendl;
213 } 215 }
214} 216}
215 217
216QFontFactoryFT::~QFontFactoryFT() 218QFontFactoryFT::~QFontFactoryFT()
217{ 219{
218} 220}
@@ -233,13 +235,13 @@ void QFontFactoryFT::load(QDiskFont * qdf) const
233 return; 235 return;
234 QDiskFontFT *f = new QDiskFontFT; 236 QDiskFontFT *f = new QDiskFontFT;
235 qdf->p=f; 237 qdf->p=f;
236 FT_Error err; 238 FT_Error err;
237 err=FT_New_Face(library,qdf->file.ascii(),0,&(f->face)); 239 err=FT_New_Face(library,qdf->file.ascii(),0,&(f->face));
238 if(err) { 240 if(err) {
239 qFatal("Error %d opening face",err); 241 ofatal << "Error " << err << " opening face" << oendl;
240 } 242 }
241 qdf->loaded=true; 243 qdf->loaded=true;
242} 244}
243 245
244 246
245#endif // QT_NO_FREETYPE 247#endif // QT_NO_FREETYPE
diff --git a/freetype/freetype.pro b/freetype/freetype.pro
index bdc37f6..ca2841c 100644
--- a/freetype/freetype.pro
+++ b/freetype/freetype.pro
@@ -1,15 +1,13 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on release 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+= $(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 -lopiecore2
11 VERSION = 1.0.0 11 VERSION = 1.0.1
12
13
14 12
15include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )