Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / cairo / cairo.dlsym.lcdfilter.patch
blob46f7ac74fd7aa181e63bc5096722db990555117b
1 --- misc/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:09:21.500373823 +0000
2 +++ misc/build/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:31:01.645238786 +0000
3 @@ -59,6 +59,8 @@
5 #if HAVE_FT_LIBRARY_SETLCDFILTER
6 #include FT_LCD_FILTER_H
7 +#elif HAVE_DLFCN_H
8 +#include <dlfcn.h>
9 #endif
11 /* Fontconfig version older than 2.6 didn't have these options */
12 @@ -1217,6 +1219,26 @@
13 return CAIRO_STATUS_SUCCESS;
16 +static void try_FT_Library_SetLcdFilter( FT_Library library,
17 + int lcd_filter )
19 +#if HAVE_FT_LIBRARY_SETLCDFILTER
20 + FT_Library_SetLcdFilter (library, lcd_filter);
21 +#elif HAVE_DLFCN_H
22 + static void (*pFT_Library_SetLcdFilter) (FT_Library, int);
23 + static int dlsymed = 0;
25 + if (!dlsymed)
26 + {
27 + pFT_Library_SetLcdFilter = dlsym(RTLD_DEFAULT, "FT_Library_SetLcdFilter");
28 + dlsymed = 1;
29 + }
31 + if (pFT_Library_SetLcdFilter)
32 + (*pFT_Library_SetLcdFilter) (library, lcd_filter);
33 +#endif
36 /* Converts an outline FT_GlyphSlot into an image
38 * This could go through _render_glyph_bitmap as well, letting
39 @@ -1350,15 +1372,11 @@
40 break;
43 -#if HAVE_FT_LIBRARY_SETLCDFILTER
44 - FT_Library_SetLcdFilter (library, lcd_filter);
45 -#endif
46 + try_FT_Library_SetLcdFilter(library, lcd_filter);
48 fterror = FT_Render_Glyph (face->glyph, render_mode);
50 -#if HAVE_FT_LIBRARY_SETLCDFILTER
51 - FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE);
52 -#endif
53 + try_FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE);
55 if (fterror != 0)
56 return _cairo_error (CAIRO_STATUS_NO_MEMORY);