diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-22 11:19:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-22 11:19:06 +0100 |
commit | fb18147a63061e719c35f32d5adf7699bc021972 (patch) | |
tree | 46168bd430ba0f0a6b382145635b82bdfdc826ac /vcl | |
parent | 0c6f8003581ea03460f54c5ada00936ec5d341c5 (diff) |
make fontconfig non-optional on non-MacOSX unix
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 7 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 131 |
2 files changed, 31 insertions, 107 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c8292cf7ac71..c0eb89e04eeb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -177,12 +177,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ )) -## handle fontconfig -ifneq ($(ENABLE_FONTCONFIG),) -$(eval $(call gb_Library_set_defs,vcl,\ - $$(DEFS) \ - -DENABLE_FONTCONFIG \ -)) ## handle CUPS ifneq ($(ENABLE_CUPS),) $(eval $(call gb_Library_set_defs,vcl,\ @@ -190,7 +184,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DENABLE_CUPS \ )) endif -endif $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/glyphs/gcach_ftyp \ vcl/source/glyphs/gcach_layout \ diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index c1d506d91d83..1dc100159778 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -36,53 +36,37 @@ using namespace psp; -#ifdef ENABLE_FONTCONFIG - #include <fontconfig/fontconfig.h> - #include <ft2build.h> - #include <fontconfig/fcfreetype.h> - // allow compile on baseline (currently with fontconfig 2.2.0) - #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 - #define FC_WEIGHT_BOOK 75 - #endif - #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 - #define FC_EMBEDDED_BITMAP "embeddedbitmap" - #endif - #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_FAMILYLANG "familylang" - #endif - #ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_CAPABILITY "capability" - #endif - #ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_STYLELANG "stylelang" - #endif - #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 - #define FC_HINT_STYLE "hintstyle" - #define FC_HINT_NONE 0 - #define FC_HINT_SLIGHT 1 - #define FC_HINT_MEDIUM 2 - #define FC_HINT_FULL 3 - #endif - #ifndef FC_FT_FACE - #define FC_FT_FACE "ftface" - #endif - #ifndef FC_EMBOLDEN - #define FC_EMBOLDEN "embolden" - #endif -#else - typedef void FcConfig; - typedef void FcObjectSet; - typedef void FcPattern; - typedef void FcFontSet; - typedef void FcCharSet; - typedef int FcResult; - typedef int FcBool; - typedef int FcMatchKind; - typedef char FcChar8; - typedef int FcChar32; - typedef unsigned int FT_UInt; - typedef void* FT_Face; - typedef int FcSetName; +#include <fontconfig/fontconfig.h> +#include <ft2build.h> +#include <fontconfig/fcfreetype.h> +// allow compile on baseline (currently with fontconfig 2.2.0) +#ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 + #define FC_WEIGHT_BOOK 75 +#endif +#ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 + #define FC_EMBEDDED_BITMAP "embeddedbitmap" +#endif +#ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_FAMILYLANG "familylang" +#endif +#ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_CAPABILITY "capability" +#endif +#ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_STYLELANG "stylelang" +#endif +#ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 + #define FC_HINT_STYLE "hintstyle" + #define FC_HINT_NONE 0 + #define FC_HINT_SLIGHT 1 + #define FC_HINT_MEDIUM 2 + #define FC_HINT_FULL 3 +#endif +#ifndef FC_FT_FACE + #define FC_FT_FACE "ftface" +#endif +#ifndef FC_EMBOLDEN + #define FC_EMBOLDEN "embolden" #endif #include <cstdio> @@ -483,7 +467,6 @@ FontCfgWrapper::FontCfgWrapper() void FontCfgWrapper::addFontSet( FcSetName eSetName ) { - #ifdef ENABLE_FONTCONFIG /* add only acceptable outlined fonts to our config, for future fontconfig use @@ -506,12 +489,8 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) } // TODO?: FcFontSetDestroy( pOrig ); - #else - (void)eSetName; // prevent compiler warning about unused parameter - #endif } -#ifdef ENABLE_FONTCONFIG namespace { int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b) @@ -593,11 +572,9 @@ namespace return bIsDup; } } -#endif FcFontSet* FontCfgWrapper::getFontSet() { - #ifdef ENABLE_FONTCONFIG if( !m_pOutlineSet ) { m_pOutlineSet = FcFontSetCreate(); @@ -607,7 +584,6 @@ FcFontSet* FontCfgWrapper::getFontSet() ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this)); } - #endif return m_pOutlineSet; } @@ -639,7 +615,6 @@ void FontCfgWrapper::release() } } -#ifdef ENABLE_FONTCONFIG namespace { class localizedsorter @@ -1262,10 +1237,6 @@ public: ImplFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const { -#ifndef ENABLE_FONTCONFIG - (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions; - return NULL; -#else // ENABLE_FONTCONFIG FontCfgWrapper& rWrapper = FontCfgWrapper::get(); if( ! rWrapper.isValid() ) return NULL; @@ -1334,7 +1305,6 @@ ImplFontOptions* PrintFontManager::getFontOptions( rWrapper.FcPatternDestroy( pPattern ); return pOptions; -#endif } bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ) @@ -1404,43 +1374,4 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star return bSuccess; } -#else // ENABLE_FONTCONFIG not defined - -bool PrintFontManager::initFontconfig() -{ - return false; -} - -int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& ) -{ - return 0; -} - -void PrintFontManager::deinitFontconfig() -{} - -bool PrintFontManager::addFontconfigDir( const rtl::OString& ) -{ - return false; -} - -bool PrintFontManager::matchFont( FastPrintFontInfo&, const com::sun::star::lang::Locale& ) -{ - return false; -} - -int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 ) -{ - return 0; -} - -rtl::OUString PrintFontManager::Substitute( const rtl::OUString&, - rtl::OUString&, const rtl::OString&, FontItalic, FontWeight, FontWidth, FontPitch) const -{ - rtl::OUString aName; - return aName; -} - -#endif // ENABLE_FONTCONFIG - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |