Don't like ads? PRO users don't see any ads ;-)
Guest

evince-2.32.0-subpixel-new.patch

By: a guest on Feb 21st, 2012  |  syntax: Diff  |  size: 2.03 KB  |  hits: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- evince-2.32.0/backend/pdf/ev-poppler.cc     2010-09-27 12:54:34.000000000 -0400
  2. +++ evince-2.32.0-patch/backend/pdf/ev-poppler.cc       2012-02-21 14:35:20.000000000 -0500
  3. @@ -342,6 +342,25 @@
  4.         return label;
  5.  }
  6.  
  7. +/* For some reason, cairo doesn't put this in the public header. */
  8. +typedef enum _cairo_lcd_filter {
  9. +    CAIRO_LCD_FILTER_DEFAULT,
  10. +    CAIRO_LCD_FILTER_NONE,
  11. +    CAIRO_LCD_FILTER_INTRA_PIXEL,
  12. +    CAIRO_LCD_FILTER_FIR3,
  13. +    CAIRO_LCD_FILTER_FIR5
  14. +} cairo_lcd_filter_t;
  15. +
  16. +struct _cairo_font_options {
  17. +    cairo_antialias_t antialias;
  18. +    cairo_subpixel_order_t subpixel_order;
  19. +    cairo_lcd_filter_t lcd_filter;
  20. +    cairo_hint_style_t hint_style;
  21. +    cairo_hint_metrics_t hint_metrics;
  22. +};
  23. +
  24. +
  25. +
  26.  static cairo_surface_t *
  27.  pdf_page_render (PopplerPage     *page,
  28.                  gint             width,
  29. @@ -350,10 +369,26 @@
  30.  {
  31.         cairo_surface_t *surface;
  32.         cairo_t *cr;
  33. +      
  34. +       cairo_font_options_t *options;
  35.  
  36.         surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
  37.                                               width, height);
  38. -       cr = cairo_create (surface);
  39. +    memset (cairo_image_surface_get_data (surface), 0xff,
  40. +                cairo_image_surface_get_height (surface) *
  41. +                cairo_image_surface_get_stride (surface));
  42. +
  43. +    options = cairo_font_options_create ();
  44. +        cairo_surface_get_font_options (surface, options);
  45. +        cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_SUBPIXEL);
  46. +        cairo_font_options_set_subpixel_order (options, CAIRO_SUBPIXEL_ORDER_RGB);
  47. +        cairo_font_options_set_hint_style (options, CAIRO_HINT_STYLE_SLIGHT);
  48. +               options->lcd_filter = CAIRO_LCD_FILTER_FIR5;
  49. +
  50. +     cr = cairo_create (surface);
  51. +    cairo_set_font_options (cr, options);
  52. +        cairo_font_options_destroy (options);
  53. +
  54.  
  55.         switch (rc->rotation) {
  56.                 case 90:
  57. @@ -817,6 +852,7 @@
  58.  static void
  59.  pdf_document_class_init (PdfDocumentClass *klass)
  60.  {
  61. +      
  62.         GObjectClass    *g_object_class = G_OBJECT_CLASS (klass);
  63.         EvDocumentClass *ev_document_class = EV_DOCUMENT_CLASS (klass);