examples/text_layouter_styling.rb in hexapdf-0.6.0 vs examples/text_layouter_styling.rb in hexapdf-0.7.0
- old
+ new
@@ -23,11 +23,10 @@
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.".tr("\n", ' ')
# Wraps the text in a TextFragment using the given style.
def fragment(text, style)
- style = Style.new(style)
- TextFragment.new(items: style.font.decode_utf8(text), style: style)
+ TextFragment.create(text, style)
end
# Draws the text at the given [x, y] position onto the canvas and returns the
# new y position.
def draw_text(layouter, canvas, x, y)