private void assureGlyphVector () { Font font = getFont (); FontRenderContext fontRenderContext = getGraphics ().getFontRenderContext (); if (cacheGlyphVector != null && cacheFont == font && cacheLabel == label) return; cacheFont = font; cacheLabel = label; cacheGlyphVector = font.createGlyphVector (new FontRenderContext (new AffineTransform (), fontRenderContext.isAntiAliased (), fontRenderContext.usesFractionalMetrics ()), cacheLabel); }
private void assureGlyphVector () { Font font = getFont (); FontRenderContext fontRenderContext = getGraphics ().getFontRenderContext (); if (cacheGlyphVector != null && cacheFont == font && cacheLabel == label) return; cacheFont = font; cacheLabel = label; cacheGlyphVector = font.createGlyphVector (new FontRenderContext (new AffineTransform (), fontRenderContext.isAntiAliased (), fontRenderContext.usesFractionalMetrics ()), cacheLabel); }
localFRC = new FontRenderContext(new AffineTransform(), frc.isAntiAliased(), frc.usesFractionalMetrics());
localFRC = new FontRenderContext(new AffineTransform(), frc.isAntiAliased(), frc.usesFractionalMetrics());
protected Shape getGlyph(int i) { // This one-line implementation produces different results under JDK 1.3 // and 1.4 // return glyphs.getGlyphOutline(i); // The substitute code attempts to work around this by using defensive // programming // See code marked FONTHACK elsewhere in this file // Create a GlyphVector for this single character. FontRenderContext orig = getContext(); FontRenderContext frc = new FontRenderContext(null, orig .isAntiAliased(), orig.usesFractionalMetrics()); Shape shape = font.createGlyphVector(frc, new char[] { getUnicode(i) }) .getGlyphOutline(0); return orig.getTransform().createTransformedShape(shape); }
protected Shape getGlyph(int i) { // This one-line implementation produces different results under JDK 1.3 // and 1.4 // return glyphs.getGlyphOutline(i); // The substitute code attempts to work around this by using defensive // programming // See code marked FONTHACK elsewhere in this file // Create a GlyphVector for this single character. FontRenderContext orig = getContext(); FontRenderContext frc = new FontRenderContext(null, orig .isAntiAliased(), orig.usesFractionalMetrics()); Shape shape = font.createGlyphVector(frc, new char[] { getUnicode(i) }) .getGlyphOutline(0); return orig.getTransform().createTransformedShape(shape); }