pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/kdebase3 Apply patches from KDE CVS to fix buildin...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/66e4022390ab
branches:  trunk
changeset: 474465:66e4022390ab
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Fri Apr 30 01:42:11 2004 +0000

description:
Apply patches from KDE CVS to fix building with freetype2 2.1.8.

diffstat:

 x11/kdebase3/distinfo         |    4 +-
 x11/kdebase3/patches/patch-ah |  355 ++++++++++++++++++++++++++++++++++++++++++
 x11/kdebase3/patches/patch-ai |   89 ++++++++++
 3 files changed, 447 insertions(+), 1 deletions(-)

diffs (truncated from 470 to 300 lines):

diff -r 82295f4ed6ef -r 66e4022390ab x11/kdebase3/distinfo
--- a/x11/kdebase3/distinfo     Fri Apr 30 00:44:57 2004 +0000
+++ b/x11/kdebase3/distinfo     Fri Apr 30 01:42:11 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.47 2004/04/26 11:54:15 markd Exp $
+$NetBSD: distinfo,v 1.48 2004/04/30 01:42:11 xtraeme Exp $
 
 SHA1 (kdebase-3.2.2.tar.bz2) = bc941b3faa4440ca2048d9332371c974d0e17f5b
 Size (kdebase-3.2.2.tar.bz2) = 17216476 bytes
@@ -13,6 +13,8 @@
 SHA1 (patch-ae) = 5d9902de9990efc1883f11563f49ac8639fe743d
 SHA1 (patch-af) = ad9b3a97151c964d4adea2d8fecd780c6198b205
 SHA1 (patch-ag) = 89f50ee8b328cd654aebf1da5424e87eb6b42628
+SHA1 (patch-ah) = c273786bd5f9c2287c81d2eecb12f92f90cb783c
+SHA1 (patch-ai) = 5f72c65f879798be1bb7c6e9340854d57e31aed0
 SHA1 (patch-bb) = 1b6c717a1bedafbeae0037ee382795d8aa59f081
 SHA1 (patch-bc) = 2d54d0700b30f5471eb60d104148ecf5ac835f58
 SHA1 (patch-bx) = d58d16fd484fc0a46c1ae93267af19e73af6f990
diff -r 82295f4ed6ef -r 66e4022390ab x11/kdebase3/patches/patch-ah
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/kdebase3/patches/patch-ah     Fri Apr 30 01:42:11 2004 +0000
@@ -0,0 +1,355 @@
+$NetBSD: patch-ah,v 1.4 2004/04/30 01:42:11 xtraeme Exp $
+
+Fixes build with Freetype-2.1.8, see:
+http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdebase/kcontrol/kfontinst/lib/FontEngine.cpp
+
+--- kcontrol/kfontinst/lib/FontEngine.cpp      2004/03/30 21:17:35     1.12.2.2
++++ kcontrol/kfontinst/lib/FontEngine.cpp      2004/04/27 20:30:25     1.12.2.3
+@@ -4,7 +4,7 @@
+ // Author        : Craig Drummond
+ // Project       : K Font Installer
+ // Creation Date : 29/04/2001
+-// Version       : $Revision: 1.4 $ $Date: 2004/04/30 01:42:11 $
++// Version       : $Revision: 1.4 $ $Date: 2004/04/30 01:42:11 $
+ //
+ ////////////////////////////////////////////////////////////////////////////////
+ //
+@@ -522,14 +522,33 @@ void CFontEngine::createPreview(int widt
+ 
+     FT_Face        face;
+     FT_Size        size;
+-    FTC_Image_Desc font;
+ 
++#if KFI_FT_IS_GE(2, 1, 8)
++    FTC_ScalerRec    scaler;
++    FTC_ImageTypeRec font;
++#else
++    FTC_Image_Desc   font;
++#endif
++
++#if KFI_FT_IS_GE(2, 1, 8)
++    font.face_id=getId(itsPath, faceNo);
++    font.width=font.height=point2Pixel(sizes[s].font);
++    font.flags=FT_LOAD_DEFAULT;
++    scaler.face_id=font.face_id;
++    scaler.width=scaler.height=font.width;
++    scaler.pixel=1;
++#else
+     font.font.face_id=getId(itsPath, faceNo);
+     font.font.pix_width=font.font.pix_height=point2Pixel(sizes[s].font);
+     font.image_type=ftc_image_grays;
++#endif
+ 
+     FT_F26Dot6 startX=sizes[s].offset,
++#if KFI_FT_IS_GE(2, 1, 8)
++               startY=sizes[s].offset+font.height,
++#else
+                startY=sizes[s].offset+font.font.pix_height,
++#endif
+                x=startX,
+                y=startY;
+ 
+@@ -570,7 +589,12 @@ void CFontEngine::createPreview(int widt
+         y+=startY;
+     }
+ 
++#if KFI_FT_IS_GE(2, 1, 8)
++    if(!FTC_Manager_LookupFace(itsFt.cacheManager, scaler.face_id, &face) &&
++       !FTC_Manager_LookupSize(itsFt.cacheManager, &scaler, &size))
++#else
+     if(!FTC_Manager_Lookup_Size(itsFt.cacheManager, &(font.font), &face, &size))
++#endif
+     {
+         int        i;
+         FT_F26Dot6 stepY=size->metrics.y_ppem /*(size->metrics.height>>6)*/ + sizes[s].offset;
+@@ -585,14 +609,24 @@ void CFontEngine::createPreview(int widt
+                 unsigned int ch;
+ 
+                 for(ch=0; ch<quote.length(); ++ch)
+-                    if(drawGlyph(pix, font, size, FT_Get_Char_Index(face, quote[ch].unicode()),
++                    if(drawGlyph(pix, font, FT_Get_Char_Index(face, quote[ch].unicode()),
+                        x, y, width, height, startX, stepY, sizes[s].space))
+                         break;
+             }
+ 
++#if KFI_FT_IS_GE(2, 1, 8)
++            font.width=font.height=point2Pixel((int)(sizes[s].font*0.75));
++            scaler.width=scaler.height=font.width;
++#else
+             font.font.pix_width=font.font.pix_height=point2Pixel((int)(sizes[s].font*0.75));
++#endif
+ 
+-            if(y<height && !FTC_Manager_Lookup_Size(itsFt.cacheManager, &(font.font), &face, &size))
++            if(y<height &&
++#if KFI_FT_IS_GE(2, 1, 8)
++               !FTC_Manager_LookupSize(itsFt.cacheManager, &scaler, &size))
++#else
++               !FTC_Manager_Lookup_Size(itsFt.cacheManager, &(font.font), &face, &size))
++#endif
+             {
+                 FT_F26Dot6 stepY=size->metrics.y_ppem /*(size->metrics.height>>6)*/ + sizes[s].offset;
+ 
+@@ -603,12 +637,15 @@ void CFontEngine::createPreview(int widt
+                         y+=stepY;
+                         x=startX;
+                     }
+-
++#if KFI_FT_IS_GE(2, 1, 8)
++                    y+=font.height;
++#else
+                     y+=font.font.pix_height;
++#endif
+                 }
+ 
+                 for(i=1; i<face->num_glyphs; ++i)  // Glyph 0 is the NULL glyph
+-                    if(drawGlyph(pix, font, size, i, x, y, width, height, startX, stepY))
++                    if(drawGlyph(pix, font, i, x, y, width, height, startX, stepY))
+                         break;
+             }
+         }
+@@ -621,14 +658,14 @@ void CFontEngine::createPreview(int widt
+                 unsigned int ch;
+ 
+                 for(ch=0; ch<str.length(); ++ch)
+-                    if(drawGlyph(pix, font, size, FT_Get_Char_Index(face, str[ch].unicode()),
++                    if(drawGlyph(pix, font, FT_Get_Char_Index(face, str[ch].unicode()),
+                        x, y, width, height, startX, stepY))
+                         break;
+ 
+             }
+             else
+                 for(i=1; i<face->num_glyphs; ++i)  // Glyph 0 is the NULL glyph
+-                    if(drawGlyph(pix, font, size, i, x, y, width, height, startX, stepY))
++                    if(drawGlyph(pix, font, i, x, y, width, height, startX, stepY))
+                         break;
+         }
+ 
+@@ -2858,8 +2895,13 @@ FTC_FaceID CFontEngine::getId(const QStr
+     return (FTC_FaceID)p;
+ }
+ 
++#if KFI_FT_IS_GE(2, 1, 8)
++bool CFontEngine::getGlyphBitmap(FTC_ImageTypeRec &font, FT_ULong index, Bitmap &target, int &left, int &top,
++                                 int &xAdvance, FT_Pointer *ptr)
++#else
+ bool CFontEngine::getGlyphBitmap(FTC_Image_Desc &font, FT_ULong index, Bitmap &target, int &left, int &top,
+                                  int &xAdvance, FT_Pointer *ptr)
++#endif
+ {
+     bool ok=false;
+ 
+@@ -2867,13 +2909,23 @@ bool CFontEngine::getGlyphBitmap(FTC_Ima
+ 
+     //
+     // Cache small glyphs, else render on demand...
++#if KFI_FT_IS_GE(2, 1, 8)
++    if(font.width<48 && font.height<48)
++#else
+     if(font.font.pix_width<48 && font.font.pix_height<48)
++#endif
+     {
+         FTC_SBit sbit;
+ 
+-        if(!FTC_SBit_Cache_Lookup(itsFt.sBitCache, &font, index, &sbit))
++#if KFI_FT_IS_GE(2, 1, 8)
++        if(!FTC_SBitCache_Lookup(itsFt.sBitCache, &font, index, &sbit, NULL) && sbit->buffer)
++#else
++        if(!FTC_SBit_Cache_Lookup(itsFt.sBitCache, &font, index, &sbit) && sbit->buffer)
++#endif
+         {
+-            target.greys=ft_pixel_mode_mono==sbit->format ? 2 : 256;
++            target.greys=sbit->max_grays+1; // ft_pixel_mode_mono==sbit->format ? 2 : 256;
++            target.mono=ft_pixel_mode_mono==sbit->format ? true : false;
++            target.pitch=sbit->pitch;
+             target.height=sbit->height;
+             target.width=sbit->width;
+             target.buffer=sbit->buffer;
+@@ -2883,11 +2935,15 @@ bool CFontEngine::getGlyphBitmap(FTC_Ima
+             ok=true;
+         }
+     }
+-    else
++    if(!ok)
+     {
+         FT_Glyph glyph;
+ 
++#if KFI_FT_IS_GE(2, 1, 8)
++        if(!FTC_ImageCache_Lookup(itsFt.imageCache, &font, index, &glyph, NULL))
++#else
+         if(!FTC_Image_Cache_Lookup(itsFt.imageCache, &font, index, &glyph))
++#endif
+         {
+             ok=true;
+ 
+@@ -2896,12 +2952,14 @@ bool CFontEngine::getGlyphBitmap(FTC_Ima
+                     *ptr=glyph;
+ 
+             if(ok)
+-                if(ft_glyph_format_bitmap==glyph->format)
++                if(ft_glyph_format_bitmap==glyph->format && ((FT_BitmapGlyph)glyph)->bitmap.buffer)
+                 {
+                     FT_BitmapGlyph bitmap=(FT_BitmapGlyph)glyph;
+                     FT_Bitmap      *source=&(bitmap->bitmap);
+ 
+-                    target.greys= (ft_pixel_mode_mono==(FT_Pixel_Mode_) source->pixel_mode) ? 1 : source->num_grays;
++                    target.greys=ft_pixel_mode_mono==(FT_Pixel_Mode_) source->pixel_mode ? 2 : source->num_grays;
++                    target.mono=ft_pixel_mode_mono==(FT_Pixel_Mode_) source->pixel_mode ? true : false;
++                    target.pitch=source->pitch;
+                     target.height=source->rows;
+                     target.width=source->width;
+                     target.buffer=source->buffer;
+@@ -2919,14 +2977,12 @@ bool CFontEngine::getGlyphBitmap(FTC_Ima
+ 
+ void CFontEngine::align32(Bitmap &bmp)
+ {
+-    int mod=bmp.width%4;
++    // Pitch = number of bytes per row of the bitmap. This needs to fall on a 32bit (4byte) boundary.
++    int padBytes=4-(bmp.pitch%4);
+ 
+-    if(mod)
++    if(padBytes<4)
+     {
+-        bmp.mod=4-mod;
+-
+-        int width=bmp.width+bmp.mod,
+-            size=(bmp.width+bmp.mod)*bmp.height,
++        int size=(bmp.pitch+padBytes)*bmp.height,
+             row;
+ 
+         if(size>itsFt.bufferSize)
+@@ -2939,20 +2995,23 @@ void CFontEngine::align32(Bitmap &bmp)
+             itsFt.buffer=new unsigned char [itsFt.bufferSize];
+         }
+ 
+-        memset(itsFt.buffer, 0, itsFt.bufferSize);
++        //memset(itsFt.buffer, 0, itsFt.bufferSize);
+         for(row=0; row<bmp.height; ++row)
+-            memcpy(&(itsFt.buffer[row*width]), &bmp.buffer[row*bmp.width], bmp.width);
++            memcpy(&(itsFt.buffer[row*(bmp.pitch+padBytes)]), &bmp.buffer[row*bmp.pitch], bmp.pitch);
+ 
+         bmp.buffer=itsFt.buffer;
+-        bmp.width+=bmp.mod;
+     }
+-    else
+-        bmp.mod=0;
+ }
+ 
+-bool CFontEngine::drawGlyph(QPixmap &pix, FTC_Image_Desc &font, FT_Size &size, int glyphNum,
++#if KFI_FT_IS_GE(2, 1, 8)
++bool CFontEngine::drawGlyph(QPixmap &pix, FTC_ImageTypeRec &font, int glyphNum,
++                            FT_F26Dot6 &x, FT_F26Dot6 &y, FT_F26Dot6 width, FT_F26Dot6 height,
++                            FT_F26Dot6 startX, FT_F26Dot6 stepY, int space)
++#else
++bool CFontEngine::drawGlyph(QPixmap &pix, FTC_Image_Desc &font, int glyphNum,
+                             FT_F26Dot6 &x, FT_F26Dot6 &y, FT_F26Dot6 width, FT_F26Dot6 height,
+                             FT_F26Dot6 startX, FT_F26Dot6 stepY, int space)
++#endif
+ {
+     int        left,
+                top,
+@@ -2962,45 +3021,38 @@ bool CFontEngine::drawGlyph(QPixmap &pix
+ 
+     if(getGlyphBitmap(font, glyphNum, bmp, left, top, xAdvance, &glyph) && bmp.width>0 && bmp.height>0)
+     {
+-        if(2==bmp.greys)
++        if(x+xAdvance+1>width)
+         {
+-            QPixmap glyphPix(QBitmap(bmp.width, bmp.height, bmp.buffer));
++            x=startX;
++            y+=stepY;
+ 
+-            bitBlt(&pix, x+left, y-top, &glyphPix, 0, 0, bmp.width, bmp.height, Qt::AndROP);
++            if(y>height)
++                return true;
+         }
+-        else
+-        {
+-            static QRgb clut[256];
+-            static bool clutSetup=false;
+ 
+-            if(!clutSetup)
+-            {
+-                int j;
+-                for(j=0; j<256; j++)
+-                    clut[j]=qRgb(255-j, 255-j, 255-j);
+-                clutSetup=true;
+-            }
++        static QRgb clut8[256];
++        static QRgb clut1[2]={ qRgb(255, 255, 255), qRgb(0, 0, 0) };



Home | Main Index | Thread Index | Old Index