Esempio n. 1
0
 private void Initialize2()
 {
     this.format = new StringFormat();
     this.gr     = this.CreateGraphicsBuf();
     //this.gr=this.CreateGraphics();
     this.caret = mwg.Windows.Caret.CreateNew(this);
     this.sd    = new mwg.Drawing.StringDrawer(this);
     this.ime   = new IME(this);
     //
     // caret
     //
     //this.caret.Size=new Size(1,10);
     //
     // sd
     //
     this.sd.LetterSpacing     = 0;
     this.sd.Font              = new System.Drawing.Font("MS ゴシック", 9);
     this.sd.Rectangle         = new Rectangle(10, 10, 200, 200);
     this.sd.Return            = true;
     this.sd.Position          = new PointF(10, 10);
     this.sd.PositionChanged  += new mwg.Drawing.StringDrawer.PositionEvent(sd_PositionChanged);
     this.sd.FontChanged      += new mwg.Drawing.StringDrawer.FontEventHandler(sd_FontChanged);
     this.sd.DirectionChanged += new mwg.Drawing.StringDrawer.FontEventHandler(sd_DirectionChanged);
     //this.sd.Vertical=true;
     //this.sd.RTL=true;
     //
     // ime
     //
     this.ime.Char             += new mwg.Windows.IME.CompositionEventHandler(this.ime_Char);
     this.ime.StartComposition += new EventHandler(this.ime_StartComposition);
 }
Esempio n. 2
0
            public Char(mwg.Drawing.StringDrawer parent, ref int i, ref char[] text)
            {
                if (i >= text.Length)
                {
                    this.initialize(parent, " ");
                    return;
                }
                //TODO:漢字の構成の記号→bool のプロパティを実装
                //TODO:草冠など、特別の物は比率を変える
                if (CMB_LR <= text[i] && text[i] <= CMB_LTRB)
                {
                    this.initialize(parent, " ");
                    System.Drawing.Graphics g = this.CreateGraphics();
                    int j  = (int)text[i++] - (int)CMB_LR;
                    int kM = CMB_RATES[j].Length / 4;
                    for (int k = 0; k < kM; k++)
                    {
                        this.DrawChar(
                            g, new Char(parent, ref i, ref text),
                            CMB_RATES[j][k * 4], CMB_RATES[j][k * 4 + 1], CMB_RATES[j][k * 4 + 2], CMB_RATES[j][k * 4 + 3]
                            );
                    }
                    return;
                }
                //中心文字の取得
                string x = text[i++].ToString();

                //修飾子の付加
                while (i < text.Length)
                {
                    if ('\x300' <= text[i] && text[i] < '\x370')
                    {
                        x += text[i].ToString();
                    }
                    else
                    {
                        this.initialize(parent, x);
                        return;
                    }
                    i++;
                }
                this.initialize(parent, x);
            }
Esempio n. 3
0
 public Char(mwg.Drawing.StringDrawer parent, string text)
 {
     this.initialize(parent, text);
 }
Esempio n. 4
0
 public FontEventArgs(mwg.Drawing.StringDrawer sender) : this(sender.Font, (int)sender.LineHeight, sender.Vertical)
 {
 }