Examples of registerFont()


Examples of java.awt.GraphicsEnvironment.registerFont()

        for (String fontFile[] : fontFiles) {
            File f = new File(fontFile[0]);
            assumeTrue("necessary font file "+f.getName()+" not downloaded.", f.exists());
           
            Font font = Font.createFont(Font.TRUETYPE_FONT, f);
            ge.registerFont(font);
           
            Map<String,String> map = ("mapped".equals(fontFile[1]) ? fontMap : fallbackMap);
            map.put(fontFile[2], font.getFamily());
        }
       
View Full Code Here

Examples of java.awt.GraphicsEnvironment.registerFont()

      chancerFont = Font.createFont(Font.TRUETYPE_FONT, chancerFile).deriveFont(Font.PLAIN, 25);
    } catch (FontFormatException | IOException ex) {
      Logger.getLogger(GamePanel.class.getName()).log(Level.SEVERE, null, ex);
      System.out.println("Can't open font.");
    }
    ge.registerFont(chancerFont);
    return chancerFont;
  }

  private void setBar(Graphics g) {
    g.setColor(Color.WHITE);
View Full Code Here

Examples of java.awt.GraphicsEnvironment.registerFont()

     */
    public static void main(String[] args) throws ParserConfigurationException, SAXException {
        try {
            Font f = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(new File("").getAbsolutePath()+"/other/Neuton-Bold.ttf")).deriveFont(Font.PLAIN);
            GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
            genv.registerFont(f);
        } catch(Exception e) {
            System.out.println(e);
        }
       
        SyberiadaFrame frame = SyberiadaFrame.getSyberiadaFrame();
View Full Code Here

Examples of java.awt.GraphicsEnvironment.registerFont()

     */
    public static void main(String[] args) throws ParserConfigurationException, SAXException {
        try {
            Font f = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(new File("").getAbsolutePath()+"/other/Neuton-Bold.ttf")).deriveFont(Font.PLAIN);
            GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
            genv.registerFont(f);
        } catch(Exception e) {
            System.out.println(e);
        }
       
        SyberiadaFrame frame = SyberiadaFrame.getSyberiadaFrame();
View Full Code Here

Examples of java.awt.GraphicsEnvironment.registerFont()

        } else if (aNazwa.equalsIgnoreCase("Neutron")) {
            try {
                f = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream(new File("").getAbsolutePath()+"/other/Neuton-Bold.ttf")).deriveFont(Font.PLAIN, aSize);
                super.setFont(f);
                GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
                genv.registerFont(f);
            } catch(Exception e) {
                System.out.println(e);
            }
        }
    }
View Full Code Here

Examples of java.awt.GraphicsEnvironment.registerFont()

  public FontManager() {
    GraphicsEnvironment ge = GraphicsEnvironment
        .getLocalGraphicsEnvironment();
    try {
      // register all the needed font here
      ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(
          "data/font/visitor1.ttf")));
    } catch (FontFormatException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IOException e) {
View Full Code Here

Examples of org.apache.fop.afp.fonts.AFPPageFonts.registerFont()

        // register font as necessary
        String internalFontName = getInternalFontNameForArea(text);
        Map/*<String,FontMetrics>*/ fontMetricMap = fontInfo.getFonts();
        AFPFont font = (AFPFont)fontMetricMap.get(internalFontName);
        AFPPageFonts pageFonts = paintingState.getPageFonts();
        AFPFontAttributes fontAttributes = pageFonts.registerFont(internalFontName, font, fontSize);
        Font fnt = getFontFromArea(text);

        if (font.isEmbeddable()) {
            CharacterSet charSet = font.getCharacterSet(fontSize);
            try {
View Full Code Here

Examples of org.apache.fop.afp.fonts.AFPPageFonts.registerFont()

        // register font as necessary
        Map<String, Typeface> fontMetricMap = documentHandler.getFontInfo().getFonts();
        final AFPFont afpFont = (AFPFont)fontMetricMap.get(fontKey);
        final Font font = getFontInfo().getFontInstance(triplet, fontSize);
        AFPPageFonts pageFonts = getPaintingState().getPageFonts();
        AFPFontAttributes fontAttributes = pageFonts.registerFont(fontKey, afpFont, fontSize);

        final int fontReference = fontAttributes.getFontReference();

        final int[] coords = unitConv.mpts2units(new float[] {x, y} );
View Full Code Here

Examples of org.apache.fop.afp.fonts.AFPPageFonts.registerFont()

        // register font as necessary
        Map/*<String,FontMetrics>*/ fontMetricMap = documentHandler.getFontInfo().getFonts();
        final AFPFont afpFont = (AFPFont)fontMetricMap.get(fontKey);
        final Font font = getFontInfo().getFontInstance(triplet, fontSize);
        AFPPageFonts pageFonts = getPaintingState().getPageFonts();
        AFPFontAttributes fontAttributes = pageFonts.registerFont(fontKey, afpFont, fontSize);

        final int fontReference = fontAttributes.getFontReference();

        final int[] coords = unitConv.mpts2units(new float[] {x, y} );

View Full Code Here

Examples of org.geotools.renderer.style.FontCache.registerFont()

    void reloadFontCache() {
        List<Font> fonts = loadFontsFromDataDirectory();
        final FontCache cache = FontCache.getDefaultInstance();
        cache.resetCache();
        for (Font font : fonts) {
            cache.registerFont(font);
        }
    }

    List<Font> loadFontsFromDataDirectory() {
        List<Font> result = new ArrayList<Font>();
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.