Hi,
I am wondering why it is so difficult to use colors and fonts in your product. I use the windows color dialog to get a color from the user. Now to use it in the pdf report I have to convert it to an RGBColor object. The RGBColor does not have a FromName method so I have to either use the constructor or match the string name. Matching string names is not a good idea in my opinion and I never want to do that. The RGBColor constructors parameters are either a single or float. The System.Drawing.Color returns the R,G and B values as byte. For the color olive, the r, g, b values are higher than want a single can take, so first I have to convert the byte to float and then create the color. Seems like a lot of work for a simple thing.
I have the same problem with Fonts. I use the Windows font dialog. But then your control cannot use that Font. It wants an OpenTypeFont or another type defined only for this control. The OpenTypeFont constructor wants the path to the ttf file. And there is no easy way to get the path. I have to use DllImport and P/Invoke to get the path, create the font and then use it.
I am wondering why you have designed it this way? Or am I missing something really simple?
Thanks,
Shabnam
Why is it so difficult to use Colors
Re: Why is it so difficult to use Colors
Support · Jun 14, 2010Hello Shabnam,
The only way to use RGB color from the System is to convert them to float or single and pass them to the RgbColor constructor.
You can use the System.Drawing.Font object or system font names to create our font object to use with our page elements. We have added two static methods CanLoadSystemFont() and LoadSystemFont() in our Font class which takes the System.Drawing.Font object or the system font name to check if the system font can be loaded into our Font object.
It is not possible to convert the System Fonts to Opentype fonts. You will have to locate the opentype fonts or get them from some font vendor. If the file name in the Fonts folder has ttf or otf extension, then you can use that font file by passingthe name in the OpenType font constructor.
Thanks,
ceTe Software Support Team