1 50 51 package org.openlaszlo.iv.flash.util; 52 53 import java.util.*; 54 import org.openlaszlo.iv.flash.api.*; 55 import org.openlaszlo.iv.flash.api.text.*; 56 57 64 public final class FontsCollector { 65 66 protected IVVector fonts = new IVVector(); 67 68 public FontsCollector() {} 69 70 public FontDef addFont( Font font, TextBlock tblock ) { 71 for( int i=0; i<fonts.size(); i++ ) { 72 FontDef fdef = (FontDef) fonts.elementAt(i); 73 if( fdef.getFont() == font ) { 74 fdef.addTextBlock(tblock); 75 return fdef; 76 } 77 } 78 FontDef fdef = new FontDef(font, 1); 79 fdef.addTextBlock(tblock); 80 fonts.addElement(fdef); 81 return fdef; 82 } 83 84 public IVVector getFonts() { 85 return fonts; 86 } 87 88 } 89 | Popular Tags |