Esempio n. 1
0
        /*
         *        METHODS: validators
         */


        public bool FValidate(int indGlyphMin, int indGlyphMax)
        {
            if (indGlyphMin < 0)
            {
                indGlyphMin = 0;
            }
            if ((indGlyphMax < 0) || (indGlyphMax >= this.FNumGlyph))
            {
                indGlyphMax = this.FNumGlyph - 1;
            }
            int indGlyph;

            for (indGlyph = indGlyphMin; indGlyph <= indGlyphMax; indGlyph++)
            {
                Glyph glyph = this.GGet(indGlyph);
                glyph.GValidate();

                if (this.i_ProgressUpdater != null)
                {
                    if (this.i_ProgressUpdater.ToStop)
                    {
                        this.i_ProgressUpdater.UpdateStatus("Validated glyphs: from glyph " + indGlyphMin + " to glyph " + indGlyph);
                        this.i_ProgressUpdater.UpdateProgress(GConsts.IND_UNINITIALIZED);
                        break;
                    }
                    else
                    {
                        this.i_ProgressUpdater.UpdateStatus("Validating Font: from glyph " + indGlyphMin + " to glyph " + indGlyphMax);
                        this.i_ProgressUpdater.UpdateProgress(100.0 * (float)(indGlyph - indGlyphMin) / (float)(indGlyphMax - indGlyphMin));
                        this.i_ProgressUpdater.UpdateProgress(indGlyph);
                    }
                }
            }
            if (indGlyph == indGlyphMax + 1)
            {
                if (this.i_ProgressUpdater != null)
                {
                    this.i_ProgressUpdater.UpdateStatus("Font Validated: from glyph " + indGlyphMin + " to glyph " + indGlyphMax);
                    this.i_ProgressUpdater.UpdateProgress(GConsts.IND_UNINITIALIZED);
                    this.i_ProgressUpdater.TaskCompleted();
                }
            }
            //this.gStore.DumpToFile();
            return(true);
        }
Esempio n. 2
0
 internal void OnGErrQuery(int indGlyph)
 {
     if ((0 <= indGlyph) && (indGlyph < this.FNumGlyph))
     {
         if (this.indGM.Contains(indGlyph))
         {
             Glyph glyph = this.gStore.GGet(indGlyph);
             if (glyph != null)
             {
                 glyph.GValidate();
             }
         }
     }
     if (indGlyph == GConsts.IND_ALL)
     {
         foreach (int ind in this.indGM)
         {
             this.OnGErrQuery(ind);
         }
     }
 }