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:
Mirko K
2019-10-17 11:29:14 -04:00
committed by Andy Meneely
parent 43cca582a6
commit 6d57b3e8c1
28 changed files with 1161 additions and 187 deletions
@@ -695,6 +695,7 @@ cairo: move_to([0, 0])
cairo: move_to([0, 0])
cairo: show_pango_layout([MockDouble])
pango: ellipsized?([])
pango: ellipsized?([])
cairo: restore([])
cairo: save([])
cairo: new_path([])
+2
View File
@@ -50,6 +50,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/proof_poker_00.png"])
surface: finish([])
@@ -105,6 +106,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/proof_tiny_00.png"])
surface: finish([])