rpms/openoffice.org/devel openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch, 1.1, 1.2

Caolan McNamara (caolanm) fedora-extras-commits at redhat.com
Wed Jan 23 14:11:01 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13784

Modified Files:
	openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch 
Log Message:
ah, rotate and *then* scale

openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch:

Index: openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch	23 Jan 2008 13:14:09 -0000	1.1
+++ openoffice.org-2.4.0.ooo85470.vcl.cairotext.patch	23 Jan 2008 14:10:52 -0000	1.2
@@ -1,4 +1,4 @@
-diff -ru vcl.precairo/inc/vcl/glyphcache.hxx vcl/inc/vcl/glyphcache.hxx
+diff -ru vcl/inc/vcl/glyphcache.hxx vcl/inc/vcl/glyphcache.hxx
 --- openoffice.org.orig/vcl/inc/vcl/glyphcache.hxx	2008-01-21 15:29:34.000000000 +0000
 +++ openoffice.org/vcl/inc/vcl/glyphcache.hxx	2008-01-23 12:49:48.000000000 +0000
 @@ -186,6 +186,10 @@
@@ -8,11 +8,11 @@
 +    virtual void*               GetFtFace() const { return 0; }
 +    virtual int                 GetLoadFlags() const { return 0; }
 +    virtual bool                NeedsArtificialBold() const { return false; }
-+    virtual bool                NeedsArtificialItalic() const { return false; }
++    virtual bool		        NeedsArtificialItalic() const { return false; }
  
      const ImplFontSelectData&   GetFontSelData() const      { return maFontSelData; }
  
-diff -ru vcl.precairo/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/gcach_ftyp.hxx
+diff -ru vcl/source/glyphs/gcach_ftyp.hxx vcl/source/glyphs/gcach_ftyp.hxx
 --- openoffice.org.orig/vcl/source/glyphs/gcach_ftyp.hxx	2008-01-21 15:29:27.000000000 +0000
 +++ openoffice.org/vcl/source/glyphs/gcach_ftyp.hxx	2008-01-23 12:50:19.000000000 +0000
 @@ -181,6 +181,10 @@
@@ -20,13 +20,13 @@
      virtual int                 GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); }
      virtual bool                TestFont() const;
 +    virtual void*               GetFtFace() const { return maFaceFT; }
-+    virtual int                 GetLoadFlags() const { return mnLoadFlags; }
++    virtual int               	GetLoadFlags() const { return mnLoadFlags; }
 +    virtual bool                NeedsArtificialBold() const { return mbArtBold; }
 +    virtual bool                NeedsArtificialItalic() const { return mbArtItalic; }
  
      virtual void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
  
-diff -ru vcl.precairo/unx/inc/salgdi.h vcl/unx/inc/salgdi.h
+diff -ru vcl/unx/inc/salgdi.h vcl/unx/inc/salgdi.h
 --- openoffice.org.orig/vcl/unx/inc/salgdi.h	2008-01-21 15:29:33.000000000 +0000
 +++ openoffice.org/vcl/unx/inc/salgdi.h	2008-01-22 14:19:55.000000000 +0000
 @@ -198,6 +198,7 @@
@@ -37,10 +37,10 @@
      
      void freeResources();
  public:
-diff -ru vcl.precairo/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salgdi3.cxx
+diff -ru vcl/unx/source/gdi/salgdi3.cxx vcl/unx/source/gdi/salgdi3.cxx
 --- openoffice.org.orig/vcl/unx/source/gdi/salgdi3.cxx	2008-01-21 15:29:33.000000000 +0000
-+++ openoffice.org/vcl/unx/source/gdi/salgdi3.cxx	2008-01-23 12:46:32.000000000 +0000
-@@ -123,6 +123,31 @@
++++ openoffice.org/vcl/unx/source/gdi/salgdi3.cxx	2008-01-23 13:57:09.000000000 +0000
+@@ -123,6 +123,32 @@
  
  #include <hash_set>
  
@@ -61,6 +61,7 @@
 +    double x;
 +    double y;
 +};
++#ifdef EMBOLDHACK
 +struct FcPattern;
 +typedef sal_Char FcChar8;
 +struct FcBlanks;
@@ -68,16 +69,16 @@
 +struct FcConfig;
 +enum FcResult { FcResultMatch, FcResultNoMatch };
 +enum FcMatchKind { FcMatchPattern, FcMatchFont, FcMatchScan };
-+
++#endif
  using namespace rtl;
  
  // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-@@ -734,6 +759,318 @@
+@@ -734,6 +760,347 @@
  }
  
  //--------------------------------------------------------------------------
 +namespace {
-+
++#ifdef EMBOLDHACK
 +class EmboldenWrapper
 +{
 +private:
@@ -109,6 +110,7 @@
 +    void FcPatternDestroy( FcPattern* pPattern )
 +    { mp_FcPatternDestroy( pPattern ); }
 +};
++#endif
 +
 +class CairoWrapper
 +{
@@ -122,16 +124,23 @@
 +    void (*mp_clip)(cairo_t*);
 +    void (*mp_rectangle)(cairo_t*, double, double, double, double);
 +    cairo_font_face_t * (*mp_ft_font_face_create_for_ft_face)(FT_Face, int);
++#ifdef EMBOLDHACK
 +    cairo_font_face_t * (*mp_ft_font_face_create_for_pattern)(FcPattern *);
++#endif
 +    void (*mp_set_font_face)(cairo_t *, cairo_font_face_t *);
 +    void (*mp_font_face_destroy)(cairo_font_face_t *);
-+    void (*mp_matrix_init_scale)(cairo_matrix_t *, double, double);
++    void (*mp_matrix_init_identity)(cairo_matrix_t *);
++    void (*mp_matrix_scale)(cairo_matrix_t *, double, double);
 +    void (*mp_matrix_rotate)(cairo_matrix_t *, double);
 +    void (*mp_set_font_matrix)(cairo_t *, const cairo_matrix_t *);
 +    void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int );
 +    void (*mp_set_source_rgb)(cairo_t *, double , double , double );
 +
++#ifdef EMBOLDHACK
++    bool canEmbolden() const { return EmboldenWrapper::get().isValid(); }
++#else
 +    bool canEmbolden() const { return false; }
++#endif
 +
 +    CairoWrapper();
 +public:
@@ -149,14 +158,18 @@
 +        { (*mp_rectangle)(cr, x, y, width, height); }
 +    cairo_font_face_t* ft_font_face_create_for_ft_face(FT_Face face, int load_flags)
 +        { return (*mp_ft_font_face_create_for_ft_face)(face, load_flags); }
++#ifdef EMBOLDHACK
 +    cairo_font_face_t* ft_font_face_create_for_pattern(FcPattern *pattern)
 +        { return (*mp_ft_font_face_create_for_pattern)(pattern); }
++#endif
 +    void set_font_face(cairo_t *cr, cairo_font_face_t *font_face)
 +        { (*mp_set_font_face)(cr, font_face); }
 +    void font_face_destroy(cairo_font_face_t *font_face)
 +        { (*mp_font_face_destroy)(font_face); }
-+    void matrix_init_scale(cairo_matrix_t *matrix, double sx, double sy)
-+        { (*mp_matrix_init_scale)(matrix, sx, sy); }
++    void matrix_init_identity(cairo_matrix_t *matrix)
++        { (*mp_matrix_init_identity)(matrix); }
++    void matrix_scale(cairo_matrix_t *matrix, double sx, double sy)
++        { (*mp_matrix_scale)(matrix, sx, sy); }
 +    void matrix_rotate(cairo_matrix_t *matrix, double radians)
 +        { (*mp_matrix_rotate)(matrix, radians); }
 +    void set_font_matrix(cairo_t *cr, const cairo_matrix_t *matrix)
@@ -167,6 +180,8 @@
 +        { (*mp_set_source_rgb)(cr, red, green, blue); }
 +};
 +
++#ifdef EMBOLDHACK
++
 +static EmboldenWrapper* pEmbInstance = NULL;
 +
 +EmboldenWrapper& EmboldenWrapper::get()
@@ -191,6 +206,7 @@
 +        osl_getAsciiFunctionSymbol(NULL, "FcFontMatch" );
 +    mp_FcPatternDestroy = (void (*)(FcPattern*))
 +        osl_getAsciiFunctionSymbol(NULL, "FcPatternDestroy" );
++
 +    mbIsValid = 
 +        (
 +            mp_FcFreeTypeQueryFace &&
@@ -207,6 +223,8 @@
 +#endif
 +    }
 +}
++#endif
++
 +static CairoWrapper* pCairoInstance = NULL;
 +
 +CairoWrapper& CairoWrapper::get()
@@ -218,8 +236,8 @@
 +
 +CairoWrapper::CairoWrapper() : mbIsValid(false)
 +{
-+    static const char* pDisableCairoText = getenv( "SAL_ENABLE_CAIROTEXT" );
-+    if( !pDisableCairoText || (pDisableCairoText[0] == '0') )
++    static const char* pEnableCairoText = getenv( "SAL_ENABLE_CAIROTEXT" );
++    if( !pEnableCairoText || (pEnableCairoText[0] == '0') )
 +        return;
 +
 +    mp_xlib_surface_create = (cairo_surface_t* (*)(Display *, Drawable , Visual *, int , int )) 
@@ -236,14 +254,18 @@
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_rectangle" );
 +    mp_ft_font_face_create_for_ft_face = (cairo_font_face_t * (*)(FT_Face, int))
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_ft_font_face_create_for_ft_face" );
++#ifdef EMBOLDHACK
 +    mp_ft_font_face_create_for_pattern = (cairo_font_face_t * (*)(FcPattern*))
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_ft_font_face_create_for_pattern" );
++#endif
 +    mp_set_font_face = (void (*)(cairo_t *, cairo_font_face_t *))
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_set_font_face" );
 +    mp_font_face_destroy = (void (*)(cairo_font_face_t *))
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_font_face_destroy" );
-+    mp_matrix_init_scale = (void (*)(cairo_matrix_t *, double, double))
-+        osl_getAsciiFunctionSymbol(NULL, "cairo_matrix_init_scale" );
++    mp_matrix_init_identity = (void (*)(cairo_matrix_t *))
++        osl_getAsciiFunctionSymbol(NULL, "cairo_matrix_init_identity" );
++    mp_matrix_scale = (void (*)(cairo_matrix_t *, double, double))
++        osl_getAsciiFunctionSymbol(NULL, "cairo_matrix_scale" );
 +    mp_matrix_rotate = (void (*)(cairo_matrix_t *, double))
 +        osl_getAsciiFunctionSymbol(NULL, "cairo_matrix_rotate" );
 +    mp_set_font_matrix = (void (*)(cairo_t *, const cairo_matrix_t *))
@@ -262,10 +284,13 @@
 +            mp_clip &&
 +            mp_rectangle &&
 +            mp_ft_font_face_create_for_ft_face &&
++#ifdef EMBOLDHACK
 +            mp_ft_font_face_create_for_pattern &&
++#endif
 +            mp_set_font_face &&
 +            mp_font_face_destroy &&
-+            mp_matrix_init_scale &&
++            mp_matrix_init_identity &&
++            mp_matrix_scale &&
 +            mp_matrix_rotate &&
 +            mp_set_font_matrix &&
 +            mp_show_glyphs &&
@@ -321,6 +346,7 @@
 +
 +    cairo_font_face_t* font_face;
 +
++#ifdef EMBOLDHACK
 +    if (rFont.NeedsArtificialBold())
 +    {
 +	/*
@@ -346,6 +372,7 @@
 +        rEmb.FcPatternDestroy(resolved);
 +    }
 +    else
++#endif
 +    {
 +        font_face = 
 +            rCairo.ft_font_face_create_for_ft_face((FT_Face)rFont.GetFtFace(), 
@@ -358,12 +385,15 @@
 +    const ImplFontSelectData& rFSD = rFont.GetFontSelData();
 +    int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight;
 +
-+    rCairo.matrix_init_scale(&m, nWidth, rFSD.mnHeight);
-+    if (rFont.NeedsArtificialItalic())
-+        m.xy = -m.xx * 0x6000L / 0x10000L;
++    rCairo.matrix_init_identity(&m);
 +
 +    if (rLayout.GetOrientation())
 +        rCairo.matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0);
++
++    rCairo.matrix_scale(&m, nWidth, rFSD.mnHeight);
++    if (rFont.NeedsArtificialItalic())
++        m.xy = -m.xx * 0x6000L / 0x10000L;
++
 +    rCairo.set_font_matrix(cr, &m);
 +
 +    std::vector<cairo_glyph_t> cairo_glyphs;
@@ -391,7 +421,7 @@
  
  void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout )
  {
-@@ -1111,15 +1448,20 @@
+@@ -1111,15 +1478,20 @@
      // draw complex text
      ServerFont& rFont = rLayout.GetServerFont();
  




More information about the fedora-extras-commits mailing list