Example #1
0
        void GenericTest()
        {
            SetUp(20, 20);

            var rt = new Drawing.RichText();

            rt.Span("Hello World")
            .Bold("bold")
            .NewLine()
            .Italic("italic")
            .Underline("underline")
            .NewLine()
            .Regular("new line")
            .Superscript("superscript")
            .Subscript("subscript")
            .SetStyles(paragraphSpacing: 2.0f)
            .NewLine()
            .SetStyles(halign: ReoGridHorAlign.Right)
            .Span("right aligned")
            .NewLine()
            .Span("back color", backColor: SolidColor.LightCoral)
            .Span("fore color", textColor: SolidColor.DarkOrange)
            .Span("big font", fontSize: 28)
            .Span("small font", fontName: "Arial", fontSize: 6f)
            .NewLine()
            .Span("end")
            ;

            worksheet["A1"] = rt;
        }
Example #2
0
        public RichTextTestForm()
        {
            InitializeComponent();

            this.DoubleBuffered = true;

            //rt = new Drawing.RichText()
            //	.Bold("Mary Celeste").Regular(" was an American merchant brigantine.")
            //	.NewLine()
            //	.Regular("The ").Span("final entry", textColor: Color.Blue)
            //	.Span(" in the log, ")
            //	.Span("dated ten days", fontSize: 40f)
            //	.Span(" a previously, was a ", fontSize: 10.25f, textColor: Color.Black)
            //	.Span("日本語テスト", textColor: Color.LightBlue)
            //	.Span("汉字测试,这是一本《难得的过》", textColor: Color.DarkGreen)
            //	.Span(" routine statement", textColor: Color.DarkRed)
            //	.Span(" of the ship's position.", textColor: Color.Black)
            //	.Span(" admin", textColor: Color.Red)
            //	.Span("istrator", textColor: Color.HotPink)
            //	;
            rt = new Drawing.RichText()
                 .Span("aaaaa bbbbb ccccc ddddd", fontSize: 20f)
                 .Span(" bbbbb eeeee fffff ggggg").NewLine()
                 .Span(" ccccc ddddd hhhhh iiiii")
                 .Span(" ddddd")
                 //	;
                 //rt = new Drawing.RichText()
                 .Span("ABC", fontSize: 40)
            ;

            rt.TextWrap = TextWrapMode.WordBreak;

            rt.RotationAngle = 0;
        }
Example #3
0
        void CopyRichText()
        {
            var rt = new Drawing.RichText();

            rt.Span("Hello ").Bold("World").Regular("!");

            worksheet["B1"] = rt;
            var pg = worksheet.GetPartialGrid("B1");

            worksheet.SetPartialGrid("C1", pg);

            AssertTrue(worksheet.GetCellData("C1").GetType() == typeof(Drawing.RichText));
            AssertSame(worksheet.GetCellText("C1"), "Hello World!");
        }
Example #4
0
        private void RichTextDemo_Load(object sender, EventArgs e)
        {
            sheet.MergeRange("B2:F6");

            sheet.Cells["B2"].Style.TextWrap = TextWrapMode.WordBreak;

            sheet["B2"] = new Drawing.RichText()
                          .Regular("The ")
                          .Bold("Rich Text Format")
                          .Regular(" (often abbreviated ")
                          .Bold("RTF")
                          .Regular(") is a proprietary")
                          .Superscript("[6][7][8]")
                          .Regular(" document file format with published specification developed by Microsoft Corporation from ")
                          .Span("1987", textColor: Color.OrangeRed)
                          .Span(" until ", textColor: Color.Black)
                          .Span("2008", textColor: Color.OrangeRed)
                          .Span(" for cross-platform document interchange with Microsoft products.", textColor: Color.Black);
        }
Example #5
0
        public RichTextDemo()
        {
            InitializeComponent();

            var sheet = grid.CurrentWorksheet;

            sheet.MergeRange("B2:F6");

            sheet["B2"] = new Drawing.RichText()
                          .Regular("The ")
                          .Bold("Rich Text Format")
                          .Regular(" (often abbreviated ")
                          .Bold("RTF")
                          .Regular(") is a proprietary")
                          .Superscript("[6][7][8]")
                          .Regular(" document file format with published specification developed by Microsoft Corporation from ")
                          .Span("1987", textColor: SolidColor.OrangeRed)
                          .Span(" until ", textColor: SolidColor.Black)
                          .Span("2008", textColor: SolidColor.OrangeRed)
                          .Span(" for cross-platform document interchange with Microsoft products.", textColor: SolidColor.Black);

            sheet.Cells["B2"].Style.TextWrap = TextWrapMode.WordBreak;
        }