コード例 #1
0
        void Test()
        {
            Font.NewStroke stroke_font = new Font.NewStroke();
            string         s;
            SizeF          text_size;

            k.TextEffects effects = new k.TextEffects();
            effects.font.Size = new SizeF(1f, 1f);

            s         = "H";
            text_size = stroke_font.GetTextSize(s, effects);
            Trace(string.Format("text size {0} = {1}, {2}", s, text_size.Width, text_size.Height));

            s         = "Hello";
            text_size = stroke_font.GetTextSize(s, effects);
            Trace(string.Format("text size {0} = {1}, {2}", s, text_size.Width, text_size.Height));
        }
コード例 #2
0
        void testFont(k.Pcb.kicad_pcb k_pcb)
        {
            Font.NewStroke stroke_font = new Font.NewStroke();
            k.TextEffects  effects     = new k.TextEffects();
            effects.font.Size      = new SizeF(2.54f, 2.54f);
            effects.font.thickness = 0.15f;
            stroke_font.DrawText(k_pcb, new PointF(25.4f, 25.4f), "Hello", effects, k.Layer.Drawings);

            SizeF extent = stroke_font.GetTextSize("Hello", effects);

            DrawRect(k_pcb, new PointF(25.4f, 25.4f), extent, 0);
        }