Ejemplo n.º 1
0
 private static void LoadProperties()
 {
     if (propertiesLoaded)
     {
         return;
     }
     lock (allFonts) {
         if (propertiesLoaded)
         {
             return;
         }
         try {
             Stream isp = GetResourceStream(RESOURCE_PATH + "cjkfonts.properties");
             cjkFonts.Load(isp);
             isp.Close();
             isp = GetResourceStream(RESOURCE_PATH + "cjkencodings.properties");
             cjkEncodings.Load(isp);
             isp.Close();
         }
         catch {
             cjkFonts     = new itextProperties();
             cjkEncodings = new itextProperties();
         }
         propertiesLoaded = true;
     }
 }
Ejemplo n.º 2
0
 internal static Hashtable ReadFontProperties(String name)
 {
     try {
         name += ".properties";
         Stream          isp = GetResourceStream(RESOURCE_PATH + name);
         itextProperties p   = new itextProperties();
         p.Load(isp);
         isp.Close();
         IntHashtable W = CreateMetric(p["W"]);
         p.Remove("W");
         IntHashtable W2 = CreateMetric(p["W2"]);
         p.Remove("W2");
         Hashtable map = new Hashtable();
         foreach (string key in p.Keys)
         {
             map[key] = p[key];
         }
         map["W"]  = W;
         map["W2"] = W2;
         return(map);
     }
     catch {
         // empty on purpose
     }
     return(null);
 }