         indent = (wrap.firstLine and options.indent) or 0
         wordSpacing = options.wordSpacing or 0
         characterSpacing = options.characterSpacing or 0
+        usedWidth = @widthOfString(text)
         
         # text alignments
         if options.width

            
            switch align
                when 'right'
                    x += lineWidth - @widthOfString(text)
                
                when 'center'
                    x += lineWidth / 2 - @widthOfString(text) / 2
                
                when 'justify'
                    # don't justify the last line of paragraphs

        state.mode = mode
        state.wordSpacing = wordSpacing

        if options.underlineColor and options.width
            @underline @x, @y, usedWidth, @currentLineHeight(false), color: options.underlineColor
        if options.url and options.width
            @link @x, @y, usedWidth, @currentLineHeight(false), options.url

    _wrap: (text, options) ->
        wrap = @_wrapState
        width = @widthOfString.bind this
