Пример #1
0
        public TextFactory(TextFactoryConfig config = null)
        {
            config ??= TextFactoryConfig.Default;
            _cacheable = config.UseCache;
            CharMap    = config.CharMap;
            _fonts     = config.Fonts ?? new List <FontFace>();

            if (config.UseCache)
            {
                Cache = new Dictionary <char, CachedChar>();
            }
        }
Пример #2
0
        protected override Bitmap GetBaseImage()
        {
            TextFactoryConfig config = TextFactoryConfig.Default;

            config.CharMap = CharMap;
            config.Fonts.Add(Font);

            using (TextFactory writer = new TextFactory(config))
            {
                writer.SetFont(Font);
                return(writer.DrawText(Text, Color));
            }
        }