Feat/font autoscale (#288)
* PoC font autosize feature * Take enumerables or 'auto' keyword for autoscaling * Allo enumerables of font_size per card, where the largest font size that does not ellipsize is chosen * Use ellipsize: :autoscale keyword to determine font autosizing * Use binary search to find the correct font size * Consider new ellipsize option in testcase * Document ellipsize: :autoscale option * Add ellipsize: :autoscale sample to text sample * Fix double multiplication with Pango::SCALE * Scale embedded images with text when autoscaling * Remove stray semicolon * Return dummy value for FontDescription.size in mock_cairo * Update regression test data for autoscale feature. * Add ellipsize: :autoscale example to existing font_autoscale sample * Add missing :autoscale to list of options in documentation
This commit is contained in:
@@ -27,6 +27,7 @@ cairo: set_source_color([:cyan])
|
||||
cairo: set_line_width([2.0])
|
||||
cairo: stroke([])
|
||||
pango: ellipsized?([])
|
||||
pango: ellipsized?([])
|
||||
cairo: restore([])
|
||||
cairo: save([])
|
||||
cairo: new_path([])
|
||||
@@ -46,6 +47,7 @@ cairo: move_to([0, 0])
|
||||
cairo: move_to([0, 0])
|
||||
cairo: show_pango_layout([MockDouble])
|
||||
pango: ellipsized?([])
|
||||
pango: ellipsized?([])
|
||||
cairo: restore([])
|
||||
surface: write_to_png(["_output/config_text_00.png"])
|
||||
surface: finish([])
|
||||
@@ -73,6 +75,7 @@ cairo: set_source_color([:cyan])
|
||||
cairo: set_line_width([2.0])
|
||||
cairo: stroke([])
|
||||
pango: ellipsized?([])
|
||||
pango: ellipsized?([])
|
||||
cairo: restore([])
|
||||
surface: write_to_png(["_output/config_disable_text_00.png"])
|
||||
surface: finish([])
|
||||
|
||||
@@ -25,6 +25,7 @@ cairo: set_source_color(["#FF0000"])
|
||||
cairo: set_line_width([2.0])
|
||||
cairo: stroke([])
|
||||
pango: ellipsized?([])
|
||||
pango: ellipsized?([])
|
||||
cairo: restore([])
|
||||
cairo: save([])
|
||||
cairo: new_path([])
|
||||
|
||||
Reference in New Issue
Block a user