Example #1
0
        public static FontBase AddFontFromFile(string fileName)
        {
            byte[]   buf  = FontDataLoader.LoadFontFromFile(fileName);
            FontBase font = loadFromBuffer(buf, 0);

            _fromFile.Add(font);
            return(font);
        }
Example #2
0
        public static FontBase AddFont(string fontName, bool bold, bool italic)
        {
            LOGFONT lf = FontDataLoader.GetLOGFONT(fontName, bold, italic);

            if (_fonts.ContainsKey(lf))
            {
                return(_fonts[lf]);
            }

            uint ttc;

            byte[]   data = FontDataLoader.LoadFont(lf, out ttc);
            FontBase font = loadFromBuffer(data, ttc);

            _fonts.Add(lf, font);

            return(font);
        }