def text(embed, para, box, trans, draw, dpi)
      Squib.logger.debug {"Rendering text with: \n#{para} \nat:\n #{box} \ndraw:\n #{draw} \ntransform: #{trans}"}
      extents = nil
      use_cairo do |cc|
        cc.set_source_squibcolor(draw.color)
        cc.translate(box.x, box.y)
        cc.rotate(trans.angle)
        cc.move_to(0, 0)

        font_desc      = Pango::FontDescription.new(para.font)
        font_desc.size = para.font_size * Pango::SCALE unless para.font_size.nil?
        layout         = cc.create_pango_layout
        layout.font_description = font_desc
        layout.text = para.str.to_s
        layout.context.resolution = dpi
        if para.markup
          para.str = @deck.typographer.process(layout.text)
          layout.markup = para.str.to_s
        end

        set_font_rendering_opts!(layout)
        set_wh!(layout, box.width, box.height)
        layout.wrap      = para.wrap
        layout.ellipsize = para.ellipsize
        layout.alignment = para.align

        layout.justify = para.justify unless para.justify.nil?
        layout.spacing = para.spacing unless para.spacing.nil?

        embed_images!(embed, para.str, layout, para.valign)

        vertical_start = compute_valign(layout, para.valign, 0)
        cc.move_to(0, vertical_start)

        stroke_outline!(cc, layout, draw) if draw.stroke_strategy == :stroke_first
        cc.move_to(0, vertical_start)

        cc.show_pango_layout(layout)
        stroke_outline!(cc, layout, draw) if draw.stroke_strategy == :fill_first
        draw_text_hint(cc, box.x, box.y, layout, para.hint)
        extents = { width: layout.extents[1].width / Pango::SCALE,
                    height: layout.extents[1].height / Pango::SCALE }
        warn_if_ellipsized layout
      end
      return extents
    end
def text(embed, para, box, trans, draw, dpi)
      Squib.logger.debug {"Rendering text with: \n#{para} \nat:\n #{box} \ndraw:\n #{draw} \ntransform: #{trans}"}
      extents = nil
      use_cairo do |cc|
        cc.set_source_squibcolor(draw.color)
        cc.translate(box.x, box.y)
        cc.rotate(trans.angle)
        cc.move_to(0, 0)

        font_desc      = Pango::FontDescription.new(para.font)
        font_desc.size = para.font_size * Pango::SCALE unless para.font_size.nil?
        layout         = cc.create_pango_layout
        layout.font_description = font_desc
        layout.text = para.str.to_s
        layout.context.resolution = dpi
        if para.markup
          para.str = @deck.typographer.process(layout.text)
          layout.markup = para.str.to_s
        end

        set_font_rendering_opts!(layout)
        set_wh!(layout, box.width, box.height)
        layout.wrap      = para.wrap
        layout.ellipsize = para.ellipsize
        layout.alignment = para.align

        layout.justify = para.justify unless para.justify.nil?
        layout.spacing = para.spacing unless para.spacing.nil?

        embed_images!(embed, para.str, layout, para.valign)

        vertical_start = compute_valign(layout, para.valign, 0)
        cc.move_to(0, vertical_start)

        stroke_outline!(cc, layout, draw) if draw.stroke_strategy == :stroke_first
        cc.move_to(0, vertical_start)

        cc.show_pango_layout(layout)
        stroke_outline!(cc, layout, draw) if draw.stroke_strategy == :fill_first
        draw_text_hint(cc, box.x, box.y, layout, para.hint)
        extents = { width: layout.extents[1].width / Pango::SCALE,
                    height: layout.extents[1].height / Pango::SCALE }
        warn_if_ellipsized layout
      end
      return extents
    end
:nodoc:
 @api private