Beispiel #1
0
        private void PopulateFonts()
        {
            List<string> fontNames = new List<string>();

            using (Graphics g = this.CreateGraphics())
            {
                FontFamily[] families = FontFamily.GetFamilies(g);

                foreach (FontFamily family in families)
                {
                    using (FontInfo fi = new FontInfo(family, 10, FontStyle.Regular))
                    {
                        if (!fontNames.Contains(family.Name) && fi.CanCreateFont())
                        {
                            fontNames.Add(family.Name);
                        }
                    }
                }
            }

            staticFontNames = fontNames;
        }
Beispiel #2
0
        private void PopulateFonts()
        {
            List<string> fontNames = new List<string>();

            foreach (FontFamily family in FontFamily.Families)
            {
                using (FontInfo fi = new FontInfo(family, 10, FontStyle.Regular))
                {
                    if (!fontNames.Contains(family.Name) && fi.CanCreateFont())
                    {
                        fontNames.Add(family.Name);
                    }
                }
            }

            staticFontNames = fontNames;
            Tracing.LogFeature("PopulateFonts()");
        }