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
+1 -1
View File
@@ -70,7 +70,7 @@ valign
ellipsize
default: ``:end``
When width and height are set, determines the behavior of overflowing text. Also: `true` maps to `:end` and `false` maps to `:none`. Default `:end` [:none, :start, :middle, :end, true, false]. Also, as mentioned in :doc:`/config`, if text is ellipsized a warning is thrown.
When width and height are set, determines the behavior of overflowing text. If set to ``:autoscale``, text is automatically scaled down from the set font size to the largest size that does no longer ellipsize. Also: `true` maps to `:end` and `false` maps to `:none`. Also, as mentioned in :doc:`/config`, if text is ellipsized a warning is thrown. [:none, :start, :middle, :end, :autoscale, true, false]
angle
default: ``0``