Exemple #1
0
        public FontFamilyInfo GetFontFamilyInfo(string sFontFamily)
        {
            FontFamilyInfo familyInfo = null;

            try
            {
                object o = this.fontFamilyInfos_[sFontFamily];
                if (o != null)
                {
                    familyInfo = (FontFamilyInfo)o;
                }
            }
            catch
            {
            }
            return(familyInfo);
        }
Exemple #2
0
        public EntityManager(FontCollection FontCollection)
        {
            this.fonts_ = null;

            this.fonts_           = FontCollection;
            this.mapper_          = new Entity2FontMapper(this.fonts_, true);
            this.list_            = new ArrayList(5);
            this.fontFamilyInfos_ = new Hashtable(5, 0.5f);
            for (int i = 0; i < this.mapper_.FontTable_Count; i++)
            {
                FontFamilyInfo fontFamilyInfo = new FontFamilyInfo();
                FontTable      fontTable      = this.mapper_.GetFontTable(i);
                fontFamilyInfo.FontFamily = fontTable.FontFamily;
                fontFamilyInfo.Name       = fontTable.Name;
                fontFamilyInfo.CorrectB   = fontTable.CorrectB;
                fontFamilyInfo.CorrectH   = fontTable.CorrectH;
                fontFamilyInfo.CorrectW   = fontTable.CorrectW;
                fontFamilyInfo.CorrectY   = fontTable.CorrectY;
                fontFamilyInfo.CorrectX   = fontTable.CorrectX;
                this.list_.Add(fontFamilyInfo);
                this.fontFamilyInfos_.Add(fontFamilyInfo.FontFamily, fontFamilyInfo);
            }
            this.mapper_.ClearFontTables();
            this.ids_ = new MapItems();
            this.ops_ = new MapItems();
            try
            {
                for (int i = 0; i < this.mapper_.uniCats_.Count; i++)
                {
                    bool            isActive        = false;
                    UnicodeCategory unicodeCategory = this.mapper_.uniCats_.Indexer(i);
                    isActive = false;
                    switch (unicodeCategory.ID)
                    {
                    case 1:
                    case 3:
                    case 4:
                    case 7:
                    case 9:
                    case 11:
                    case 12:
                    case 14:
                    case 0x16:
                    case 0x1d:
                    case 0x1f:
                    case 0x20:
                        isActive = true;
                        break;
                    }
                    this.ids_.Put(unicodeCategory.ID, unicodeCategory.Name, isActive);

                    isActive = false;
                    switch (unicodeCategory.ID)
                    {
                    case 1:
                    case 11:
                    case 12:
                    case 0x10:
                    case 0x11:
                    case 0x12:
                    case 0x18:
                    case 0x19:
                    case 0x1d:
                    case 0x20:
                        isActive = true;
                        break;
                    }
                    this.ops_.Put(unicodeCategory.ID, unicodeCategory.Name, isActive);
                }
                for (int g = 0; g < this.Count; g++)
                {
                    Glyph glyph = this.Get(g);
                    if ((glyph != null) && glyph.IsVisible)
                    {
                        this.ops_.Ref(glyph.Category.ID, true);
                        this.ids_.Ref(glyph.Category.ID, true);
                        if (glyph.FontFamily.Length > 0)
                        {
                            this.ops_.Ref(glyph.Category.ID, false);
                            this.ids_.Ref(glyph.Category.ID, false);
                        }
                    }
                }
            }
            catch
            {
            }
        }
 public EntityManager(FontCollection FontCollection)
 {
     this.fonts_ = null;
     
     this.fonts_ = FontCollection;
     this.mapper_ = new Entity2FontMapper(this.fonts_, true);
     this.list_ = new ArrayList(5);
     this.fontFamilyInfos_ = new Hashtable(5, 0.5f);
     for (int i = 0; i < this.mapper_.FontTable_Count; i++)
     {
         FontFamilyInfo fontFamilyInfo = new FontFamilyInfo();
         FontTable fontTable = this.mapper_.GetFontTable(i);
         fontFamilyInfo.FontFamily = fontTable.FontFamily;
         fontFamilyInfo.Name = fontTable.Name;
         fontFamilyInfo.CorrectB = fontTable.CorrectB;
         fontFamilyInfo.CorrectH = fontTable.CorrectH;
         fontFamilyInfo.CorrectW = fontTable.CorrectW;
         fontFamilyInfo.CorrectY = fontTable.CorrectY;
         fontFamilyInfo.CorrectX = fontTable.CorrectX;
         this.list_.Add(fontFamilyInfo);
         this.fontFamilyInfos_.Add(fontFamilyInfo.FontFamily, fontFamilyInfo);
     }
     this.mapper_.ClearFontTables();
     this.ids_ = new MapItems();
     this.ops_ = new MapItems();
     try
     {
         for (int i = 0; i < this.mapper_.uniCats_.Count; i++)
         {
             bool isActive = false;
             UnicodeCategory unicodeCategory = this.mapper_.uniCats_.Indexer(i);
             isActive = false;
             switch (unicodeCategory.ID)
             {
                 case 1:
                 case 3:
                 case 4:
                 case 7:
                 case 9:
                 case 11:
                 case 12:
                 case 14:
                 case 0x16:
                 case 0x1d:
                 case 0x1f:
                 case 0x20:
                     isActive = true;
                     break;
             }
             this.ids_.Put(unicodeCategory.ID, unicodeCategory.Name, isActive);
             
             isActive = false;
             switch (unicodeCategory.ID)
             {
                 case 1:
                 case 11:
                 case 12:
                 case 0x10:
                 case 0x11:
                 case 0x12:
                 case 0x18:
                 case 0x19:
                 case 0x1d:
                 case 0x20:
                     isActive = true;
                     break;
             }
             this.ops_.Put(unicodeCategory.ID, unicodeCategory.Name, isActive);
         }
         for (int g = 0; g < this.Count; g++)
         {
             Glyph glyph = this.Get(g);
             if ((glyph != null) && glyph.IsVisible)
             {
                 this.ops_.Ref(glyph.Category.ID, true);
                 this.ids_.Ref(glyph.Category.ID, true);
                 if (glyph.FontFamily.Length > 0)
                 {
                     this.ops_.Ref(glyph.Category.ID, false);
                     this.ids_.Ref(glyph.Category.ID, false);
                 }
             }
         }
     }
     catch
     {
     }
 }