Package org.mt4j.components.visibleComponents.font.fontFactories

Examples of org.mt4j.components.visibleComponents.font.fontFactories.IFontFactory


      if (!unicode.equalsIgnoreCase("missing-glyph")
        && !isInNotAvailableList(unicode)
        && fontFileName != null
        && fontFileName.length() > 0
      ){
        IFontFactory fontFactory = FontManager.getInstance().getFactoryForFileSuffix("");
        if (fontFactory != null && fontFactory instanceof BitmapFontFactory){
          BitmapFontFactory bitmapFontFactory = (BitmapFontFactory)fontFactory;
          if (this.getCharacters().length > 0 && this.getCharacters()[0] != null && this.getCharacters()[0] instanceof MTComponent){
            MTComponent comp = (MTComponent)this.getCharacters()[0];
            PApplet pa = comp.getRenderer();
View Full Code Here


      }else{
        suffix = "";
      }

      //Check which factory to use for this file type
      IFontFactory factoryToUse = this.getFactoryForFileSuffix(suffix);

      //Create the font if we have a factory
      if (factoryToUse != null){
        System.out.println("Loading new font \"" + fontFileName + "\" with factory: " + factoryToUse.getClass().getName());
//        loadedFont = factoryToUse.createFont(pa, fontAbsoultePath, fontSize, fillColor, strokeColor);
        loadedFont = factoryToUse.createFont(pa, fontAbsoultePath, fontSize, fillColor, strokeColor, antiAliased);
        fonts.add(loadedFont);
        if (fonts.size() > CACHE_MAX_SIZE && !fonts.isEmpty()){
          IFont removedFont = fonts.remove(0); //FIXME destroy font, too!
          if (removedFont != null){
            removedFont.destroy();
View Full Code Here

        && !isInNotAvailableList(unicode)
        && fontFileName != null
        && fontFileName.length() > 0
        && fontFileName.endsWith(".ttf")
      ){
        IFontFactory fontFactory = FontManager.getInstance().getFactoryForFileSuffix(".ttf");
        if (fontFactory != null && fontFactory instanceof TTFontFactory){
          TTFontFactory ttFontFactory = (TTFontFactory)fontFactory;
          if (this.getCharacters().length > 0 && this.getCharacters()[0] != null && this.getCharacters()[0] instanceof MTComponent){
            MTComponent comp = (MTComponent)this.getCharacters()[0];
            PApplet pa = comp.getRenderer();
View Full Code Here

TOP

Related Classes of org.mt4j.components.visibleComponents.font.fontFactories.IFontFactory

Copyright © 2018 www.massapicom. 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.