
evince-2.32.0-subpixel-new.patch
By: a guest on
Feb 21st, 2012 | syntax:
Diff | size: 2.03 KB | hits: 39 | expires: Never
--- evince-2.32.0/backend/pdf/ev-poppler.cc 2010-09-27 12:54:34.000000000 -0400
+++ evince-2.32.0-patch/backend/pdf/ev-poppler.cc 2012-02-21 14:35:20.000000000 -0500
@@ -342,6 +342,25 @@
return label;
}
+/* For some reason, cairo doesn't put this in the public header. */
+typedef enum _cairo_lcd_filter {
+ CAIRO_LCD_FILTER_DEFAULT,
+ CAIRO_LCD_FILTER_NONE,
+ CAIRO_LCD_FILTER_INTRA_PIXEL,
+ CAIRO_LCD_FILTER_FIR3,
+ CAIRO_LCD_FILTER_FIR5
+} cairo_lcd_filter_t;
+
+struct _cairo_font_options {
+ cairo_antialias_t antialias;
+ cairo_subpixel_order_t subpixel_order;
+ cairo_lcd_filter_t lcd_filter;
+ cairo_hint_style_t hint_style;
+ cairo_hint_metrics_t hint_metrics;
+};
+
+
+
static cairo_surface_t *
pdf_page_render (PopplerPage *page,
gint width,
@@ -350,10 +369,26 @@
{
cairo_surface_t *surface;
cairo_t *cr;
+
+ cairo_font_options_t *options;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
width, height);
- cr = cairo_create (surface);
+ memset (cairo_image_surface_get_data (surface), 0xff,
+ cairo_image_surface_get_height (surface) *
+ cairo_image_surface_get_stride (surface));
+
+ options = cairo_font_options_create ();
+ cairo_surface_get_font_options (surface, options);
+ cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_SUBPIXEL);
+ cairo_font_options_set_subpixel_order (options, CAIRO_SUBPIXEL_ORDER_RGB);
+ cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);
+ options->lcd_filter = CAIRO_LCD_FILTER_FIR5;
+
+ cr = cairo_create (surface);
+ cairo_set_font_options (cr, options);
+ cairo_font_options_destroy (options);
+
switch (rc->rotation) {
case 90:
@@ -817,6 +852,7 @@
static void
pdf_document_class_init (PdfDocumentClass *klass)
{
+
GObjectClass *g_object_class = G_OBJECT_CLASS (klass);
EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass);