     @addContent "#{mode} Tr" if mode
 
     # Character spacing
-    @addContent "#{characterSpacing} Tc" if characterSpacing
+    @addContent "#{@number(characterSpacing)} Tc" if characterSpacing
     
     # Add the actual text
     # If we have a word spacing value, we need to encode each word separately

        flush i
        
        # Move the text position and flush just the current character
        @addContent "1 0 0 1 #{x + pos.xOffset * scale} #{y + pos.yOffset * scale} Tm"
        flush i + 1
        
        hadOffset = yes
      else
        # If the last character had an offset, reset the text position
        if hadOffset
          @addContent "1 0 0 1 #{x} #{y} Tm"
          hadOffset = no
        
        # Group segments that don't have any advance adjustments

    @addContent "BT"

    # text position
    @addContent "1 0 0 1 #{@number(x)} #{@number(y)} Tm"

    # font and font size
    @addContent "/#{@_font.id} #{@_fontSize} Tf"
