Text: outline a string with a color or gradient

Fill color is still the same with 'color' (i.e. can be overridden by markup still), but now there's a stroke_width and a stroke_color option that, when stroke_width > 0, will draw an outline below the text. Since this isn't a Pango feature, we can't do markup for outlines. (Maybe make that a feature request to Pango if you want it.)

Implements #51
This commit is contained in:
Andy Meneely
2015-04-28 22:27:26 -04:00
parent 70b2e52d57
commit 7c69cad506
21 changed files with 247 additions and 148 deletions
+4
View File
@@ -78,6 +78,10 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
embed.svg key: ':health:', width: 28, height: 28, file: 'glass-heart.svg'
end
text str: "Stroke n <span fgcolor=\"\#ff0000\">fill</span>",
color: :green, stroke_width: 3.0, stroke_color: :blue,
x: '1.8in', y: '3in', width: '0.85in', font: 'Sans Bold 26', markup: true
text str: "<b>Markup</b> is <i>quite</i> <s>'easy'</s> <span fgcolor=\"\#ff0000\">awesome</span>. Can't beat those \"smart\" 'quotes', now with 10--20% more en-dashes --- and em-dashes --- with explicit ellipses too...",
markup: true,
x: 50, y: 1000,