author | mickeyl <mickeyl> | 2004-04-05 10:36:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 10:36:31 (UTC) |
commit | 900fb3d498891d9aca81c362b2ea3460d1dc3f59 (patch) (side-by-side diff) | |
tree | 35675d48a982d60934778b04983743759f694e2f /freetype/fontfactoryttf_qws.cpp | |
parent | 5a07a653948bfbfa5091a182ad62939c01624e38 (diff) | |
download | opie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.zip opie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.tar.gz opie-900fb3d498891d9aca81c362b2ea3460d1dc3f59.tar.bz2 |
convert to odebug
Diffstat (limited to 'freetype/fontfactoryttf_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | freetype/fontfactoryttf_qws.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
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 @@ -9,27 +9,29 @@ ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ - #include "fontfactoryttf_qws.h" +#include <opie2/odebug.h> +using namespace Opie::Core; + #ifdef QT_NO_FREETYPE #include "qfontdata_p.h" #include <string.h> #include <stdio.h> #define FLOOR(x) ((x) & -64) #define CEIL(x) (((x)+63) & -64) #define TRUNC(x) ((x) >> 6) extern "C" { @@ -98,45 +100,45 @@ public: { selectThisSize(); int index = ch.unicode(); if ( !unicode(index) ) index = 0; QGlyph result; FT_Error err; err=FT_Load_Glyph(myface,index,FT_LOAD_DEFAULT); if(err) - qFatal("Load glyph error %x",err); + ofatal << "Load glyph error " << err << "" << oendl; int width=0,height=0,pitch=0,size=0; FT_Glyph glyph; err=FT_Get_Glyph( myface->glyph, &glyph ); if(err) - qFatal("Get glyph error %x",err); + ofatal << "Get glyph error " << err << "" << oendl; FT_BBox bbox; FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_gridfit, &bbox); FT_Vector origin; origin.x = -bbox.xMin; origin.y = -bbox.yMin; if ( FT_IS_SCALABLE(myface) ) { err=FT_Glyph_To_Bitmap(&glyph, smooth ? ft_render_mode_normal : ft_render_mode_mono, &origin, 1); // destroy original glyph if(err) - qWarning("Get bitmap error %d",err); + owarn << "Get bitmap error " << err << "" << oendl; } if ( !err ) { FT_Bitmap bm = ((FT_BitmapGlyph)glyph)->bitmap; pitch = bm.pitch; size=pitch*bm.rows; result.data = new uchar[size]; // XXX memory manage me width=bm.width; height=bm.rows; if ( size ) { memcpy( result.data, bm.buffer, size ); } else { @@ -171,54 +173,54 @@ public: private: void selectThisSize() { int psize=(ptsize<<6)/10; // Assume 72 dpi for now const int dpi=72; FT_Error err; err=FT_Set_Char_Size(myface, psize,psize,dpi,dpi); if (err) { if (FT_IS_SCALABLE(myface) ) { - qWarning("Set char size error %x for size %d",err,ptsize); + owarn << "Set char size error " << err << " for size " << ptsize << "" << oendl; } else { int best=-1; int bdh=99; for (int i=0; i<myface->num_fixed_sizes; i++) { FT_Bitmap_Size& sz=myface->available_sizes[i]; int dh = sz.height - ptsize*dpi/72/10; dh = QABS(dh); if ( dh < bdh ) { bdh=dh; best=i; } } if ( best >= 0 ) err=FT_Set_Pixel_Sizes(myface, myface->available_sizes[best].width, myface->available_sizes[best].height); if ( err ) - qWarning("Set char size error %x for size %d",err,ptsize); + owarn << "Set char size error " << err << " for size " << ptsize << "" << oendl; } } } }; QFontFactoryFT::QFontFactoryFT() { FT_Error err; err=FT_Init_FreeType(&library); if(err) { - qFatal("Couldn't initialise Freetype library"); + ofatal << "Couldn't initialise Freetype library" << oendl; } } QFontFactoryFT::~QFontFactoryFT() { } QString QFontFactoryFT::name() { return "FT"; } @@ -227,19 +229,19 @@ QRenderedFont * QFontFactoryFT::get(const QFontDef & f,QDiskFont * f2) return new QRenderedFontFT(f2, f); } void QFontFactoryFT::load(QDiskFont * qdf) const { if(qdf->loaded) return; QDiskFontFT *f = new QDiskFontFT; qdf->p=f; FT_Error err; err=FT_New_Face(library,qdf->file.ascii(),0,&(f->face)); if(err) { - qFatal("Error %d opening face",err); + ofatal << "Error " << err << " opening face" << oendl; } qdf->loaded=true; } #endif // QT_NO_FREETYPE |