      *  a particular font, size, weight and style combination.  This value accounts for
      *  the difference between the metrics.ascent and the true top of the text within the
      *  text field and the top gutter
-     */
-    private static function getTextTopOffset(textFormat:TextFormat):Number
+     * 
+     *  If a styleSheet is specified it will be used, otherwise the textFormat will be used.
+     */
+    private static function getTextTopOffset(textFormat:TextFormat, styleSheet:StyleSheet=null):Number
     {
         // Try to find the top offset for the font, size, weight and style in our table.
         // We only store offets for unique font, size, weight and style combinations.

            // Check for embedded fonts
            embedFonts = isFontEmbedded(textFormat);
            
            defaultTextFormat = textFormat;
            setTextFormat(textFormat);
            
            // If our text is empty we need to force the style changes in order for
            // textHeight to be valid. Setting the width is sufficient, and should

import flash.geom.Vector3D;
import flash.text.Font;
import flash.text.FontType;
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFieldType;
