                 return if @y > maxY
                 
                 # reset the space left and buffer
-                spaceLeft = lineWidth - w
+                spaceLeft = lineWidth - w - wrap.extraSpace
                 buffer = if word is '\n' then '' else word
 
             else

        
        # Word spacing
        @addContent wordSpacing + ' Tw' unless wordSpacing is state.wordSpacing
        
        # add the actual text
        @addContent "(#{text}) Tj"

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