Examples of FontRenderContext


Examples of java.awt.font.FontRenderContext

          JTextArea consHelpTextArea = new JTextArea();
          consHelpFrame.setLocation(xloc, yloc);
          consHelpFrame.add(consHelpPanel);
          consHelpFrame.setVisible(true);
          Graphics2D gc = (Graphics2D) consHelpPanel.getGraphics();
         FontRenderContext context = gc.getFontRenderContext();
           Rectangle2D bounds = df.getStringBounds(" ", context);
          int mwidth =(int) bounds.getWidth()*150;
          int mheight =(int) bounds.getHeight()*20;
        
           consHelpFrame.setSize(mwidth, mheight);
View Full Code Here

Examples of java.awt.font.FontRenderContext

  public TextConsole(int width, int height, int fontSize, String fontName) {
    font = new Font(fontName, Font.BOLD, fontSize);
    widthChars = width;
    heightChars = height;
    setFont(font);
    FontRenderContext fontRenderContext = new FontRenderContext(null, true,
        true);
    Rectangle2D stringBounds = font.getStringBounds(new char[] { 'l' }, 0,
        1, fontRenderContext);
    setPreferredSize(new Dimension(
        (int) ((widthChars + 1) * stringBounds.getWidth()),
View Full Code Here

Examples of java.awt.font.FontRenderContext

      double shearX = rng.nextDouble() * 0.2;
      double shearY = rng.nextDouble() * 0.2;
      CharAttributes cf = new CharAttributes(ch, fontName, rotation, rise, shearX, shearY);
      charAttsList.add(cf);
      text = new TextLayout(ch + "", getFont(fontName), new FontRenderContext(null, false,
        false));
      textAt = new AffineTransform();
      textAt.rotate(rotation);
      textAt.shear(shearX, shearY);
      shape = text.getOutline(textAt);
View Full Code Here

Examples of java.awt.font.FontRenderContext

         * but the docs say nothing about what particular character is used.
         * '0' looks a good choice.
         */
        char defaultChar = '0';
      
        FontRenderContext frc = new FontRenderContext(null, true, true);

        HSSFWorkbook wb = new HSSFWorkbook(book);
        HSSFFont defaultFont = wb.getFontAt((short) 0);

        str = new AttributedString("" + defaultChar);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.