Set font antialiasing from global antialiasing

This is a workaround until we get a proper solution in #59
This commit is contained in:
Andy Meneely
2015-04-13 21:26:41 -04:00
parent 2d9ba40486
commit 0616512bd6
6 changed files with 32 additions and 5 deletions
+9
View File
@@ -76,6 +76,14 @@ module Squib
end
end
def set_font_rendering_opts!(layout)
font_options = Cairo::FontOptions.new
font_options.antialias = ANTIALIAS_OPTS[(@deck.antialias.downcase)] || 'gray'
font_options.hint_metrics = 'on' # TODO make this configurable
font_options.hint_style = 'full' # TODO make this configurable
layout.context.font_options = font_options
end
# :nodoc:
# @api private
def set_wh!(layout, width, height)
@@ -160,6 +168,7 @@ module Squib
layout.markup = str
end
set_font_rendering_opts!(layout)
set_wh!(layout, width, height)
set_wrap!(layout, wrap)
set_ellipsize!(layout, ellipsize)