rpms/openoffice.org/F-10 openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch, 1.23, 1.24 openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch, 1.2, 1.3 openoffice.org.spec, 1.1692, 1.1693

Caolan McNamara caolanm at fedoraproject.org
Tue Nov 18 12:17:25 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26178

Modified Files:
	openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch 
	openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch 
	openoffice.org.spec 
Log Message:
Resolves: rhbz#471103 improve font-settings

openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch:

Index: openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-10/openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch	19 Sep 2008 11:44:59 -0000	1.23
+++ openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch	18 Nov 2008 12:16:54 -0000	1.24
@@ -1,623 +1,165 @@
-Index: inc/psprint/fontmanager.hxx
+Index: inc/vcl/impfont.hxx
 ===================================================================
-RCS file: /cvs/gsl/psprint/inc/psprint/fontmanager.hxx,v
-retrieving revision 1.36
-diff -u -r1.36 fontmanager.hxx
---- openoffice.org.orig/psprint/inc/psprint/fontmanager.hxx	11 Apr 2008 10:09:55 -0000	1.36
-+++ openoffice.org/psprint/inc/psprint/fontmanager.hxx	30 May 2008 09:26:10 -0000
-@@ -142,6 +142,33 @@
+RCS file: /cvs/gsl/vcl/inc/vcl/impfont.hxx,v
+retrieving revision 1.3
+diff -u -r1.3 impfont.hxx
+--- openoffice.org.orig/vcl/inc/vcl/impfont.hxx	11 Apr 2008 07:39:29 -0000	1.3
++++ openoffice.org/vcl/inc/vcl/impfont.hxx	30 May 2008 09:28:28 -0000
+@@ -135,6 +135,42 @@
+     bool    operator==( const ImplFontMetric& ) const;
  };
- }
  
-+namespace fchint
-+{
-+enum type {
-+    Nohint = 0,
-+    Slight = 1,
-+    Medium = 2,
-+    Full = 3
-+};
-+}
++// ------------------
++// - ImplFontHints -
++// ------------------
 +
-+struct FontConfigHints
++class ImplFontHints
 +{
-+    fcstatus::type m_eEmbeddedbitmap;
-+    fcstatus::type m_eAntialias;
-+    fcstatus::type m_eAutoHint;
-+    fcstatus::type m_eHinting;
-+    fchint::type m_eHintStyle;
-+
-+    FontConfigHints() :
-+        m_eEmbeddedbitmap( fcstatus::isunset ),
-+        m_eAntialias( fcstatus::isunset ),
-+        m_eAutoHint( fcstatus::isunset ),
-+        m_eHinting( fcstatus::isunset ),
-+        m_eHintStyle( fchint::Full )
-+        {}
++public:
++    FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
++    FontAntiAlias      meAntiAlias;      // whether the font should be antialiased
++    FontAutoHint       meAutoHint;       // whether the font should be autohinted
++    FontHinting        meHinting;        // whether the font should be hinted
++    FontHintStyle      meHintStyle;      // type of font hinting to be used
++public:
++    ImplFontHints() :
++        meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), 
++        meAntiAlias(ANTIALIAS_DONTKNOW), 
++        meAutoHint(AUTOHINT_DONTKNOW), 
++        meHinting(HINTING_DONTKNOW), 
++        meHintStyle(HINT_SLIGHT)
++    {}
++    ImplFontHints(FontEmbeddedBitmap eEmbeddedBitmap, FontAntiAlias eAntiAlias, 
++        FontAutoHint eAutoHint, FontHinting eHinting, FontHintStyle eHintStyle) :
++        meEmbeddedBitmap(eEmbeddedBitmap), 
++        meAntiAlias(eAntiAlias), 
++        meAutoHint(eAutoHint), 
++        meHinting(eHinting), 
++        meHintStyle(eHintStyle)
++    {}
++    FontAutoHint GetUseAutoHint() const { return meAutoHint; }
++    FontHintStyle GetHintStyle() const { return meHintStyle; }
++    bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
++    bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
++    bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
 +};
 +
- /*
-  *  the difference between FastPrintFontInfo and PrintFontInfo
-  *  is that the information in FastPrintFontInfo can usually
-@@ -167,8 +194,6 @@
-     weight::type            			m_eWeight;
-     pitch::type             			m_ePitch;
-     rtl_TextEncoding        			m_aEncoding;
--    fcstatus::type                      m_eEmbeddedbitmap;
--    fcstatus::type                      m_eAntialias;
- 
-     FastPrintFontInfo() :
-             m_nID( 0 ),
-@@ -178,9 +203,7 @@
-             m_eWidth( width::Unknown ),
-             m_eWeight( weight::Unknown ),
-             m_ePitch( pitch::Unknown ),
--            m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
--            m_eEmbeddedbitmap( fcstatus::isunset ),
--            m_eAntialias( fcstatus::isunset )
-+            m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
-     {}
- };
- 
-@@ -297,9 +320,6 @@
-         bool										m_bHaveVerticalSubstitutedGlyphs;
-         bool                                        m_bUserOverride;
++
+ // -------------------
+ // - ImplFontCharMap -
+ // -------------------
+Index: inc/vcl/outdev.hxx
+===================================================================
+RCS file: /cvs/gsl/vcl/inc/vcl/outdev.hxx,v
+retrieving revision 1.6
+diff -u -r1.6 outdev.hxx
+--- openoffice.org.orig/vcl/inc/vcl/outdev.hxx	11 Apr 2008 07:47:31 -0000	1.6
++++ openoffice.org/vcl/inc/vcl/outdev.hxx	30 May 2008 09:28:33 -0000
+@@ -77,6 +77,8 @@
+ class FontCharMap;
+ class SalLayout;
+ class ImplLayoutArgs;
++class ImplFontHints;
++class ImplFontAttributes;
+ class VirtualDevice;
  
--        fcstatus::type                              m_eEmbeddedbitmap;
--        fcstatus::type                              m_eAntialias;
--
-         std::map< sal_Unicode, sal_Int32 >			m_aEncodingVector;
-         std::map< sal_Unicode, rtl::OString >		m_aNonEncoded;
+ namespace com {
+@@ -549,6 +551,7 @@
  
-@@ -742,6 +762,7 @@
-     false else
-      */
-     bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
-+    FontConfigHints getFontConfigHints(const FastPrintFontInfo& rInfo, int nSize);
+     SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
+     SAL_DLLPRIVATE static BOOL ImplIsUnderlineAbove( const Font& );
++    SAL_DLLPRIVATE void ImplGetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints) const;
+ //#endif
  
-     rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes, 
-         const rtl::OString& rLangAttrib, italic::type eItalic, weight::type eWeight, 
-Index: source/fontmanager/fontcache.cxx
+ protected:
+Index: inc/vcl/outfont.hxx
 ===================================================================
-RCS file: /cvs/gsl/psprint/source/fontmanager/fontcache.cxx,v
-retrieving revision 1.26
-diff -u -r1.26 fontcache.cxx
---- openoffice.org.orig/psprint/source/fontmanager/fontcache.cxx	11 Apr 2008 10:12:37 -0000	1.26
-+++ openoffice.org/psprint/source/fontmanager/fontcache.cxx	30 May 2008 09:26:12 -0000
-@@ -214,9 +214,9 @@
-                 aLine.Append( ';' );
-                 aLine.Append( (*it)->m_bUserOverride ? "1" : "0" );
-                 aLine.Append( ';' );
--                aLine.Append( ByteString::CreateFromInt32( (*it)->m_eEmbeddedbitmap ) );
-+                aLine.Append( ByteString::CreateFromInt32( 0 ) );
-                 aLine.Append( ';' );
--                aLine.Append( ByteString::CreateFromInt32( (*it)->m_eAntialias ) );
-+                aLine.Append( ByteString::CreateFromInt32( 0 ) );
+RCS file: /cvs/gsl/vcl/inc/vcl/outfont.hxx,v
+retrieving revision 1.6
+diff -u -r1.6 outfont.hxx
+--- openoffice.org.orig/vcl/inc/vcl/outfont.hxx	11 Apr 2008 07:48:01 -0000	1.6
++++ openoffice.org/vcl/inc/vcl/outfont.hxx	30 May 2008 09:28:33 -0000
+@@ -101,8 +101,6 @@
+     bool               IsDeviceFont() const      { return mbDevice; }
+     bool               IsEmbeddable() const      { return mbEmbeddable; }
+     bool               IsSubsettable() const     { return mbSubsettable; }
+-    FontEmbeddedBitmap UseEmbeddedBitmap() const { return meEmbeddedBitmap; }
+-    FontAntiAlias      UseAntiAlias() const      { return meAntiAlias; }
  
-                 switch( (*it)->m_eType )
-                 {
-@@ -426,9 +426,6 @@
-                                     = atoi( pLine + nTokenPos[14] );
-                 pFont->m_bUserOverride
-                                     = (atoi( pLine + nTokenPos[15] ) != 0);
--                pFont->m_eEmbeddedbitmap
--                                    = (fcstatus::type)atoi(pLine+nTokenPos[16]);
--                pFont->m_eAntialias = (fcstatus::type)atoi(pLine+nTokenPos[17]);
-                 int nStyleTokenNr = 18;
-                 switch( eType )
-                 {
-@@ -560,8 +557,6 @@
-     pTo->m_nYMax			= pFrom->m_nYMax;
-     pTo->m_bHaveVerticalSubstitutedGlyphs = pFrom->m_bHaveVerticalSubstitutedGlyphs;
-     pTo->m_bUserOverride    = pFrom->m_bUserOverride;
--    pTo->m_eEmbeddedbitmap  = pFrom->m_eEmbeddedbitmap;
--    pTo->m_eAntialias       = pFrom->m_eAntialias;
- }
+ public: // TODO: hide members behind accessor methods
+     String             maMapNames;       // List of family name aliass separated with ';'
+@@ -111,8 +109,6 @@
+     bool               mbDevice;         // true: built in font
+     bool               mbSubsettable;    // true: a subset of the font can be created
+     bool               mbEmbeddable;     // true: the font can be embedded
+-    FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
+-    FontAntiAlias      meAntiAlias;      // whether the font should be antialiased
+ };
  
- /*
-@@ -623,9 +618,7 @@
-         pRight->m_nXMax				!= pLeft->m_nXMax			||
-         pRight->m_nYMax				!= pLeft->m_nYMax			||
-         pRight->m_bHaveVerticalSubstitutedGlyphs != pLeft->m_bHaveVerticalSubstitutedGlyphs ||
--        pRight->m_bUserOverride     != pLeft->m_bUserOverride   ||
--        pRight->m_eEmbeddedbitmap   != pLeft->m_eEmbeddedbitmap ||
--        pRight->m_eAntialias        != pLeft->m_eAntialias
-+        pRight->m_bUserOverride     != pLeft->m_bUserOverride
-         )
-         return false;
-     std::list< int >::const_iterator lit, rit;
-Index: source/fontmanager/fontconfig.cxx
+ // ----------------
+Index: inc/vcl/salgdi.hxx
 ===================================================================
-RCS file: /cvs/gsl/psprint/source/fontmanager/fontconfig.cxx,v
-retrieving revision 1.30
-diff -u -r1.30 fontconfig.cxx
---- openoffice.org.orig/psprint/source/fontmanager/fontconfig.cxx	11 Apr 2008 10:12:55 -0000	1.30
-+++ openoffiec.org/psprint/source/fontmanager/fontconfig.cxx	30 May 2008 09:26:12 -0000
-@@ -122,6 +122,7 @@
-     FcBool			(*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
-     FcBool			(*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
-     FcBool			(*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
-+    FcBool                    (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
-     FcBool                    (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
-     FcBool                    (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
-     FcBool			(*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
-@@ -169,7 +170,7 @@
- 
-     void FcPatternDestroy( FcPattern* pPattern )
-     { m_pFcPatternDestroy( pPattern ); }
--    
+RCS file: /cvs/gsl/vcl/inc/vcl/salgdi.hxx,v
+retrieving revision 1.5
+diff -u -r1.5 salgdi.hxx
+--- openoffice.org.orig/vcl/inc/vcl/salgdi.hxx	11 Apr 2008 07:53:59 -0000	1.5
++++ openoffice.org/vcl/inc/vcl/salgdi.hxx	30 May 2008 09:28:35 -0000
+@@ -223,6 +223,8 @@
+     void                   ReleaseFonts() { SetFont( NULL, 0 ); }
+     // get the current font's metrics
+     virtual void			GetFontMetric( ImplFontMetricData* ) = 0;
++    virtual void 			GetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints) const = 0;
 +
-     FcFontSet* FcFontList( FcConfig* pConfig, FcPattern* pPattern, FcObjectSet* pSet )
-     { return m_pFcFontList( pConfig, pPattern, pSet ); }
- 
-@@ -226,6 +227,8 @@
-     { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
-     FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
-     { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
-+    FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
-+    { return m_pFcPatternAddDouble( pPattern, pObject, nValue ); }
-     FcBool FcPatternAddString( FcPattern* pPattern, const char* pObject, const FcChar8* pString )
-     { return m_pFcPatternAddString( pPattern, pObject, pString ); }
-     FcBool FcPatternAddBool( FcPattern* pPattern, const char* pObject, bool nValue )
-@@ -237,7 +240,9 @@
-     { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
+     // get kernign pairs of the current font
+     // return only PairCount if (pKernPairs == NULL)
+     virtual ULONG			GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) = 0;
+Index: inc/vcl/vclenum.hxx
+===================================================================
+RCS file: /cvs/gsl/vcl/inc/vcl/vclenum.hxx,v
+retrieving revision 1.5
+diff -u -r1.5 vclenum.hxx
+--- openoffice.org.orig/vcl/inc/vcl/vclenum.hxx	11 Apr 2008 08:07:45 -0000	1.5
++++ openoffice.org/vcl/inc/vcl/vclenum.hxx	30 May 2008 09:28:42 -0000
+@@ -284,6 +284,27 @@
  
- public: // TODO: cleanup
--    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontconfigNameToLocalized;
-+    FcResult FamilyFromPattern(FcPattern* pPattern, FcChar8 **family);
-+    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontNameToLocalized;
-+    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aLocalizedToCanonical;
- };
+ #endif
  
- oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol )
-@@ -327,6 +332,8 @@
-         loadSymbol( "FcConfigSubstitute" );
-     m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
-         loadSymbol( "FcPatternAddInteger" );
-+    m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
-+        loadSymbol( "FcPatternAddDouble" );
-     m_pFcPatternAddBool = (FcBool(*)(FcPattern*,const char*,FcBool))
-         loadSymbol( "FcPatternAddBool" );
-     m_pFcPatternAddCharSet = (FcBool(*)(FcPattern*,const char*,const FcCharSet *))
-@@ -364,6 +371,7 @@
-             m_pFcDefaultSubstitute			&&
-             m_pFcConfigSubstitute			&&
-             m_pFcPatternAddInteger			&&
-+            m_pFcPatternAddDouble                     &&
-             m_pFcPatternAddCharSet			&&
-             m_pFcPatternAddBool 			&&
-             m_pFcPatternAddString
-@@ -498,54 +506,53 @@
- 
-         return candidate;
-     }
-+}
- 
--
--    FcResult lcl_FamilyFromPattern(FontCfgWrapper& rWrapper, FcPattern* pPattern, FcChar8 **family, 
--        std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > &aFontconfigNameToLocalized)
-+FcResult FontCfgWrapper::FamilyFromPattern(FcPattern* pPattern, FcChar8 **family)
-+{
-+    FcChar8 *origfamily;
-+    FcResult eFamilyRes	= FcPatternGetString( pPattern, FC_FAMILY, 0, &origfamily );
-+    *family = origfamily;
-+    
-+    if( eFamilyRes == FcResultMatch)
-     {
--        FcChar8 *origfamily;
--        FcResult eFamilyRes	= rWrapper.FcPatternGetString( pPattern, FC_FAMILY, 0, &origfamily );
--        *family = origfamily;
--        
--        if( eFamilyRes == FcResultMatch)
-+        FcChar8* familylang = NULL;
-+        if (FcPatternGetString( pPattern, FC_FAMILYLANG, 0, &familylang ) == FcResultMatch)
-         {
--            FcChar8* familylang = NULL;
--            if (rWrapper.FcPatternGetString( pPattern, FC_FAMILYLANG, 0, &familylang ) == FcResultMatch)
-+            std::vector< lang_and_family > lang_and_families;
-+            lang_and_families.push_back(lang_and_family(familylang, *family));
-+            int k = 1;
-+            while (1)
-             {
--                std::vector< lang_and_family > lang_and_families;
-+                if (FcPatternGetString( pPattern, FC_FAMILYLANG, k, &familylang ) != FcResultMatch)
-+                    break;
-+                if (FcPatternGetString( pPattern, FC_FAMILY, k, family ) != FcResultMatch)
-+                    break;
-                 lang_and_families.push_back(lang_and_family(familylang, *family));
--                int k = 1;
--                while (1)
--                {
--                    if (rWrapper.FcPatternGetString( pPattern, FC_FAMILYLANG, k, &familylang ) != FcResultMatch)
--                        break;
--                    if (rWrapper.FcPatternGetString( pPattern, FC_FAMILY, k, family ) != FcResultMatch)
--                        break;
--                    lang_and_families.push_back(lang_and_family(familylang, *family));
--                    ++k;
--                }
--                
--                //possible to-do, sort by UILocale instead of process locale
--                rtl_Locale* pLoc;
--                osl_getProcessLocale(&pLoc);
--                localizedsorter aSorter(pLoc);
--                *family = aSorter.bestname(lang_and_families);
--                
--                std::vector<lang_and_family>::const_iterator aEnd = lang_and_families.end();
--                for (std::vector<lang_and_family>::const_iterator aIter = lang_and_families.begin(); aIter != aEnd; ++aIter)
--                {
--                    const char *candidate = (const char*)(aIter->second);
--                    if (rtl_str_compare(candidate, (const char*)(*family)) != 0)
--                        aFontconfigNameToLocalized[OString(candidate)] = OString((const char*)(*family));
--                }
-+                ++k;
-+            }
-+            
-+            //possible to-do, sort by UILocale instead of process locale
-+            rtl_Locale* pLoc;
-+            osl_getProcessLocale(&pLoc);
-+            localizedsorter aSorter(pLoc);
-+            *family = aSorter.bestname(lang_and_families);
-+            
-+            std::vector<lang_and_family>::const_iterator aEnd = lang_and_families.end();
-+            for (std::vector<lang_and_family>::const_iterator aIter = lang_and_families.begin(); aIter != aEnd; ++aIter)
-+            {
-+                const char *candidate = (const char*)(aIter->second);
-+                if (rtl_str_compare(candidate, (const char*)(*family)) != 0)
-+                    m_aFontNameToLocalized[OString(candidate)] = OString((const char*)(*family));
-             }
-+            if (rtl_str_compare((const char*)origfamily, (const char*)(*family)) != 0)
-+                m_aLocalizedToCanonical[OString((const char*)(*family))] = OString((const char*)origfamily);
-         }
--        
--        return eFamilyRes;
-     }
-+    
-+    return eFamilyRes;
- }
- 
--
- /*
-  * PrintFontManager::initFontconfig
-  */
-@@ -580,18 +587,16 @@
-             int weight = 0;
-             int spacing = 0;
-             int nCollectionEntry = -1;
--            FcBool outline = false, embitmap = true, antialias = true;
-+            FcBool outline = false;
-             
-             FcResult eFileRes	      = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_FILE, 0, &file );
--            FcResult eFamilyRes       = lcl_FamilyFromPattern(rWrapper, pFSet->fonts[i], &family, rWrapper.m_aFontconfigNameToLocalized );
-+            FcResult eFamilyRes       = rWrapper.FamilyFromPattern( pFSet->fonts[i], &family );
-             FcResult eStyleRes	      = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_STYLE, 0, &style );
-             FcResult eSlantRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant );
-             FcResult eWeightRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight );
-             FcResult eSpacRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing );
-             FcResult eOutRes	      = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline );
-             FcResult eIndexRes        = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry );
--            FcResult eEmbeddedBitmap  = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_EMBEDDED_BITMAP, 0, &embitmap );
--            FcResult eAntialias       = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_ANTIALIAS, 0, &antialias );
-             
-             if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch )
-                 continue;
-@@ -731,15 +736,6 @@
-                 {
-                     pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 );
-                 }
--                if( eEmbeddedBitmap == FcResultMatch )
--                {
--                  pUpdate->m_eEmbeddedbitmap = embitmap ? fcstatus::istrue : fcstatus::isfalse;
--                }
--                if( eAntialias == FcResultMatch )
--                {
--                  pUpdate->m_eAntialias = antialias ? fcstatus::istrue : fcstatus::isfalse;
--                }
--
-                 
-                 // update font cache
-                 m_pFontCache->updateFontCacheEntry( pUpdate, false );
-@@ -943,8 +939,8 @@
-             if( eFileRes == FcResultMatch )
-             {
-                 OString sFamily((sal_Char*)family);
--                std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontconfigNameToLocalized.find(sFamily);
--                if (aI != rWrapper.m_aFontconfigNameToLocalized.end())
-+                std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontNameToLocalized.find(sFamily);
-+                if (aI != rWrapper.m_aFontNameToLocalized.end())
-                     sFamily = aI->second;
-                 aName = rtl::OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 );
-             }
-@@ -975,6 +971,78 @@
-     return aName;
- }
- 
-+FontConfigHints PrintFontManager::getFontConfigHints( const FastPrintFontInfo& rInfo, int nSize)
-+{
-+    FontConfigHints aHints;
-+#ifdef ENABLE_FONTCONFIG
-+    FontCfgWrapper& rWrapper = FontCfgWrapper::get();
-+    if( ! rWrapper.isValid() )
-+        return aHints;
-+
-+    FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
-+    FcPattern* pPattern = rWrapper.FcPatternCreate();
++#ifndef ENUM_FONTAUTOHINT_DECLARED
++#define ENUM_FONTAUTOHINT_DECLARED
 +
-+    OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
++enum FontAutoHint { AUTOHINT_DONTKNOW, AUTOHINT_FALSE, AUTOHINT_TRUE };
 +
-+    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aLocalizedToCanonical.find(sFamily);
-+    if (aI != rWrapper.m_aLocalizedToCanonical.end())
-+        sFamily = aI->second;
-+    if( sFamily.getLength() )
-+        rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() );
++#endif
 +
-+    addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
++#ifndef ENUM_FONTHINTING_DECLARED
++#define ENUM_FONTHINTING_DECLARED
 +
-+    rWrapper.FcPatternAddDouble( pPattern, FC_PIXEL_SIZE, nSize);
++enum FontHinting { HINTING_DONTKNOW, HINTING_FALSE, HINTING_TRUE };
 +
-+    OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
++#endif
 +
-+    FcBool embitmap = true, antialias = true, autohint = true, hinting = true;
-+    int hintstyle = FC_HINT_FULL, rgba = FC_RGBA_UNKNOWN;
++#ifndef ENUM_FONTHINTSTYLE_DECLARED
++#define ENUM_FONTHINTSTYLE_DECLARED
 +
-+    rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchFont );
++enum FontHintStyle { HINT_NONE, HINT_SLIGHT, HINT_MEDIUM, HINT_FULL };
 +
-+    rWrapper.FcDefaultSubstitute( pPattern );
-+    FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool( pPattern, FC_EMBEDDED_BITMAP, 0, &embitmap );
-+    FcResult eAntialias = rWrapper.FcPatternGetBool( pPattern, FC_ANTIALIAS, 0, &antialias );
-+    FcResult eAutoHint = rWrapper.FcPatternGetBool( pPattern, FC_AUTOHINT, 0, &autohint );
-+    FcResult eHinting = rWrapper.FcPatternGetBool( pPattern, FC_HINTING, 0, &hinting );
-+
-+    FcResult eHintStyle = rWrapper.FcPatternGetInteger( pPattern, FC_HINT_STYLE, 0, &hintstyle );
-+    rWrapper.FcPatternDestroy(pPattern);
-+ 
-+    if( eEmbeddedBitmap == FcResultMatch )
-+        aHints.m_eEmbeddedbitmap = embitmap ? fcstatus::istrue : fcstatus::isfalse;
-+    if( eAntialias == FcResultMatch )
-+        aHints.m_eAntialias = antialias ? fcstatus::istrue : fcstatus::isfalse;
-+    if( eAutoHint == FcResultMatch )
-+        aHints.m_eAutoHint = autohint ? fcstatus::istrue : fcstatus::isfalse;
-+    if( eHinting == FcResultMatch )
-+        aHints.m_eHinting = hinting ? fcstatus::istrue : fcstatus::isfalse;
-+    if (eHintStyle != FcResultMatch)
-+        aHints.m_eHintStyle = fchint::Full;
-+    else
-+    {
-+        switch (hintstyle)
-+        {
-+            case FC_HINT_NONE:
-+                aHints.m_eHintStyle = fchint::Nohint;
-+                break;
-+            case FC_HINT_SLIGHT:
-+                aHints.m_eHintStyle = fchint::Slight;
-+                break;
-+            case FC_HINT_MEDIUM:
-+                aHints.m_eHintStyle = fchint::Medium;
-+                break;
-+            case FC_HINT_FULL:
-+            default:
-+                aHints.m_eHintStyle = fchint::Full;
-+                break;
-+        }
-+    }
 +#endif
-+    return aHints;
-+}
-+
- bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale )
- {
-     FontCfgWrapper& rWrapper = FontCfgWrapper::get();
-@@ -1000,9 +1068,10 @@
-     if( aLangAttrib.getLength() )
-         rWrapper.FcPatternAddString( pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr() );
- 
--    OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
--    if( aFamily.getLength() )
--        rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr() );
-+    OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
 +
-+    if( sFamily.getLength() )
-+        rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() );
- 
-     addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
+ // ------------------------------------------------------------
  
-Index: source/fontmanager/fontmanager.cxx
+ #ifndef ENUM_KEYFUNCTYPE_DECLARED
+Index: source/gdi/outdev3.cxx
 ===================================================================
-RCS file: /cvs/gsl/psprint/source/fontmanager/fontmanager.cxx,v
-retrieving revision 1.81
-diff -u -r1.81 fontmanager.cxx
---- openoffice.org.org/psprint/source/fontmanager/fontmanager.cxx	11 Apr 2008 10:13:15 -0000	1.81
-+++ openoffice.org/psprint/source/fontmanager/fontmanager.cxx	30 May 2008 09:26:15 -0000
-@@ -355,9 +355,7 @@
-         m_nXMax( 0 ),
-         m_nYMax( 0 ),
-         m_bHaveVerticalSubstitutedGlyphs( false ),
--        m_bUserOverride( false ),
--        m_eEmbeddedbitmap( fcstatus::isunset ),
--        m_eAntialias( fcstatus::isunset )
-+        m_bUserOverride( false )
- {
- }
+RCS file: /cvs/gsl/vcl/source/gdi/outdev3.cxx,v
+retrieving revision 1.240
+diff -u -r1.240 outdev3.cxx
+--- openoffice.org.orig/vcl/source/gdi/outdev3.cxx	11 Apr 2008 08:49:58 -0000	1.240
++++ openoffice.org/vcl/source/gdi/outdev3.cxx	30 May 2008 09:29:42 -0000
+@@ -7332,6 +7332,14 @@
  
-@@ -2731,8 +2729,6 @@
-     rInfo.m_eWeight         = pFont->m_eWeight;
-     rInfo.m_ePitch          = pFont->m_ePitch;
-     rInfo.m_aEncoding       = pFont->m_aEncoding;
--    rInfo.m_eEmbeddedbitmap = pFont->m_eEmbeddedbitmap;
--    rInfo.m_eAntialias      = pFont->m_eAntialias;
-     rInfo.m_aAliases.clear();
-     for( ::std::list< int >::iterator it = pFont->m_aAliases.begin(); it != pFont->m_aAliases.end(); ++it )
-         rInfo.m_aAliases.push_back( m_pAtoms->getString( ATOM_FAMILYNAME, *it ) );
-@@ -3976,8 +3972,6 @@
-         BuiltinFont* pFont = new BuiltinFont();
-         pFont->m_nDirectory = 0;
-         pFont->m_bUserOverride = false;
--        pFont->m_eEmbeddedbitmap = fcstatus::isunset;
--        pFont->m_eAntialias = fcstatus::isunset;
-         pFont->m_pMetrics = new PrintFontMetrics;
-         memset( pFont->m_pMetrics->m_aPages, 0xff, sizeof( pFont->m_pMetrics->m_aPages ) );
-         pFont->m_pMetrics->m_bKernPairsQueried = true;
-Index: inc/vcl/impfont.hxx
-===================================================================
-RCS file: /cvs/gsl/vcl/inc/vcl/impfont.hxx,v
-retrieving revision 1.3
-diff -u -r1.3 impfont.hxx
---- openoffice.org.orig/vcl/inc/vcl/impfont.hxx	11 Apr 2008 07:39:29 -0000	1.3
-+++ openoffice.org/vcl/inc/vcl/impfont.hxx	30 May 2008 09:28:28 -0000
-@@ -135,6 +135,42 @@
-     bool    operator==( const ImplFontMetric& ) const;
- };
+ // -----------------------------------------------------------------------
  
-+// ------------------
-+// - ImplFontHints -
-+// ------------------
-+
-+class ImplFontHints
-+{
-+public:
-+    FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
-+    FontAntiAlias      meAntiAlias;      // whether the font should be antialiased
-+    FontAutoHint       meAutoHint;       // whether the font should be autohinted
-+    FontHinting        meHinting;        // whether the font should be hinted
-+    FontHintStyle      meHintStyle;      // type of font hinting to be used
-+public:
-+    ImplFontHints() :
-+        meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), 
-+        meAntiAlias(ANTIALIAS_DONTKNOW), 
-+        meAutoHint(AUTOHINT_DONTKNOW), 
-+        meHinting(HINTING_DONTKNOW), 
-+        meHintStyle(HINT_FULL)
-+    {}
-+    ImplFontHints(FontEmbeddedBitmap eEmbeddedBitmap, FontAntiAlias eAntiAlias, 
-+        FontAutoHint eAutoHint, FontHinting eHinting, FontHintStyle eHintStyle) :
-+        meEmbeddedBitmap(eEmbeddedBitmap), 
-+        meAntiAlias(eAntiAlias), 
-+        meAutoHint(eAutoHint), 
-+        meHinting(eHinting), 
-+        meHintStyle(eHintStyle)
-+    {}
-+    FontAutoHint GetUseAutoHint() const { return meAutoHint; }
-+    FontHintStyle GetHintStyle() const { return meHintStyle; }
-+    bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
-+    bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
-+    bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
-+};
-+
-+
- // -------------------
- // - ImplFontCharMap -
- // -------------------
-Index: inc/vcl/outdev.hxx
-===================================================================
-RCS file: /cvs/gsl/vcl/inc/vcl/outdev.hxx,v
-retrieving revision 1.6
-diff -u -r1.6 outdev.hxx
---- openoffice.org.orig/vcl/inc/vcl/outdev.hxx	11 Apr 2008 07:47:31 -0000	1.6
-+++ openoffice.org/vcl/inc/vcl/outdev.hxx	30 May 2008 09:28:33 -0000
-@@ -77,6 +77,8 @@
- class FontCharMap;
- class SalLayout;
- class ImplLayoutArgs;
-+class ImplFontHints;
-+class ImplFontAttributes;
- class VirtualDevice;
- 
- namespace com {
-@@ -549,6 +551,7 @@
- 
-     SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
-     SAL_DLLPRIVATE static BOOL ImplIsUnderlineAbove( const Font& );
-+    SAL_DLLPRIVATE void ImplGetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints) const;
- //#endif
- 
- protected:
-Index: inc/vcl/outfont.hxx
-===================================================================
-RCS file: /cvs/gsl/vcl/inc/vcl/outfont.hxx,v
-retrieving revision 1.6
-diff -u -r1.6 outfont.hxx
---- openoffice.org.orig/vcl/inc/vcl/outfont.hxx	11 Apr 2008 07:48:01 -0000	1.6
-+++ openoffice.org/vcl/inc/vcl/outfont.hxx	30 May 2008 09:28:33 -0000
-@@ -101,8 +101,6 @@
-     bool               IsDeviceFont() const      { return mbDevice; }
-     bool               IsEmbeddable() const      { return mbEmbeddable; }
-     bool               IsSubsettable() const     { return mbSubsettable; }
--    FontEmbeddedBitmap UseEmbeddedBitmap() const { return meEmbeddedBitmap; }
--    FontAntiAlias      UseAntiAlias() const      { return meAntiAlias; }
- 
- public: // TODO: hide members behind accessor methods
-     String             maMapNames;       // List of family name aliass separated with ';'
-@@ -111,8 +109,6 @@
-     bool               mbDevice;         // true: built in font
-     bool               mbSubsettable;    // true: a subset of the font can be created
-     bool               mbEmbeddable;     // true: the font can be embedded
--    FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
--    FontAntiAlias      meAntiAlias;      // whether the font should be antialiased
- };
- 
- // ----------------
-Index: inc/vcl/salgdi.hxx
-===================================================================
-RCS file: /cvs/gsl/vcl/inc/vcl/salgdi.hxx,v
-retrieving revision 1.5
-diff -u -r1.5 salgdi.hxx
---- openoffice.org.orig/vcl/inc/vcl/salgdi.hxx	11 Apr 2008 07:53:59 -0000	1.5
-+++ openoffice.org/vcl/inc/vcl/salgdi.hxx	30 May 2008 09:28:35 -0000
-@@ -223,6 +223,8 @@
-     void                   ReleaseFonts() { SetFont( NULL, 0 ); }
-     // get the current font's metrics
-     virtual void			GetFontMetric( ImplFontMetricData* ) = 0;
-+    virtual void 			GetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints) const = 0;
-+
-     // get kernign pairs of the current font
-     // return only PairCount if (pKernPairs == NULL)
-     virtual ULONG			GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) = 0;
-Index: inc/vcl/vclenum.hxx
-===================================================================
-RCS file: /cvs/gsl/vcl/inc/vcl/vclenum.hxx,v
-retrieving revision 1.5
-diff -u -r1.5 vclenum.hxx
---- openoffice.org.orig/vcl/inc/vcl/vclenum.hxx	11 Apr 2008 08:07:45 -0000	1.5
-+++ openoffice.org/vcl/inc/vcl/vclenum.hxx	30 May 2008 09:28:42 -0000
-@@ -284,6 +284,27 @@
- 
- #endif
- 
-+#ifndef ENUM_FONTAUTOHINT_DECLARED
-+#define ENUM_FONTAUTOHINT_DECLARED
-+
-+enum FontAutoHint { AUTOHINT_DONTKNOW, AUTOHINT_FALSE, AUTOHINT_TRUE };
-+
-+#endif
-+
-+#ifndef ENUM_FONTHINTING_DECLARED
-+#define ENUM_FONTHINTING_DECLARED
-+
-+enum FontHinting { HINTING_DONTKNOW, HINTING_FALSE, HINTING_TRUE };
-+
-+#endif
-+
-+#ifndef ENUM_FONTHINTSTYLE_DECLARED
-+#define ENUM_FONTHINTSTYLE_DECLARED
-+
-+enum FontHintStyle { HINT_NONE, HINT_SLIGHT, HINT_MEDIUM, HINT_FULL };
-+
-+#endif
-+
- // ------------------------------------------------------------
- 
- #ifndef ENUM_KEYFUNCTYPE_DECLARED
-Index: source/gdi/outdev3.cxx
-===================================================================
-RCS file: /cvs/gsl/vcl/source/gdi/outdev3.cxx,v
-retrieving revision 1.240
-diff -u -r1.240 outdev3.cxx
---- openoffice.org.orig/vcl/source/gdi/outdev3.cxx	11 Apr 2008 08:49:58 -0000	1.240
-+++ openoffice.org/vcl/source/gdi/outdev3.cxx	30 May 2008 09:29:42 -0000
-@@ -7332,6 +7332,14 @@
- 
- // -----------------------------------------------------------------------
- 
-+void OutputDevice::ImplGetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints &rHints) const
++void OutputDevice::ImplGetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints &rHints) const
 +{
 +    if ( mpGraphics )
 +        mpGraphics->GetFontHints( rFontAttributes, nSize, rHints );
@@ -1002,10 +544,57 @@
 diff -u -r1.154 salgdi3.cxx
 --- openoffice.org.orig/vcl/unx/source/gdi/salgdi3.cxx	11 Apr 2008 09:55:12 -0000	1.154
 +++ openoffice.org/vcl/unx/source/gdi/salgdi3.cxx	30 May 2008 09:31:13 -0000
-@@ -1612,6 +1612,174 @@
+@@ -739,6 +739,7 @@
+     void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int );
+     void (*mp_set_source_rgb)(cairo_t *, double , double , double );
+     void (*mp_set_font_options)(cairo_t *, const void *);
++    void (*mp_ft_font_options_substitute)(const void*, void*);
+ 
+     bool canEmbolden() const { return false; }
+ 
+@@ -776,6 +777,8 @@
+         { (*mp_set_source_rgb)(cr, red, green, blue); }
+     void set_font_options(cairo_t *cr, const void *options)
+         { (*mp_set_font_options)(cr, options); }
++    void ft_font_options_substitute(const void *options, void *pattern)
++        { (*mp_ft_font_options_substitute)(options, pattern); }
+ };
+ 
+ static CairoWrapper* pCairoInstance = NULL;
+@@ -843,6 +846,8 @@
+         osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_source_rgb" );
+     mp_set_font_options = (void (*)(cairo_t *, const void *options ))
+         osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_options" );
++    mp_ft_font_options_substitute = (void (*)(const void *, void *))
++        osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_options_substitute" );
+ 
+     if( !( 
+             mp_xlib_surface_create_with_xrender_format &&
+@@ -860,7 +865,8 @@
+             mp_set_font_matrix &&
+             mp_show_glyphs &&
+             mp_set_source_rgb &&
+-            mp_set_font_options
++            mp_set_font_options &&
++            mp_ft_font_options_substitute
+         ) )
+     {
+         osl_unloadModule( mpCairoLib );
+@@ -1629,6 +1635,187 @@
  
  // ----------------------------------------------------------------------------
  
++void cairosubcallback(void *pPattern)
++{
++    CairoWrapper &rCairo = CairoWrapper::get();
++    if (rCairo.isValid())
++    {
++        rCairo.ft_font_options_substitute(
++            Application::GetSettings().GetStyleSettings().GetCairoFontOptions(),
++            pPattern);
++    }
++}
++
 +void X11SalGraphics::GetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints) const
 +{
 +    psp::FastPrintFontInfo aInfo;
@@ -1027,205 +616,662 @@
 +            aInfo.m_eItalic = psp::italic::Unknown;
 +            break;
 +
-+    }
-+    // set weight
-+    switch( rFontAttributes.GetWeight() )
-+    {
-+        case WEIGHT_THIN:
-+            aInfo.m_eWeight = psp::weight::Thin;
-+            break;
-+        case WEIGHT_ULTRALIGHT:
-+            aInfo.m_eWeight = psp::weight::UltraLight;
-+            break;
-+        case WEIGHT_LIGHT:
-+            aInfo.m_eWeight = psp::weight::Light;
-+            break;
-+        case WEIGHT_SEMILIGHT:
-+            aInfo.m_eWeight = psp::weight::SemiLight;
-+            break;
-+        case WEIGHT_NORMAL:
-+            aInfo.m_eWeight = psp::weight::Normal;
-+            break;
-+        case WEIGHT_MEDIUM:
-+            aInfo.m_eWeight = psp::weight::Medium;
-+            break;
-+        case WEIGHT_SEMIBOLD:
-+            aInfo.m_eWeight = psp::weight::SemiBold;
-+            break;
-+        case WEIGHT_BOLD:
-+            aInfo.m_eWeight = psp::weight::Bold;
-+            break;
-+        case WEIGHT_ULTRABOLD:
-+            aInfo.m_eWeight = psp::weight::UltraBold;
-+            break;
-+        case WEIGHT_BLACK:
-+            aInfo.m_eWeight = psp::weight::Black;
-+            break;
-+        default:
-+            aInfo.m_eWeight = psp::weight::Unknown;
-+            break;
-+    }
-+    // set width
-+    switch( rFontAttributes.GetWidthType() )
-+    {
-+        case WIDTH_ULTRA_CONDENSED:
-+            aInfo.m_eWidth = psp::width::UltraCondensed;
-+            break;
-+        case WIDTH_EXTRA_CONDENSED:
-+            aInfo.m_eWidth = psp::width::ExtraCondensed;
-+            break;
-+        case WIDTH_CONDENSED:
-+            aInfo.m_eWidth = psp::width::Condensed;
-+            break;
-+        case WIDTH_SEMI_CONDENSED:
-+            aInfo.m_eWidth = psp::width::SemiCondensed;
-+            break;
-+        case WIDTH_NORMAL:
-+            aInfo.m_eWidth = psp::width::Normal;
-+            break;
-+        case WIDTH_SEMI_EXPANDED:
-+            aInfo.m_eWidth = psp::width::SemiExpanded;
-+            break;
-+        case WIDTH_EXPANDED:
-+            aInfo.m_eWidth = psp::width::Expanded;
-+            break;
-+        case WIDTH_EXTRA_EXPANDED:
-+            aInfo.m_eWidth = psp::width::ExtraExpanded;
-+            break;
-+        case WIDTH_ULTRA_EXPANDED:
-+            aInfo.m_eWidth = psp::width::UltraExpanded;
-+            break;
-+        default:
-+            aInfo.m_eWidth = psp::width::Unknown;
-+            break;
-+    }
++    }
++    // set weight
++    switch( rFontAttributes.GetWeight() )
++    {
++        case WEIGHT_THIN:
++            aInfo.m_eWeight = psp::weight::Thin;
++            break;
++        case WEIGHT_ULTRALIGHT:
++            aInfo.m_eWeight = psp::weight::UltraLight;
++            break;
++        case WEIGHT_LIGHT:
++            aInfo.m_eWeight = psp::weight::Light;
++            break;
++        case WEIGHT_SEMILIGHT:
++            aInfo.m_eWeight = psp::weight::SemiLight;
++            break;
++        case WEIGHT_NORMAL:
++            aInfo.m_eWeight = psp::weight::Normal;
++            break;
++        case WEIGHT_MEDIUM:
++            aInfo.m_eWeight = psp::weight::Medium;
++            break;
++        case WEIGHT_SEMIBOLD:
++            aInfo.m_eWeight = psp::weight::SemiBold;
++            break;
++        case WEIGHT_BOLD:
++            aInfo.m_eWeight = psp::weight::Bold;
++            break;
++        case WEIGHT_ULTRABOLD:
++            aInfo.m_eWeight = psp::weight::UltraBold;
++            break;
++        case WEIGHT_BLACK:
++            aInfo.m_eWeight = psp::weight::Black;
++            break;
++        default:
++            aInfo.m_eWeight = psp::weight::Unknown;
++            break;
++    }
++    // set width
++    switch( rFontAttributes.GetWidthType() )
++    {
++        case WIDTH_ULTRA_CONDENSED:
++            aInfo.m_eWidth = psp::width::UltraCondensed;
++            break;
++        case WIDTH_EXTRA_CONDENSED:
++            aInfo.m_eWidth = psp::width::ExtraCondensed;
++            break;
++        case WIDTH_CONDENSED:
++            aInfo.m_eWidth = psp::width::Condensed;
++            break;
++        case WIDTH_SEMI_CONDENSED:
++            aInfo.m_eWidth = psp::width::SemiCondensed;
++            break;
++        case WIDTH_NORMAL:
++            aInfo.m_eWidth = psp::width::Normal;
++            break;
++        case WIDTH_SEMI_EXPANDED:
++            aInfo.m_eWidth = psp::width::SemiExpanded;
++            break;
++        case WIDTH_EXPANDED:
++            aInfo.m_eWidth = psp::width::Expanded;
++            break;
++        case WIDTH_EXTRA_EXPANDED:
++            aInfo.m_eWidth = psp::width::ExtraExpanded;
++            break;
++        case WIDTH_ULTRA_EXPANDED:
++            aInfo.m_eWidth = psp::width::UltraExpanded;
++            break;
++        default:
++            aInfo.m_eWidth = psp::width::Unknown;
++            break;
++    }
++
++    psp::FontConfigHints aHints(psp::PrintFontManager::get().getFontConfigHints(aInfo, nSize,
++	cairosubcallback));
++
++    switch (aHints.m_eEmbeddedbitmap)
++    {
++        default: 
++            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_DONTKNOW;
++            break;
++        case psp::fcstatus::istrue: 
++            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_TRUE;
++            break;
++        case psp::fcstatus::isfalse: 
++            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_FALSE;
++            break;
++    }
++
++    switch (aHints.m_eAntialias)
++    {
++        default: 
++            rFontHints.meAntiAlias = ANTIALIAS_DONTKNOW;
++            break;
++        case psp::fcstatus::istrue: 
++            rFontHints.meAntiAlias = ANTIALIAS_TRUE;
++            break;
++        case psp::fcstatus::isfalse: 
++            rFontHints.meAntiAlias = ANTIALIAS_FALSE;
++            break;
++    }
++
++    switch (aHints.m_eAutoHint)
++    {
++        default: 
++            rFontHints.meAutoHint = AUTOHINT_DONTKNOW;
++            break;
++        case psp::fcstatus::istrue: 
++            rFontHints.meAutoHint = AUTOHINT_TRUE;
++            break;
++        case psp::fcstatus::isfalse: 
++            rFontHints.meAutoHint = AUTOHINT_FALSE;
++            break;
++    }
++
++    switch (aHints.m_eHinting)
++    {
++        default: 
++            rFontHints.meHinting = HINTING_DONTKNOW;
++            break;
++        case psp::fcstatus::istrue: 
++            rFontHints.meHinting = HINTING_TRUE;
++            break;
++        case psp::fcstatus::isfalse: 
++            rFontHints.meHinting = HINTING_FALSE;
++            break;
++    }
++
++    switch (aHints.m_eHintStyle)
++    {
++        case psp::fchint::Nohint: 
++            rFontHints.meHintStyle = HINT_NONE;
++            break;
++        case psp::fchint::Slight: 
++            rFontHints.meHintStyle = HINT_SLIGHT;
++            break;
++        case psp::fchint::Medium: 
++            rFontHints.meHintStyle = HINT_MEDIUM;
++            break;
++        default: 
++        case psp::fchint::Full: 
++            rFontHints.meHintStyle = HINT_FULL;
++            break;
++    }
++
++}
++
++// ----------------------------------------------------------------------------
++
+ void
+ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+ {
+Index: unx/source/gdi/xlfd_extd.cxx
+===================================================================
+RCS file: /cvs/gsl/vcl/unx/source/gdi/xlfd_extd.cxx,v
+retrieving revision 1.31
+diff -u -r1.31 xlfd_extd.cxx
+--- openoffice.org.orig/vcl/unx/source/gdi/xlfd_extd.cxx	11 Apr 2008 09:57:12 -0000	1.31
++++ openoffice.org/vcl/unx/source/gdi/xlfd_extd.cxx	30 May 2008 09:31:15 -0000
+@@ -105,9 +105,6 @@
+     mbSubsettable  = false;
+     mbEmbeddable   = false;
+ 
+-    meEmbeddedBitmap = EMBEDDEDBITMAP_DONTKNOW;
+-    meAntiAlias = ANTIALIAS_DONTKNOW;
+-
+     mnQuality      = -1;
+ }
+ 
+Index: win/inc/salgdi.h
+===================================================================
+RCS file: /cvs/gsl/vcl/win/inc/salgdi.h,v
+retrieving revision 1.29
+diff -u -r1.29 salgdi.h
+--- openoffice.org.orig/vcl/win/inc/salgdi.h	11 Apr 2008 10:41:29 -0000	1.29
++++ openoffice.org/vcl/win/inc/salgdi.h	30 May 2008 09:31:31 -0000
+@@ -274,6 +274,7 @@
+     virtual USHORT         SetFont( ImplFontSelectData*, int nFallbackLevel );
+     // get the current font's etrics
+     virtual void			GetFontMetric( ImplFontMetricData* );
++    virtual void                        GetFontHints( const ImplFontAttributes& rFontAttributes, int nHints, ImplFontHints& rFontHints);
+     // get kernign pairs of the current font
+     // return only PairCount if (pKernPairs == NULL)
+     virtual ULONG			GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
+Index: win/source/gdi/salgdi3.cxx
+===================================================================
+RCS file: /cvs/gsl/vcl/win/source/gdi/salgdi3.cxx,v
+retrieving revision 1.95
+diff -u -r1.95 salgdi3.cxx
+--- openoffice.org.orig/vcl/win/source/gdi/salgdi3.cxx	11 Apr 2008 10:48:39 -0000	1.95
++++ openoffice.org/vcl/win/source/gdi/salgdi3.cxx	30 May 2008 09:31:36 -0000
+@@ -1388,6 +1388,12 @@
+ 
+ // -----------------------------------------------------------------------
+ 
++void WinSalGraphics::GetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints)
++{
++}
++
++// -----------------------------------------------------------------------
++
+ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+ {
+     if ( aSalShlData.mbWNT )
+Index: inc/psprint/fontmanager.hxx
+===================================================================
+RCS file: /cvs/gsl/psprint/inc/psprint/fontmanager.hxx,v
+retrieving revision 1.36
+diff -u -r1.36 fontmanager.hxx
+--- openoffice.org.orig/psprint/inc/psprint/fontmanager.hxx	11 Apr 2008 10:09:55 -0000	1.36
++++ openoffice.org/psprint/inc/psprint/fontmanager.hxx	18 Nov 2008 10:40:41 -0000
+@@ -142,6 +142,33 @@
+ };
+ }
+ 
++namespace fchint
++{
++enum type {
++    Nohint = 0,
++    Slight = 1,
++    Medium = 2,
++    Full = 3
++};
++}
++
++struct FontConfigHints
++{
++    fcstatus::type m_eEmbeddedbitmap;
++    fcstatus::type m_eAntialias;
++    fcstatus::type m_eAutoHint;
++    fcstatus::type m_eHinting;
++    fchint::type m_eHintStyle;
++
++    FontConfigHints() :
++        m_eEmbeddedbitmap( fcstatus::isunset ),
++        m_eAntialias( fcstatus::isunset ),
++        m_eAutoHint( fcstatus::isunset ),
++        m_eHinting( fcstatus::isunset ),
++        m_eHintStyle( fchint::Full )
++        {}
++};
++
+ /*
+  *  the difference between FastPrintFontInfo and PrintFontInfo
+  *  is that the information in FastPrintFontInfo can usually
+@@ -167,8 +194,6 @@
+     weight::type            			m_eWeight;
+     pitch::type             			m_ePitch;
+     rtl_TextEncoding        			m_aEncoding;
+-    fcstatus::type                      m_eEmbeddedbitmap;
+-    fcstatus::type                      m_eAntialias;
+ 
+     FastPrintFontInfo() :
+             m_nID( 0 ),
+@@ -178,9 +203,7 @@
+             m_eWidth( width::Unknown ),
+             m_eWeight( weight::Unknown ),
+             m_ePitch( pitch::Unknown ),
+-            m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
+-            m_eEmbeddedbitmap( fcstatus::isunset ),
+-            m_eAntialias( fcstatus::isunset )
++            m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
+     {}
+ };
+ 
+@@ -297,9 +320,6 @@
+         bool										m_bHaveVerticalSubstitutedGlyphs;
+         bool                                        m_bUserOverride;
+ 
+-        fcstatus::type                              m_eEmbeddedbitmap;
+-        fcstatus::type                              m_eAntialias;
+-
+         std::map< sal_Unicode, sal_Int32 >			m_aEncodingVector;
+         std::map< sal_Unicode, rtl::OString >		m_aNonEncoded;
+ 
+@@ -742,6 +762,7 @@
+     false else
+      */
+     bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
++    FontConfigHints getFontConfigHints(const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void *));
+ 
+     rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes, 
+         const rtl::OString& rLangAttrib, italic::type eItalic, weight::type eWeight, 
+Index: source/fontmanager/fontcache.cxx
+===================================================================
+RCS file: /cvs/gsl/psprint/source/fontmanager/fontcache.cxx,v
+retrieving revision 1.26
+diff -u -r1.26 fontcache.cxx
+--- openoffice.org.orig/psprint/source/fontmanager/fontcache.cxx	11 Apr 2008 10:12:37 -0000	1.26
++++ openoffiec.org/psprint/source/fontmanager/fontcache.cxx	18 Nov 2008 10:40:41 -0000
+@@ -214,9 +214,9 @@
+                 aLine.Append( ';' );
+                 aLine.Append( (*it)->m_bUserOverride ? "1" : "0" );
+                 aLine.Append( ';' );
+-                aLine.Append( ByteString::CreateFromInt32( (*it)->m_eEmbeddedbitmap ) );
++                aLine.Append( ByteString::CreateFromInt32( 0 ) );
+                 aLine.Append( ';' );
+-                aLine.Append( ByteString::CreateFromInt32( (*it)->m_eAntialias ) );
++                aLine.Append( ByteString::CreateFromInt32( 0 ) );
+ 
+                 switch( (*it)->m_eType )
+                 {
+@@ -426,9 +426,6 @@
+                                     = atoi( pLine + nTokenPos[14] );
+                 pFont->m_bUserOverride
+                                     = (atoi( pLine + nTokenPos[15] ) != 0);
+-                pFont->m_eEmbeddedbitmap
+-                                    = (fcstatus::type)atoi(pLine+nTokenPos[16]);
+-                pFont->m_eAntialias = (fcstatus::type)atoi(pLine+nTokenPos[17]);
+                 int nStyleTokenNr = 18;
+                 switch( eType )
+                 {
+@@ -560,8 +557,6 @@
+     pTo->m_nYMax			= pFrom->m_nYMax;
+     pTo->m_bHaveVerticalSubstitutedGlyphs = pFrom->m_bHaveVerticalSubstitutedGlyphs;
+     pTo->m_bUserOverride    = pFrom->m_bUserOverride;
+-    pTo->m_eEmbeddedbitmap  = pFrom->m_eEmbeddedbitmap;
+-    pTo->m_eAntialias       = pFrom->m_eAntialias;
+ }
+ 
+ /*
+@@ -623,9 +618,7 @@
+         pRight->m_nXMax				!= pLeft->m_nXMax			||
+         pRight->m_nYMax				!= pLeft->m_nYMax			||
+         pRight->m_bHaveVerticalSubstitutedGlyphs != pLeft->m_bHaveVerticalSubstitutedGlyphs ||
+-        pRight->m_bUserOverride     != pLeft->m_bUserOverride   ||
+-        pRight->m_eEmbeddedbitmap   != pLeft->m_eEmbeddedbitmap ||
+-        pRight->m_eAntialias        != pLeft->m_eAntialias
++        pRight->m_bUserOverride     != pLeft->m_bUserOverride
+         )
+         return false;
+     std::list< int >::const_iterator lit, rit;
+Index: source/fontmanager/fontconfig.cxx
+===================================================================
+RCS file: /cvs/gsl/psprint/source/fontmanager/fontconfig.cxx,v
+retrieving revision 1.30.20.1
+diff -u -r1.30.20.1 fontconfig.cxx
+--- openoffice.org.orig/psprint/source/fontmanager/fontconfig.cxx	10 Sep 2008 13:53:12 -0000	1.30.20.1
++++ openoffice.org/psprint/source/fontmanager/fontconfig.cxx	18 Nov 2008 10:40:42 -0000
+@@ -122,6 +122,7 @@
+     FcBool			(*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*);
+     FcBool			(*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind);
+     FcBool			(*m_pFcPatternAddInteger)(FcPattern*,const char*,int);
++    FcBool                    (*m_pFcPatternAddDouble)(FcPattern*,const char*,double);
+     FcBool                    (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool);
+     FcBool                    (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*);
+     FcBool			(*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*);
+@@ -226,6 +227,8 @@
+     { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); }
+     FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue )
+     { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); }
++    FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue )
++    { return m_pFcPatternAddDouble( pPattern, pObject, nValue ); }
+     FcBool FcPatternAddString( FcPattern* pPattern, const char* pObject, const FcChar8* pString )
+     { return m_pFcPatternAddString( pPattern, pObject, pString ); }
+     FcBool FcPatternAddBool( FcPattern* pPattern, const char* pObject, bool nValue )
+@@ -237,7 +240,9 @@
+     { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; }
+ 
+ public: // TODO: cleanup
+-    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontconfigNameToLocalized;
++    FcResult FamilyFromPattern(FcPattern* pPattern, FcChar8 **family);
++    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontNameToLocalized;
++    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aLocalizedToCanonical;
+ };
+ 
+ oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol )
+@@ -327,6 +332,8 @@
+         loadSymbol( "FcConfigSubstitute" );
+     m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int))
+         loadSymbol( "FcPatternAddInteger" );
++    m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double))
++        loadSymbol( "FcPatternAddDouble" );
+     m_pFcPatternAddBool = (FcBool(*)(FcPattern*,const char*,FcBool))
+         loadSymbol( "FcPatternAddBool" );
+     m_pFcPatternAddCharSet = (FcBool(*)(FcPattern*,const char*,const FcCharSet *))
+@@ -364,6 +371,7 @@
+             m_pFcDefaultSubstitute			&&
+             m_pFcConfigSubstitute			&&
+             m_pFcPatternAddInteger			&&
++            m_pFcPatternAddDouble                     &&
+             m_pFcPatternAddCharSet			&&
+             m_pFcPatternAddBool 			&&
+             m_pFcPatternAddString
+@@ -498,54 +506,53 @@
+ 
+         return candidate;
+     }
++}
+ 
+-
+-    FcResult lcl_FamilyFromPattern(FontCfgWrapper& rWrapper, FcPattern* pPattern, FcChar8 **family, 
+-        std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash > &aFontconfigNameToLocalized)
++FcResult FontCfgWrapper::FamilyFromPattern(FcPattern* pPattern, FcChar8 **family)
++{
++    FcChar8 *origfamily;
++    FcResult eFamilyRes	= FcPatternGetString( pPattern, FC_FAMILY, 0, &origfamily );
++    *family = origfamily;
++    
++    if( eFamilyRes == FcResultMatch)
+     {
+-        FcChar8 *origfamily;
+-        FcResult eFamilyRes	= rWrapper.FcPatternGetString( pPattern, FC_FAMILY, 0, &origfamily );
+-        *family = origfamily;
+-        
+-        if( eFamilyRes == FcResultMatch)
++        FcChar8* familylang = NULL;
++        if (FcPatternGetString( pPattern, FC_FAMILYLANG, 0, &familylang ) == FcResultMatch)
+         {
+-            FcChar8* familylang = NULL;
+-            if (rWrapper.FcPatternGetString( pPattern, FC_FAMILYLANG, 0, &familylang ) == FcResultMatch)
++            std::vector< lang_and_family > lang_and_families;
++            lang_and_families.push_back(lang_and_family(familylang, *family));
++            int k = 1;
++            while (1)
+             {
+-                std::vector< lang_and_family > lang_and_families;
++                if (FcPatternGetString( pPattern, FC_FAMILYLANG, k, &familylang ) != FcResultMatch)
++                    break;
++                if (FcPatternGetString( pPattern, FC_FAMILY, k, family ) != FcResultMatch)
++                    break;
+                 lang_and_families.push_back(lang_and_family(familylang, *family));
+-                int k = 1;
+-                while (1)
+-                {
+-                    if (rWrapper.FcPatternGetString( pPattern, FC_FAMILYLANG, k, &familylang ) != FcResultMatch)
+-                        break;
+-                    if (rWrapper.FcPatternGetString( pPattern, FC_FAMILY, k, family ) != FcResultMatch)
+-                        break;
+-                    lang_and_families.push_back(lang_and_family(familylang, *family));
+-                    ++k;
+-                }
+-                
+-                //possible to-do, sort by UILocale instead of process locale
+-                rtl_Locale* pLoc;
+-                osl_getProcessLocale(&pLoc);
+-                localizedsorter aSorter(pLoc);
+-                *family = aSorter.bestname(lang_and_families);
+-                
+-                std::vector<lang_and_family>::const_iterator aEnd = lang_and_families.end();
+-                for (std::vector<lang_and_family>::const_iterator aIter = lang_and_families.begin(); aIter != aEnd; ++aIter)
+-                {
+-                    const char *candidate = (const char*)(aIter->second);
+-                    if (rtl_str_compare(candidate, (const char*)(*family)) != 0)
+-                        aFontconfigNameToLocalized[OString(candidate)] = OString((const char*)(*family));
+-                }
++                ++k;
++            }
++            
++            //possible to-do, sort by UILocale instead of process locale
++            rtl_Locale* pLoc;
++            osl_getProcessLocale(&pLoc);
++            localizedsorter aSorter(pLoc);
++            *family = aSorter.bestname(lang_and_families);
++            
++            std::vector<lang_and_family>::const_iterator aEnd = lang_and_families.end();
++            for (std::vector<lang_and_family>::const_iterator aIter = lang_and_families.begin(); aIter != aEnd; ++aIter)
++            {
++                const char *candidate = (const char*)(aIter->second);
++                if (rtl_str_compare(candidate, (const char*)(*family)) != 0)
++                    m_aFontNameToLocalized[OString(candidate)] = OString((const char*)(*family));
+             }
++            if (rtl_str_compare((const char*)origfamily, (const char*)(*family)) != 0)
++                m_aLocalizedToCanonical[OString((const char*)(*family))] = OString((const char*)origfamily);
+         }
+-        
+-        return eFamilyRes;
+     }
++    
++    return eFamilyRes;
+ }
+ 
+-
+ /*
+  * PrintFontManager::initFontconfig
+  */
+@@ -580,18 +587,16 @@
+             int weight = 0;
+             int spacing = 0;
+             int nCollectionEntry = -1;
+-            FcBool outline = false, embitmap = true, antialias = true;
++            FcBool outline = false;
+             
+             FcResult eFileRes	      = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_FILE, 0, &file );
+-            FcResult eFamilyRes       = lcl_FamilyFromPattern(rWrapper, pFSet->fonts[i], &family, rWrapper.m_aFontconfigNameToLocalized );
++            FcResult eFamilyRes       = rWrapper.FamilyFromPattern( pFSet->fonts[i], &family );
+             FcResult eStyleRes	      = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_STYLE, 0, &style );
+             FcResult eSlantRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant );
+             FcResult eWeightRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight );
+             FcResult eSpacRes	      = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing );
+             FcResult eOutRes	      = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline );
+             FcResult eIndexRes        = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry );
+-            FcResult eEmbeddedBitmap  = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_EMBEDDED_BITMAP, 0, &embitmap );
+-            FcResult eAntialias       = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_ANTIALIAS, 0, &antialias );
+             
+             if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch )
+                 continue;
+@@ -731,15 +736,6 @@
+                 {
+                     pUpdate->m_aStyleName = OStringToOUString( OString( (sal_Char*)style ), RTL_TEXTENCODING_UTF8 );
+                 }
+-                if( eEmbeddedBitmap == FcResultMatch )
+-                {
+-                  pUpdate->m_eEmbeddedbitmap = embitmap ? fcstatus::istrue : fcstatus::isfalse;
+-                }
+-                if( eAntialias == FcResultMatch )
+-                {
+-                  pUpdate->m_eAntialias = antialias ? fcstatus::istrue : fcstatus::isfalse;
+-                }
+-
+                 
+                 // update font cache
+                 m_pFontCache->updateFontCacheEntry( pUpdate, false );
+@@ -944,8 +940,8 @@
+             if( eFileRes == FcResultMatch )
+             {
+                 OString sFamily((sal_Char*)family);
+-                std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontconfigNameToLocalized.find(sFamily);
+-                if (aI != rWrapper.m_aFontconfigNameToLocalized.end())
++                std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aFontNameToLocalized.find(sFamily);
++                if (aI != rWrapper.m_aFontNameToLocalized.end())
+                     sFamily = aI->second;
+                 aName = rtl::OStringToOUString( sFamily, RTL_TEXTENCODING_UTF8 );
+             }
+@@ -976,6 +972,98 @@
+     return aName;
+ }
+ 
++FontConfigHints PrintFontManager::getFontConfigHints( 
++    const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void *) )
++{
++    FontConfigHints aHints;
++#ifdef ENABLE_FONTCONFIG
++    FontCfgWrapper& rWrapper = FontCfgWrapper::get();
++    if( ! rWrapper.isValid() )
++        return aHints;
++
++    FcConfig* pConfig = rWrapper.FcConfigGetCurrent();
++    FcPattern* pPattern = rWrapper.FcPatternCreate();
 +
-+    psp::FontConfigHints aHints(psp::PrintFontManager::get().getFontConfigHints(aInfo, nSize));
++    OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
 +
-+    switch (aHints.m_eEmbeddedbitmap)
-+    {
-+        default: 
-+            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_DONTKNOW;
-+            break;
-+        case psp::fcstatus::istrue: 
-+            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_TRUE;
-+            break;
-+        case psp::fcstatus::isfalse: 
-+            rFontHints.meEmbeddedBitmap = EMBEDDEDBITMAP_FALSE;
-+            break;
-+    }
++    std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aLocalizedToCanonical.find(sFamily);
++    if (aI != rWrapper.m_aLocalizedToCanonical.end())
++        sFamily = aI->second;
++    if( sFamily.getLength() )
++        rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() );
 +
-+    switch (aHints.m_eAntialias)
-+    {
-+        default: 
-+            rFontHints.meAntiAlias = ANTIALIAS_DONTKNOW;
-+            break;
-+        case psp::fcstatus::istrue: 
-+            rFontHints.meAntiAlias = ANTIALIAS_TRUE;
-+            break;
-+        case psp::fcstatus::isfalse: 
-+            rFontHints.meAntiAlias = ANTIALIAS_FALSE;
-+            break;
-+    }
++    addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
++    rWrapper.FcPatternAddDouble( pPattern, FC_PIXEL_SIZE, nSize);
 +
-+    switch (aHints.m_eAutoHint)
-+    {
-+        default: 
-+            rFontHints.meAutoHint = AUTOHINT_DONTKNOW;
-+            break;
-+        case psp::fcstatus::istrue: 
-+            rFontHints.meAutoHint = AUTOHINT_TRUE;
-+            break;
-+        case psp::fcstatus::isfalse: 
-+            rFontHints.meAutoHint = AUTOHINT_FALSE;
-+            break;
-+    }
++    FcBool embitmap = true, antialias = true, autohint = true, hinting = true;
++    int hintstyle = FC_HINT_FULL;
 +
-+    switch (aHints.m_eHinting)
-+    {
-+        default: 
-+            rFontHints.meHinting = HINTING_DONTKNOW;
-+            break;
-+        case psp::fcstatus::istrue: 
-+            rFontHints.meHinting = HINTING_TRUE;
-+            break;
-+        case psp::fcstatus::isfalse: 
-+            rFontHints.meHinting = HINTING_FALSE;
-+            break;
-+    }
++    rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern );
++    if (subcallback) subcallback(pPattern);
++    rWrapper.FcDefaultSubstitute( pPattern );
 +
-+    switch (aHints.m_eHintStyle)
++    FcResult eResult = FcResultNoMatch;
++    FcFontSet *pFontSet = rWrapper.getFontSet();
++    FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult );
++    if( pResult )
 +    {
-+        case psp::fchint::Nohint: 
-+            rFontHints.meHintStyle = HINT_NONE;
-+            break;
-+        case psp::fchint::Slight: 
-+            rFontHints.meHintStyle = HINT_SLIGHT;
-+            break;
-+        case psp::fchint::Medium: 
-+            rFontHints.meHintStyle = HINT_MEDIUM;
-+            break;
-+        default: 
-+        case psp::fchint::Full: 
-+            rFontHints.meHintStyle = HINT_FULL;
-+            break;
++        FcFontSet* pSet = rWrapper.FcFontSetCreate();
++        rWrapper.FcFontSetAdd( pSet, pResult );
++        if( pSet->nfont > 0 )
++        {
++            FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pSet->fonts[0],
++                FC_EMBEDDED_BITMAP, 0, &embitmap);
++            FcResult eAntialias = rWrapper.FcPatternGetBool(pSet->fonts[0],
++                FC_ANTIALIAS, 0, &antialias);
++            FcResult eAutoHint = rWrapper.FcPatternGetBool(pSet->fonts[0], 
++                FC_AUTOHINT, 0, &autohint);
++            FcResult eHinting = rWrapper.FcPatternGetBool(pSet->fonts[0], 
++                FC_HINTING, 0, &hinting);
++            FcResult eHintStyle = rWrapper.FcPatternGetInteger(pSet->fonts[0],
++                FC_HINT_STYLE, 0, &hintstyle);
++         
++            if( eEmbeddedBitmap == FcResultMatch )
++                aHints.m_eEmbeddedbitmap = embitmap ? fcstatus::istrue : fcstatus::isfalse;
++            if( eAntialias == FcResultMatch )
++                aHints.m_eAntialias = antialias ? fcstatus::istrue : fcstatus::isfalse;
++            if( eAutoHint == FcResultMatch )
++                aHints.m_eAutoHint = autohint ? fcstatus::istrue : fcstatus::isfalse;
++            if( eHinting == FcResultMatch )
++                aHints.m_eHinting = hinting ? fcstatus::istrue : fcstatus::isfalse;
++            if (eHintStyle != FcResultMatch)
++                aHints.m_eHintStyle = fchint::Full;
++            else
++            {
++                switch (hintstyle)
++                {
++                    case FC_HINT_NONE:
++                        aHints.m_eHintStyle = fchint::Nohint;
++                        break;
++                    case FC_HINT_SLIGHT:
++                        aHints.m_eHintStyle = fchint::Slight;
++                        break;
++                    case FC_HINT_MEDIUM:
++                        aHints.m_eHintStyle = fchint::Medium;
++                        break;
++                    case FC_HINT_FULL:
++                    default:
++                        aHints.m_eHintStyle = fchint::Full;
++                        break;
++                }
++            }
++        }
++        // info: destroying the pSet destroys pResult implicitly
++        // since pResult was "added" to pSet
++        rWrapper.FcFontSetDestroy( pSet );
 +    }
-+}
 +
-+// ----------------------------------------------------------------------------
++    // cleanup
++    rWrapper.FcPatternDestroy( pPattern );
 +
- void
- X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric )
++#endif
++    return aHints;
++}
++
+ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale )
  {
-Index: unx/source/gdi/xlfd_extd.cxx
+     FontCfgWrapper& rWrapper = FontCfgWrapper::get();
+Index: source/fontmanager/fontmanager.cxx
 ===================================================================
-RCS file: /cvs/gsl/vcl/unx/source/gdi/xlfd_extd.cxx,v
-retrieving revision 1.31
-diff -u -r1.31 xlfd_extd.cxx
---- openoffice.org.orig/vcl/unx/source/gdi/xlfd_extd.cxx	11 Apr 2008 09:57:12 -0000	1.31
-+++ openoffice.org/vcl/unx/source/gdi/xlfd_extd.cxx	30 May 2008 09:31:15 -0000
-@@ -105,9 +105,6 @@
-     mbSubsettable  = false;
-     mbEmbeddable   = false;
- 
--    meEmbeddedBitmap = EMBEDDEDBITMAP_DONTKNOW;
--    meAntiAlias = ANTIALIAS_DONTKNOW;
--
-     mnQuality      = -1;
+RCS file: /cvs/gsl/psprint/source/fontmanager/fontmanager.cxx,v
+retrieving revision 1.81.18.1
+diff -u -r1.81.18.1 fontmanager.cxx
+--- openoffice.org.orig/psprint/source/fontmanager/fontmanager.cxx	10 Sep 2008 13:53:28 -0000	1.81.18.1
++++ openoffice.org/psprint/source/fontmanager/fontmanager.cxx	18 Nov 2008 10:40:42 -0000
+@@ -355,9 +355,7 @@
+         m_nXMax( 0 ),
+         m_nYMax( 0 ),
+         m_bHaveVerticalSubstitutedGlyphs( false ),
+-        m_bUserOverride( false ),
+-        m_eEmbeddedbitmap( fcstatus::isunset ),
+-        m_eAntialias( fcstatus::isunset )
++        m_bUserOverride( false )
+ {
  }
  
-Index: win/inc/salgdi.h
-===================================================================
-RCS file: /cvs/gsl/vcl/win/inc/salgdi.h,v
-retrieving revision 1.29
-diff -u -r1.29 salgdi.h
---- openoffice.org.orig/vcl/win/inc/salgdi.h	11 Apr 2008 10:41:29 -0000	1.29
-+++ openoffice.org/vcl/win/inc/salgdi.h	30 May 2008 09:31:31 -0000
-@@ -274,6 +274,7 @@
-     virtual USHORT         SetFont( ImplFontSelectData*, int nFallbackLevel );
-     // get the current font's etrics
-     virtual void			GetFontMetric( ImplFontMetricData* );
-+    virtual void                        GetFontHints( const ImplFontAttributes& rFontAttributes, int nHints, ImplFontHints& rFontHints);
-     // get kernign pairs of the current font
-     // return only PairCount if (pKernPairs == NULL)
-     virtual ULONG			GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
-Index: win/source/gdi/salgdi3.cxx
-===================================================================
-RCS file: /cvs/gsl/vcl/win/source/gdi/salgdi3.cxx,v
-retrieving revision 1.95
-diff -u -r1.95 salgdi3.cxx
---- openoffice.org.orig/vcl/win/source/gdi/salgdi3.cxx	11 Apr 2008 10:48:39 -0000	1.95
-+++ openoffice.org/vcl/win/source/gdi/salgdi3.cxx	30 May 2008 09:31:36 -0000
-@@ -1388,6 +1388,12 @@
- 
- // -----------------------------------------------------------------------
- 
-+void WinSalGraphics::GetFontHints( const ImplFontAttributes& rFontAttributes, int nSize, ImplFontHints& rFontHints)
-+{
-+}
-+
-+// -----------------------------------------------------------------------
-+
- void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
- {
-     if ( aSalShlData.mbWNT )
+@@ -2732,8 +2730,6 @@
+     rInfo.m_eWeight         = pFont->m_eWeight;
+     rInfo.m_ePitch          = pFont->m_ePitch;
+     rInfo.m_aEncoding       = pFont->m_aEncoding;
+-    rInfo.m_eEmbeddedbitmap = pFont->m_eEmbeddedbitmap;
+-    rInfo.m_eAntialias      = pFont->m_eAntialias;
+     rInfo.m_aAliases.clear();
+     for( ::std::list< int >::iterator it = pFont->m_aAliases.begin(); it != pFont->m_aAliases.end(); ++it )
+         rInfo.m_aAliases.push_back( m_pAtoms->getString( ATOM_FAMILYNAME, *it ) );
+@@ -3977,8 +3973,6 @@
+         BuiltinFont* pFont = new BuiltinFont();
+         pFont->m_nDirectory = 0;
+         pFont->m_bUserOverride = false;
+-        pFont->m_eEmbeddedbitmap = fcstatus::isunset;
+-        pFont->m_eAntialias = fcstatus::isunset;
+         pFont->m_pMetrics = new PrintFontMetrics;
+         memset( pFont->m_pMetrics->m_aPages, 0xff, sizeof( pFont->m_pMetrics->m_aPages ) );
+         pFont->m_pMetrics->m_bKernPairsQueried = true;

openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch:

Index: openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-10/openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch	6 Jun 2008 09:54:04 -0000	1.2
+++ openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch	18 Nov 2008 12:16:54 -0000	1.3
@@ -1,8 +1,8 @@
 diff -ru psprint/inc/psprint/fontmanager.hxx psprint/inc/psprint/fontmanager.hxx
 --- openoffice.org.orig/psprint/inc/psprint/fontmanager.hxx	2008-05-26 15:48:28.000000000 +0100
 +++ openoffice.org/psprint/inc/psprint/fontmanager.hxx	2008-05-26 15:50:13.000000000 +0100
-@@ -789,8 +789,8 @@
-     FontConfigHints getFontConfigHints(const FastPrintFontInfo& rInfo, int nSize);
+@@ -765,8 +765,8 @@
+     FontConfigHints getFontConfigHints(const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void *));
  
      rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes, 
 -        const rtl::OString& rLangAttrib, italic::type eItalic, weight::type eWeight, 


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/F-10/openoffice.org.spec,v
retrieving revision 1.1692
retrieving revision 1.1693
diff -u -r1.1692 -r1.1693
--- openoffice.org.spec	15 Nov 2008 09:12:11 -0000	1.1692
+++ openoffice.org.spec	18 Nov 2008 12:16:54 -0000	1.1693
@@ -79,7 +79,7 @@
 Patch6:  openoffice.org-1.9.123.ooo53397.prelinkoptimize.desktop.patch
 Patch7:  openoffice.org-2.0.1.ooo58606.sw.pre-edit.patch
 Patch8:  openoffice.org-2.0.2.rh188467.printingdefaults.patch
-Patch9:  openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch
+Patch9:  openoffice.org-3.0.0.ooo88303.vcl.dynamicfontoptions.patch
 Patch10: openoffice.org-2.0.4.rhXXXXXX.padmin.nospadmin.patch
 Patch11: workspace.i18n45.patch
 Patch12: openoffice.org-2.1.0.ooo65491.psprint.enablenups.patch
@@ -99,7 +99,7 @@
 Patch26: openoffice.org-2.4.0.ooo85921.sd.editmasterundermouse.patch
 Patch27: openoffice.org-2.4.0.ooo86080.unopkg.bodge.patch
 Patch28: openoffice.org-2.4.0.ooo87490.sfx2.allprotocols.urlopen.patch
-Patch29: openoffice.org-3.0.0.ooo88303.vcl.dynamicfontoptions.patch
+Patch29: openoffice.org-2.0.2.ooo64508.vcl.honourfontconfighinting.patch
 Patch30: openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch
 Patch31: openoffice.org-2.2.0.gccXXXXX.solenv.javaregistration.patch
 Patch32: openoffice.org-3.0.0.ooo87970.vcl.samenamesubs.patch
@@ -1333,7 +1333,7 @@
 %patch6  -p1 -b .ooo53397.prelinkoptimize.desktop.patch
 %patch7  -p1 -b .ooo58606.sw.pre-edit.patch
 %patch8  -p1
-%patch9  -p1 -b .ooo64508.vcl.honourfontconfighinting.patch
+%patch9  -p1 -b .ooo88303.vcl.dynamicfontoptions.patch
 %patch10 -p1 -b .rhXXXXXX.padmin.nospadmin.patch
 %patch11 -p1 -b .workspace.i18n45.patch
 %patch12 -p1 -b .ooo65491.psprint.enablenups.patch
@@ -1353,7 +1353,7 @@
 %patch26 -p1 -b .ooo85921.sd.editmasterundermouse.patch
 %patch27 -p1 -b .ooo86080.unopkg.bodge.patch
 %patch28 -p1 -b .ooo87490.sfx2.allprotocols.urlopen.patch
-%patch29 -p1 -b .ooo88303.vcl.dynamicfontoptions.patch
+%patch29 -p1 -b .ooo64508.vcl.honourfontconfighinting.patch
 %patch30 -p1 -b .ooo88341.sc.verticalboxes.patch
 %patch31 -p1 -b .gccXXXXX.solenv.javaregistration.patch
 %patch32 -p1 -b .ooo87970.vcl.samenamesubs.patch
@@ -3750,11 +3750,12 @@
     unopkg list --shared > /dev/null 2>&1 || :
 
 %changelog
-* Fri Nov 10 2008 Caolán McNamara <caolanm at redhat.com> - 1:3.0.0-9.11
+* Tue Nov 18 2008 Caolán McNamara <caolanm at redhat.com> - 1:3.0.0-9.11
 - Resolves: rhbz#470302 g_file_input_stream_query_info doesn't do anything 
   remotely
 - Resolves: rhbz#471485 openoffice.org-3.0.0.ooo96203.sfx2.3layer-qstart.patch
 - Resolves: rhbz#471724 own the share dir too
+- Resolves: rhbz#471103 improve font-settings
 
 * Fri Nov 07 2008 Caolán McNamara <caolanm at redhat.com> - 1:3.0.0-9.10
 - window manager hatred




More information about the fedora-extras-commits mailing list