Exemple #1
0
        public void getCols(Func <bool[], int> callback)
        {
            int curCol = _LeftMostPosition;

            foreach (var kv in _CharsInBlock)
            {
                int startCol = kv.Key;
                while (curCol < startCol)
                {
                    callback(OffCol);
                    curCol++;
                }
                CharBitmap bitmap = kv.Value;
                int        cols   = bitmap.Cols;
                curCol += cols;
                for (int i = 0; i < cols; i++)
                {
                    callback(bitmap.GetCol(i));
                }
                //if (kv.Key + cols < _RightMostPosition)
                //{
                //    callback(OffCol);
                //}
            }
        }
Exemple #2
0
 public void AddCharBitmap(CharBitmap charBitmap, bool rtl)
 {
     // rtl only for now
     if (Size > 0)
     {
         _LeftMostPosition--;
     }
     _LeftMostPosition -= charBitmap.Cols;
     _CharsInBlock[_LeftMostPosition] = charBitmap;
 }
Exemple #3
0
        public Font(string filename)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(filename);
            XmlNodeList nodes = doc.DocumentElement.SelectNodes("/font/character");

            foreach (XmlNode node in nodes)
            {
                CharBitmap charBitmap = new CharBitmap(node);
                string     chars      = node.Attributes["char"].Value;
                foreach (char c in chars)
                {
                    Trace.Assert(!_CharToBitmap.ContainsKey(c), "Character already defines");
                    _CharToBitmap.Add(c, charBitmap);
                }
            }
        }