local style = {}
TextStamp = function(canvas, rect, text, paint, font, halign, valign)
    text = todisplaystring(text)
    if (text) then
        style.font = font or canvas:getFont()
        local styledString = StyledString.new(text, style)
        StyledStringStamp(canvas, rect, styledString, paint, halign, valign)
    end
end

return TextStamp
