< prev index next >

src/java.desktop/share/classes/java/awt/Font.java

Print this page

        

*** 54,63 **** --- 54,64 ---- import sun.font.CompositeFont; import sun.font.CreatedFontTracker; import sun.font.Font2D; import sun.font.Font2DHandle; import sun.font.FontAccess; + import sun.font.FontDesignMetrics; import sun.font.FontManager; import sun.font.FontManagerFactory; import sun.font.FontUtilities; import sun.font.GlyphLayout; import sun.font.FontLineMetrics;
*** 2601,2613 **** if (simple) { simple = ! FontUtilities.isComplexText(chars, beginIndex, limit); } if (simple) { ! GlyphVector gv = new StandardGlyphVector(this, chars, beginIndex, ! limit - beginIndex, frc); ! return gv.getLogicalBounds(); } else { // need char array constructor on textlayout String str = new String(chars, beginIndex, limit - beginIndex); TextLayout tl = new TextLayout(str, this, frc); return new Rectangle2D.Float(0, -tl.getAscent(), tl.getAdvance(), --- 2602,2613 ---- if (simple) { simple = ! FontUtilities.isComplexText(chars, beginIndex, limit); } if (simple) { ! FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc); ! return metrics.getSimpleBounds(chars, beginIndex, limit-beginIndex); } else { // need char array constructor on textlayout String str = new String(chars, beginIndex, limit - beginIndex); TextLayout tl = new TextLayout(str, this, frc); return new Rectangle2D.Float(0, -tl.getAscent(), tl.getAdvance(),
< prev index next >