Examples of FontRenderContext


Examples of java.awt.font.FontRenderContext

   * @see Graphics2D#getFontRenderContext()
   */
  public FontRenderContext getFontRenderContext() {
      boolean antialias = RenderingHints.VALUE_TEXT_ANTIALIAS_ON.equals(getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING));
      boolean fractions = RenderingHints.VALUE_FRACTIONALMETRICS_ON.equals(getRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS));
      return new FontRenderContext(new AffineTransform(), antialias, fractions);
  }
View Full Code Here

Examples of java.awt.font.FontRenderContext

      g2.setFont(new Font(fontName, style, fontSize));
    }

    final Font f = g2.getFont();
    final FontMetrics fm = g2.getFontMetrics(f);
    final FontRenderContext frc = g2.getFontRenderContext();
    final double y = area.getCenterY();

    final int highest = getHighest();
    for (int i = getLowest(); i <= highest; i++)
    {
View Full Code Here

Examples of java.awt.font.FontRenderContext

    if (lineStartPos == endPos)
    {
      return 0;
    }

    final FontRenderContext frc = DefaultSizeCalculator.getFrcDetector().createFontRenderContext();

    if (chars.length < text.length())
    {
      chars = new char[Math.max(chars.length + 100, text.length())];
    }
View Full Code Here

Examples of java.awt.font.FontRenderContext

      // so that fonts were always rendered with FractionalMetrics enabled.
      // Since 1.4, fonts are always rendered with FractionalMetrics disabled.

      // On a 1.4 version, the aliasing has no influence on non-fractional metrics
      // aliasing has no influence on any version if fractional metrics are enabled.
      final FontRenderContext frcAlias = new FontRenderContext(null, true, false);
      final FontRenderContext frcNoAlias = new FontRenderContext(null, false, false);
      final Font font = new Font("Serif", Font.PLAIN, 10);
      final String myText = "A simple text with some characters to calculate the length.";

      final double wAlias = font.getStringBounds(myText, 0, myText.length(), frcAlias)
          .getWidth();
View Full Code Here

Examples of java.awt.font.FontRenderContext

    {
      if (fontRenderContext == null)
      {
        if (isAliased())
        {
          fontRenderContext = new FontRenderContext(null, isAliased(), true);
        }
        else
        {
          // buggy is only important on non-aliased environments ...
          // dont use fractional metrics on buggy versions

          // use int_metrics wenn buggy ...
          fontRenderContext = new FontRenderContext(null, isAliased(), isBuggyVersion() == false);
        }
      }
      return fontRenderContext;
    }
View Full Code Here

Examples of java.awt.font.FontRenderContext

            tableFilter.setTableHeader(getTableHeader());
            setModel(tableFilter);
            setRowSelectionAllowed(false);
      setColumnSelectionAllowed(false);
      Font f = getFont();
      fontRendererContext = new FontRenderContext(f.getTransform(), false, false);
      setRowHeight((int)f.getMaxCharBounds(fontRendererContext).getHeight());
      renderer=createTableRenderer(tableModel);
      addMouseListener(LoggingPanel.this);
    }
View Full Code Here

Examples of java.awt.font.FontRenderContext

      Line2D lLine = new Line2D.Double(center_x, center_y, lX, lY );
          g.setColor(Color.black);
          g.draw(lLine);

          // draw the label
          lLabel = new TextLayout("" + model.getColumnValueAt(lCol), new Font("Courier", Font.BOLD, 9), new FontRenderContext(null, true, false));
          g.setColor(Color.black);
           
            // Move the labels in the lower half circle down a bit, so the upper left corner touches the axis
            if ((lRotation <= Math.PI / 2) && (lRotation >= -Math.PI / 2))
                lY += lLabel.getBounds().getHeight();
View Full Code Here

Examples of java.awt.font.FontRenderContext

        else
           pointzero = yaxis1.transform(new Point2D.Float((float)con.getMinimumColumnValue(),
                                                         0f),
                                        null);
        
        FontRenderContext columnTopfrc = null;
        LineMetrics lm = null;
        DecimalFormat df = null;
        Rectangle2D fontRec = null;
        String columnTop = null;
        if (barTopFormat != null) {
            g.setFont(barTopFont);
            columnTopfrc = new FontRenderContext(null, false, false);
        }
        /* We paint the values starting at x-value "0".
         * As we only render BarCharts for ChartDataModels with
         * non-numeric x-axis values we don't have to read those
         * values from the data model. You can look in
View Full Code Here

Examples of java.awt.font.FontRenderContext

@Component
public class TextServiceImpl implements TextService {

  public Rectangle2D getStringBounds(String text, FontStyleInfo fontStyle) {
    Font font = getFont(fontStyle);
    return font.getStringBounds(text, 0, text.length(), new FontRenderContext(new AffineTransform(), true, true));
  }
View Full Code Here

Examples of java.awt.font.FontRenderContext

     * @return a non-null Dimension object
     */
    public Dimension getPreferredSize() {
        Rectangle2D titleBounds =
            getFont().getStringBounds(getText(),
                                      new FontRenderContext(null, true, false));
       
        return new Dimension((int)titleBounds.getWidth(),
                             (int)titleBounds.getHeight());
    }   
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.