diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-06-10 13:30:09 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-06-10 13:30:09 +0000 |
commit | e08782f470af4b102a37477100888bee2f4f10b1 (patch) | |
tree | ce5985313cbc8c936c44d06ea1506da1b51eb810 /vcl | |
parent | b324ff415f7508dd3304381e2c62338eb77ee622 (diff) |
INTEGRATION: CWS vcl11 (1.90.24); FILE MERGED
2003/06/05 13:42:08 cp 1.90.24.5: freetype 2.0.8 does not have FT_Library_Version: check dynamically
2003/06/03 08:55:57 pl 1.90.24.4: RESYNC: (1.90-1.91); FILE MERGED
2003/06/02 16:34:19 hdu 1.90.24.3: #109247# undo previous checkin
2003/06/02 16:17:05 hdu 1.90.24.2: #109247# release font when forced by upper layers
2003/05/28 16:43:37 cp 1.90.24.1: #109927# dont use embedded bitmaps with freetype-2.1.3
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index e08e5d7eb407..940c8d2ad233 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -2,8 +2,8 @@ * * $RCSfile: gcach_ftyp.cxx,v $ * - * $Revision: 1.91 $ - * last change: $Author: vg $ $Date: 2003-05-28 12:31:48 $ + * $Revision: 1.92 $ + * last change: $Author: vg $ $Date: 2003-06-10 14:30:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,9 @@ // TODO: move file mapping stuff to OSL #if defined(UNX) + #ifdef LINUX + #include <dlfcn.h> + #endif #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> @@ -333,6 +336,28 @@ FreetypeManager::FreetypeManager() { FT_Error rcFT = FT_Init_FreeType( &aLibFT ); + #ifdef LINUX + // XXX hack to enable usage of system freetype library. + // freetype prior to 2.0.9 does not have FT_Library_Version + void (*pft_library_version)(FT_Library library, + FT_Int *amajor, FT_Int *aminor, FT_Int *apatch); + pft_library_version = (void (*)(FT_Library library, + FT_Int *amajor, FT_Int *aminor, FT_Int *apatch)) dlsym (RTLD_DEFAULT, "FT_Library_Version"); + + if (pft_library_version != NULL) + { + // XXX disable embedded bitmaps for Freetype-2.1.3 unless explicitly requested + // below because it crashes StarOffice + FT_Int n_major = 0; + FT_Int n_minor = 0; + FT_Int n_patch = 0; + + pft_library_version( aLibFT, &n_major, &n_minor, &n_patch ); + if ((n_major == 2) && (n_minor == 1) && (n_patch == 3)) + nPrioEmbedded = 0; + } + #endif + // TODO: remove when the priorities are selected by UI char* pEnv; pEnv = ::getenv( "SAL_EMBEDDED_BITMAP_PRIORITY" ); @@ -510,6 +535,11 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn if( !pFI->MapFile() ) return; +#ifdef HDU_DEBUG + printf( "FTSF::FTSF(\"%s\", h=%d, w=%d)\n", + pFI->GetFontFileName()->getStr(), rFSD.mnHeight, rFSD.mnWidth ); +#endif + FT_Error rc = FT_New_Memory_Face( aLibFT, (FT_Byte*)pFI->GetBuffer(), pFI->GetFileSize(), mpFontInfo->GetFaceNum(), &maFaceFT ); if( rc != FT_Err_Ok || maFaceFT->num_glyphs == 0 ) |