Examples of FontRenderContext


Examples of ae.java.awt.font.FontRenderContext

    return gv;
  }

  protected GlyphVector createGV() {
    Font font = source.getFont();
    FontRenderContext frc = source.getFRC();
    int flags = source.getLayoutFlags();
    char[] context = source.getChars();
    int start = source.getStart();
    int length = source.getLength();
View Full Code Here

Examples of com.google.code.appengine.awt.font.FontRenderContext

     * @return current font render context
     */
    public FontRenderContext getFontRenderContext() {
        // NOTE: not sure?
        // Fixed for VG-285
        return new FontRenderContext(new AffineTransform(1, 0, 0, 1, 0, 0),
                true, true);
    }
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.font.FontRenderContext

     * @param context the specified Graphics context
     *
     * @return a FontRenderContext of the specified Graphics context.
     */
    private FontRenderContext getFRCFromGraphics(Graphics context){
        FontRenderContext frc;
        if (context instanceof Graphics2D) {
            frc = ((Graphics2D)context).getFontRenderContext();
        } else {
            frc = new FontRenderContext(null, false, false);
        }

        return frc;

    }
View Full Code Here

Examples of java.awt.font.FontRenderContext

    g.drawString(text, x0, y0);
  }
 
  private void computeDimensions(Graphics g, Font font, FontMetrics fm) {
    String s = text;
    FontRenderContext frc = ((Graphics2D) g).getFontRenderContext();
    width = fm.stringWidth(s);
    ascent = fm.getAscent();
    descent = fm.getDescent();
    int[] xs = new int[s.length()];
    int[] ys = new int[s.length()];
View Full Code Here

Examples of java.awt.font.FontRenderContext

  }

  public static void testFont ()
  {
    Font font = new Font ("Coronet", Font.ITALIC, 80); //$NON-NLS-1$
    FontRenderContext frc = new FontRenderContext(null, true, true);
    char[] chars = new char[('z' - 'a')];
    double[] charW = new double[chars.length];

    for (int i = 0; i < chars.length; i++)
    {
View Full Code Here

Examples of java.awt.font.FontRenderContext

                if (bounds.getMaxY() > maxY)
                    maxY = bounds.getMaxY();
            }
           
            if (text != null && text.length() > 0) {
                FontRenderContext context = g2.getFontRenderContext();
                TextLayout layout = new TextLayout(text, getFont(), context);
                Rectangle2D bounds = layout.getBounds();
                g2.setColor(getForeground());
                layout.draw(g2, (float) (width - bounds.getWidth()) / 2,
                        (float) (maxY + layout.getLeading() + 2 * layout.getAscent()));
 
View Full Code Here

Examples of java.awt.font.FontRenderContext

  {
    final boolean antialias = RenderingHints.VALUE_TEXT_ANTIALIAS_ON.equals(getRenderingHint(
        RenderingHints.KEY_TEXT_ANTIALIASING));
    final 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.translate(-x, -y);
    x += b.getWidth() / 2.0 + 3.0;
    g2.setFont(this.font);

    final FontRenderContext frc = g2.getFontRenderContext();
    final Font f = g2.getFont();
//    final FontMetrics fm = g2.getFontMetrics(f);
    final LineMetrics metrics = f.getLineMetrics(label, frc);
    final float ascent = metrics.getAscent();
    final float halfAscent = ascent / 2.0f;
View Full Code Here

Examples of java.awt.font.FontRenderContext

    void compute() {
        float lt1;
        float ln1;
        float lt2;
        float ln2;
        FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true);
        gv = font.createGlyphVector(frc, str);
        Rectangle2D r = gv.getLogicalBounds();
        w = r.getWidth();
        angle = 0;
        int nseg = llpoints.length / 2 - 1;
View Full Code Here

Examples of java.awt.font.FontRenderContext

    protected void renderString(Graphics g, String string, int x, int y) {
        if (g instanceof Graphics2D) {
            Graphics2D g2 = (Graphics2D) g;
            if (getTextMatteColor() != null) {
                FontRenderContext context = g2.getFontRenderContext();
                GlyphVector glyphVector = g2.getFont()
                        .createGlyphVector(context, string);
                Shape outline = glyphVector.getOutline();
                g2.translate(x, y);
                g2.setStroke(getTextMatteStroke());
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.