     _fragment: (text, x, y, options = {}) ->
         state = @_textState
         wrap = @_wrapState
+        
+        # handle options
+        text = '' + text
         align = options.align or 'left'
-        text = '' + text
         indent = (wrap.firstLine and options.indent) or 0
-        wordSpacing = 0
+        wordSpacing = options.wordSpacing or 0
+        characterSpacing = options.characterSpacing or 0
         
         # text alignments
         if options.width
-            lineWidth = options.width - indent
+            lineWidth = options.width - indent - wrap.extraSpace
             
             switch align
                 when 'right'

                    textWidth = @widthOfString text.replace(/\s+/g, '')
                    wordSpacing = (lineWidth - textWidth) / (words.length - 1) - @widthOfString(' ')
                    
                    # Remove double spaces
                    text = text.replace(/\s+/g, ' ')
                    
        # indentation support
        x += indent
        

        
        # add current font to page if necessary
        @page.fonts[@_font.id] ?= @_font.ref
        
        # if the wordSpacing option is specified, remove multiple consecutive spaces
        if options.wordSpacing
            text = text.replace(/\s+/g, ' ')
        
        # word wrapping
        if options.width
