示例#1
0
        public WordWrapperOld(AinFile ainFile, WordWrapOptionsOld wordWrapOptions)
        {
            this.wordWrapOptions = wordWrapOptions;
            characterWidthCache  = new CharacterWidthCache(wordWrapOptions);
            this.ainFile         = ainFile;

            //this.NextLineFunctionName = "R";
            //this.NextLineFunctionCode = " CALLFUNC R ";
            //this.ReduceMarginFunctionName = "顔";
            //this.NextMessageFunctionName = "A";
            //this.NextMessageFunctionCode = " S_PUSH \"\"" + Environment.NewLine +
            //    "\t" + " CALLFUNC A ";
            //this.MaxCharactersPerLineNormal = 56 + 1; //one more
            //this.MaxCharactersPerLineReduced = 41 + 1; //one more
            //this.MaxLinesPerMessage = 3;

            this.maxCharactersPerLine = this.MaxCharactersPerLineNormal;
        }
        private void GetFromFontButton_Click(object sender, EventArgs e)
        {
            string fontName = FontNameComboBox2.Text;
            float  fontSize = 22.0f;

            if (float.TryParse(FontSizeTextBox2.Text, NumberStyles.Number, CultureInfo.InvariantCulture, out fontSize))
            {
            }
            else
            {
                return;
            }
            bool fontBold = FontBoldCheckbox2.Checked;

            using (var font = new Font(fontName, fontSize, fontBold ? FontStyle.Bold : FontStyle.Regular))
            {
                float kanjiWidth = CharacterWidthCache.MeasureString("漢", font);
                KanjiWidthTextBox.Text = kanjiWidth.FloatToString();
            }
        }