Prawn (Ruby) – How to use :inline_format <color rgb=""></color>, but still keep the text stroke?

I know, looking at the Prawn manual that you can draw inline text as “stroked”, like this (from the manual):

fill_color "00ff00"
stroke_color "0000ff"

font_size(40) do
  # normal rendering mode: fill
  text "This text is filled with green."
  move_down 20

  # inline rendering mode: stroke
  text "This text is stroked with blue", :mode => :stroke
  move_down 20

  # block rendering mode: fill and stroke
  text_rendering_mode(:fill_stroke) do
    text "This text is filled with green and stroked with blue"
  end

And I also know that you have some control over inline formatting, like this:

"aaaaaaaaaaaaaaa <color rgb="xxxxxx">UP</color> aaaaaaaa"

But now the “UP” isn’t outlined as it should be.

How do I outline text and use inline_formatting? Can I?


Source: ruby

Leave a Reply