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

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


  private FontManager(){
    fonts = new ArrayList<IFont>();
    suffixToFactory = new HashMap<String, IFontFactory>();
   
    //Register default font factories
    this.registerFontFactory(".ttf", new TTFontFactory());
    this.registerFontFactory(".svg", new SvgFontFactory());
     
    BitmapFontFactory bitmapFontFactory = new BitmapFontFactory();
//    this.registerFontFactory(".ttf", bitmapFontFactory); // TEST
      this.registerFontFactory("", bitmapFontFactory);
View Full Code Here


        && 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();
            VectorFontCharacter[] characters = ttFontFactory.getTTFCharacters(pa, unicode, fillColor, strokeColor, this.fontFileName, this.originalFontSize, this.antiAliased);
            if (characters.length == 1 && characters[0] != null){
              VectorFontCharacter loadedCharacter = characters[0];
              VectorFontCharacter[] newArray = new VectorFontCharacter[this.getCharacters().length + 1];
              System.arraycopy(this.getCharacters(), 0, newArray, 0, this.getCharacters().length);
              newArray[newArray.length-1] = loadedCharacter;
View Full Code Here

TOP

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

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.