getting Font in my WebControl

G

GaryDean

I writing a webcontrol that I inherited from WebControl. In the control,
me.font is a FontInfo object. I'm producing a crystal report from my
control and to set the font for the report, using Crystal's Applyfont
method, for that, I must have a System.Drawing.Font object. Is there anyway
I can get a Font object from a fontinfo object?
 
S

Steven Cheng[MSFT]

Hello Gary,

As for the ASP.NET FontInfo, it is quite different from the
System.Drawing.Font class.

The ASP.NET FontInfo class is a lightweight type which is built on the fly
and just contains some primitive types(fontname/string, size/integer....).

While the System.Drawing.Font class is a complex class which is mapping to
the win32 system Font object. When you create such a Font object, you
actually create a windows Font GDI handle, and for ASP.NET application
which won't care about the underlying GDI info since the actual rendering
task is done by client browser, use the lightweight FontInfo is sufficient.

For your scenario, the crystal report need to do GDI rendering, so it
require a complex Font GDI object, I think you will have to manually create
a helper function which copy the sub properties from the FontInfo to the
System.Drawing.Font class object.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top