/**
 * 
 */
package org.zkoss.zss.model.impl.pdf;

import com.lowagie.text.FontFactory;

/**
 * Internal Use Only.
 * @author ashish
 *
 */
/*package*/ class FontLoader {
	
	   private volatile static FontLoader singleton;
	 
	   
	   private FontLoader()
	   {
		   FontFactory.registerDirectories();
	   }
	 
	   // synchronized keyword has been removed from here
	   public static FontLoader getInstance(){
	     // needed because once there is singleton available no need to acquire
	     // monitor again & again as it is costly
	     if(singleton==null) {
	       synchronized(FontLoader.class){
	          // this is needed if two threads are waiting at the monitor at the
	          // time when singleton was getting instantiated
	          if(singleton==null)
	          singleton= new FontLoader();
	       }
	    }
	   return singleton;
	  }

}
