Examples of createGlyphVector()


Examples of java.awt.Font.createGlyphVector()

            g2d.setComposite(fSelected
                    ? AlphaComposite.DstOut : AlphaComposite.SrcOver);
            // calculate the bottom left point to draw the text at.
            Font font = g2d.getFont();
            FontRenderContext renderContext = g2d.getFontRenderContext();
            GlyphVector glyphVector = font.createGlyphVector(renderContext, getText());
            Rectangle visualBounds = glyphVector.getVisualBounds().getBounds();
            int x = getWidth() / 2 - g2d.getFontMetrics().stringWidth(getText()) / 2;
            int y = getHeight() / 2 - visualBounds.height / 2 - visualBounds.y;

            // draw the badge text.
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

                // 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

Examples of java.awt.Font.createGlyphVector()

            {
                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

Examples of java.awt.Font.createGlyphVector()

      // Workaround for bug in Font.createGlyphVector(), in review by
      // Sun with review id 108400.
      Font dummyFont = new Font(
        font_.getFamily(), font_.getStyle(), font_.getSize()+1
      );
      dummyFont.createGlyphVector(
        new FontRenderContext(null, antialiasOn_, false),
        phrase_
      );
     
      GlyphVector glyphVector = font_.createGlyphVector(
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

            Font font = new Font(defaultFont.getFamily(),
                                 Font.PLAIN,
                                 fontSizes[i]);
            g.setFont(font);
            g.drawString("aA", 10, 40);
            double width = font.createGlyphVector(frc, "aA").getVisualBounds().getWidth();
            g.translate(width*1.2, 0);
        }

        g.setTransform(defaultTransform);
        g.translate(0, 60);
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

        for(int i=0; i<fontStyles.length; i++){
            Font font = new Font(defaultFont.getFamily(),
                                 fontStyles[i], 20);
            g.setFont(font);
            g.drawString(fontStyleStrings[i], 10, 40);
            double width = font.createGlyphVector(frc, fontStyleStrings[i]).getVisualBounds().getWidth();
            g.translate(width*1.2, 0);
        }

        g.setTransform(defaultTransform);
        g.translate(0, 120);
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

        g.setPaint(fontColor);

        for(int i=0; i<fontFamilies.length; i++){
            Font font = new Font(fontFamilies[i], Font.PLAIN, 18);
            g.setFont(font);
            double height = font.createGlyphVector(frc, fontFamilies[i]).getVisualBounds().getHeight();
            g.translate(0, height*1.4);
            g.drawString(fontFamilies[i], 10, 40);
        }

        //
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

          g.setPaint(fontColor);

          for(int i=0; i<logicalFonts.length; i++){
              Font font = logicalFonts[i];
              g.setFont(font);
              double height = font.createGlyphVector(frc, font.getName()).getVisualBounds().getHeight();
              g.translate(0, height*1.4);
              g.drawString(font.getName(), 10, 0);
          }
    }
}
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

        g.setPaint(fontColor);

        for(int i=0; i<logicalFonts.length; i++){
            Font font = logicalFonts[i];
            g.setFont(font);
            double height = font.createGlyphVector(frc, font.getName()).getVisualBounds().getHeight();
            g.translate(0, height*1.4);
            g.drawString(font.getName(), 10, 0);
        }
    }
}
View Full Code Here

Examples of java.awt.Font.createGlyphVector()

         // Simple String
         String text = "This is a GlyphVector";

         // Get GlyphVector from from
         java.awt.font.GlyphVector gv = font.createGlyphVector(g.getFontRenderContext(),
                                                               text);

         g.drawGlyphVector(gv, 30, 30);
    }
}
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.