Example #1
0
        private void initializeControls()
        {
            fontListView.View = System.Windows.Forms.View.Details;
            fontListView.Columns.Add("Font Name", 300, HorizontalAlignment.Left);

            foreach (Font font in FontUtil.getInstalledFonts())
            {
                FontItem fontItem = new FontItem(font.Name, font.ToString());
                fontListView.Items.Add(fontItem);
            }
        }
Example #2
0
        private void paintSampleTextAt(string sampleText, string fontName, int row)
        {
            FontFamily fontFamily = new FontFamily(fontName);
            Font       font       = new Font(fontFamily, runtimeConfig.SampleSize, FontUtil.getFirstSupportedStyle(fontFamily), GraphicsUnit.Pixel);


            int x = 200;
            int y = lastRow.Equals(0) ? 0 : lastRow;

            lastRow = lastRow + font.Height + 10;
            paintFontName(fontName, y);
            paintFontSample(sampleText, font, x, y);

            paintLine();
        }
Example #3
0
        public void refreshSingleFontView(string familyName)
        {
            FontFamily fontFamily = new FontFamily(familyName);
            Font       font;

            try
            {
                font = new Font(fontFamily, runtimeConfig.SampleSize, runtimeConfig.SampleFontStyle);
            }
            catch (Exception exce)
            {
                font = new Font(fontFamily, runtimeConfig.SampleSize, FontUtil.getFirstSupportedStyle(fontFamily));
            }

            fontViewRichTextBox.Font = font;
            fontViewRichTextBox.Text = runtimeConfig.SampleText;
        }