// update input font
        private void updateSelectedFont(Font fnt)
        {
            // set text name in the text box
            txtInputFont.Text = FontDescriptor.getFontName(fnt);

            // set the font in the text box
            txtInputText.Font = (Font)fnt.Clone();

            // save into settings
            Properties.Settings.Default.InputFont = fnt;
            Properties.Settings.Default.Save();
        }
        // generate the required output for text
        private static void generateOutputForFont(OutputConfiguration outConfig, Font font, string inputText, StringBuilder textSource, StringBuilder textHeader)
        {
            char[] charactersToGenerate;

            // get the characters we need to generate from the input text, removing duplicates
            charactersToGenerate = getCharactersToGenerate(inputText, outConfig.CodePage, outConfig.generateSpaceCharacterBitmap);

            // do nothing if no chars defined
            if (charactersToGenerate.Length == 0)
            {
                textSource.Clear().Append("No Characters to generate");
                textHeader.Clear();
                return;
            }

            FontDescriptor fontInfo = new FontDescriptor(outConfig, charactersToGenerate, font);

            textSource.Append(fontInfo.TextSource);
            textHeader.Append(fontInfo.TextHeader);
        }
Exemple #3
0
 public CharacterDescriptor(FontDescriptor parentFontInfo, char character)
 {
     ParentFontInfo = parentFontInfo;
     Character      = character;
     SizeCharacter  = TextRenderer.MeasureText(Character.ToString(), ParentFontInfo.Font);
 }
Exemple #4
0
        }                                              // holding the datadescriptor string with visualizer

        public CharacterDescriptor(FontDescriptor parentFontInfo) : this(parentFontInfo, '\0')
        {
        }