/** * Compute the cumulative height occupied by the text * * @param oldGraphics the graphics context, which properties are to be copied, may be null * @return the height in points */ public double getTextHeight(Graphics2D oldGraphics) { // dry-run in a 1x1 image and return the vertical advance BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); if (oldGraphics != null) { graphics.addRenderingHints(oldGraphics.getRenderingHints()); graphics.setTransform(oldGraphics.getTransform()); } DrawFactory.getInstance(graphics).fixFonts(graphics); return drawParagraphs(graphics, 0, 0); }
DrawFactory.getInstance(graphics).fixFonts(graphics);
@Override public void drawContent(Graphics2D graphics) { DrawFactory.getInstance(graphics).fixFonts(graphics);
fact.fixFonts(graphics); StringBuilder text = new StringBuilder(); AttributedString at = getAttributedString(graphics, text);
/** * Initialize a graphics context for wmf rendering * * @param graphicsCtx the graphics context to delegate drawing calls * @param bbox the bounding box of the wmf (taken from the placeable header) */ public HwmfGraphics(Graphics2D graphicsCtx, Rectangle2D bbox) { this.graphicsCtx = graphicsCtx; this.bbox = (Rectangle2D)bbox.clone(); this.initialAT = graphicsCtx.getTransform(); DrawFactory.getInstance(graphicsCtx).fixFonts(graphicsCtx); }
/** * Compute the cumulative height occupied by the text * * @param oldGraphics the graphics context, which properties are to be copied, may be null * @return the height in points */ public double getTextHeight(Graphics2D oldGraphics) { // dry-run in a 1x1 image and return the vertical advance BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); if (oldGraphics != null) { graphics.addRenderingHints(oldGraphics.getRenderingHints()); graphics.setTransform(oldGraphics.getTransform()); } DrawFactory.getInstance(graphics).fixFonts(graphics); return drawParagraphs(graphics, 0, 0); }
DrawFactory.getInstance(graphics).fixFonts(graphics);
@Override public void drawContent(Graphics2D graphics) { DrawFactory.getInstance(graphics).fixFonts(graphics);
fact.fixFonts(graphics); StringBuilder text = new StringBuilder(); AttributedString at = getAttributedString(graphics, text);