Example #1
0
        private void GlyphListUpdate()
        {
            GlyphList.ListChanged -= GlyphList_ListChanged;
            GlyphList.Clear();
            var font = Static.FontManager.GetPersonaFont(_FontSelect);

            if (font != null)
            {
                foreach (var a in font.DataList)
                {
                    var temp = new FnMpImg()
                    {
                        Index = a.Key,
                        Image = BitmapSource.Create(font.Width, font.Height, 96, 96, font.PixelFormat, font.Palette, a.Value, (font.PixelFormat.BitsPerPixel * font.Width + 7) / 8)
                    };
                    GlyphList.Add(temp);
                }
            }
            var enc = Static.EncodingManager.GetPersonaEncoding(Static.FontManager.GetPersonaFontName(_FontSelect));

            foreach (var a in GlyphList)
            {
                if (enc.Dictionary.ContainsKey(a.Index))
                {
                    a.Char = enc.Dictionary[a.Index].ToString();
                }
            }

            GlyphList.ListChanged += GlyphList_ListChanged;
        }
Example #2
0
        private void GlyphListUpdate()
        {
            GlyphList.ListChanged -= GlyphList_ListChanged;
            GlyphList.Clear();
            var font = Static.FontManager.GetPersonaFont(_FontSelect);

            if (font != null)
            {
                foreach (var a in font.DataList)
                {
                    var pallete = new BitmapPalette(font.Palette.Select(x => System.Windows.Media.Color.FromArgb(x.A, x.R, x.G, x.B)).ToArray());
                    var form    = AuxiliaryLibraries.WPF.Wrapper.Imaging.AuxToWPF(font.PixelFormat);
                    var temp    = new FnMpImg()
                    {
                        Index = a.Key,
                        Image = BitmapSource.Create(font.Width, font.Height, 96, 96, form, pallete, a.Value, (font.PixelFormat.BitsPerPixel * font.Width + 7) / 8)
                    };
                    GlyphList.Add(temp);
                }
            }
            var enc = Static.EncodingManager.GetPersonaEncoding(Static.FontManager.GetPersonaFontName(_FontSelect));

            foreach (var a in GlyphList)
            {
                if (enc.Dictionary.ContainsKey(a.Index))
                {
                    a.Char = enc.Dictionary[a.Index].ToString();
                }
            }

            GlyphList.ListChanged += GlyphList_ListChanged;
        }