Package java.awt

Examples of java.awt.Font.createGlyphVector()


                // need to create one
                Element glyphElement
                    = domFactory.createElementNS(SVG_NAMESPACE_URI,
                                                 SVG_GLYPH_TAG);

                GlyphVector gv = commonSizeFont.createGlyphVector(frc, ""+c);
                Shape glyphShape = gv.getGlyphOutline(0);
                GlyphMetrics gm = gv.getGlyphMetrics(0);

                // need to turn the glyph upside down to be in the font
                // coordinate system (i.e Y axis up)
View Full Code Here


     */
    public void drawString(String s, float x, float y) {
        if (super.textAsShapes) {
            Font font = super.getFont();
            FontRenderContext frc = super.getFontRenderContext();
            GlyphVector gv = font.createGlyphVector(frc, s);
            Shape glyphOutline = gv.getOutline(x, y);
            super.fill(glyphOutline);
        } else {
            super.drawString(s, x, y);
        }
View Full Code Here

    }

    private void paintText(Graphics2D g2d) {
        g2d.setPaint(paint);
        Font font = new Font("serif", Font.BOLD, 80);
        GlyphVector gv = font.createGlyphVector(g2d.getFontRenderContext(), "Java");
        g2d.translate(100, 180);
        g2d.fill(gv.getOutline());
    }

    /**
 
View Full Code Here

     */
    public void drawString(String s, float x, float y) {
        if (super.textAsShapes) {
            Font font = super.getFont();
            FontRenderContext frc = super.getFontRenderContext();
            GlyphVector gv = font.createGlyphVector(frc, s);
            Shape glyphOutline = gv.getOutline(x, y);
            super.fill(glyphOutline);
        } else {
            super.drawString(s, x, y);
        }
View Full Code Here

   */
  @Override
  public GlyphVector createGlyphVector(String s, int fontSize) throws FontFormatException, IOException{
    FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true);
    Font font = FontLoader.getInstance().createStranbergFont(fontSize);
    GlyphVector gv = font.createGlyphVector(frc, s);
    return gv;
  }
  /* (non-Javadoc)
   * @see ch.sahits.game.graphic.image.impl.IOpenPatricianPainter#createSteeringWheel(int, float)
   */
 
View Full Code Here

   * @throws IOException
   */
  public GlyphVector createGlyphVector(String s, int fontSize) throws FontFormatException, IOException{
    FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true);
    Font font = FontLoader.getInstance().createStranbergFont(fontSize);
    GlyphVector gv = font.createGlyphVector(frc, s);
    return gv;
  }
  /**
   * Create turned steering wheel. 0% is whole on the left and 100% whole on the right
   * @param width width of the component
View Full Code Here

                cid2Font = (PDCIDFontType2Font)descendantFont;
            }
            if((cid2Font != null && cid2Font.hasCIDToGIDMap()) || isFontSubstituted)
            {
                // we still have to use the string if a CIDToGIDMap is used
                glyphs = awtFont.createGlyphVector(frc, string);
            }
            else
            {
                glyphs = awtFont.createGlyphVector(frc, codePoints);
            }
View Full Code Here

                // we still have to use the string if a CIDToGIDMap is used
                glyphs = awtFont.createGlyphVector(frc, string);
            }
            else
            {
                glyphs = awtFont.createGlyphVector(frc, codePoints);
            }
        }
        else
        {
            // mdavis - fix fontmanager.so/dll on sun.font.FileFont.getGlyphImage
View Full Code Here

            {
                LOG.warn("Changing font on <" + string + "> from <"
                        + awtFont.getName() + "> to the default font");
                awtFont = Font.decode(null).deriveFont(1f);
            }
            glyphs = awtFont.createGlyphVector(frc, string);
        }
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        writeFont(g2d, at, x, y, glyphs);
    }
View Full Code Here

    @Override
    public void drawString(String s, float x, float y) {
        if (super.textAsShapes) {
            Font font = super.getFont();
            FontRenderContext frc = super.getFontRenderContext();
            GlyphVector gv = font.createGlyphVector(frc, s);
            Shape glyphOutline = gv.getOutline(x, y);
            super.fill(glyphOutline);
        } else {
            super.drawString(s, x, y);
        }
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.