|
If you want to use a mixture of standard text fonts and symbol
fonts you will need to use the TextCharset property. The following
code does just that.
[Visual Basic]
Dim ca As New Canvas
ca.TextFont = "Times"
ca.TextSize = 24
ca.Color = System.Drawing.Color.Yellow
ca.Width = 300
ca.Height = 200
ca.DrawText("Some text...", "Pos=0,0")
ca.TextCharset = "Symbol"
ca.DrawText("Symbols.", "textfont=Wingdings Pos=0,60")
ca.DrawText("Some more text...", "textcharset=ANSI
textfont=Times Pos=0,120")
ca.SaveAs(Server.MapPath("symboltext.gif"), "")
[C#]
Canvas ca = new Canvas();
ca.TextFont = "Times";
ca.TextSize = 24;
ca.Color = System.Drawing.Color.Yellow;
ca.Width = 300;
ca.Height = 200;
ca.DrawText("Some text...", "Pos=0,0");
ca.TextCharset = "Symbol";
ca.DrawText("Symbols.", "textfont=Wingdings Pos=0,60");
ca.DrawText("Some more text...", "textcharset=ANSI
textfont=Times Pos=0,120");
ca.SaveAs(Server.MapPath("symboltext.gif"), "");
It produces the following output image.

|
|
|