Last post Jul 28, 2017 03:35 AM by wibowowiwit
Jul 26, 2017 07:00 AM|wibowowiwit|LINK
i have little question,
how to import font from downloaded font into RDLC Report.
please suggest me how to do it ? bellow is my visual studio font properties view..
or please tell me configure font style from codebehind ?
Thanks & Regards.
Wibowo Wiwit Siregar
Jul 26, 2017 06:43 PM|bobj181|LINK
Font is a function of the operating system, not an individual application. Please research how to add fonts to your (most likely windows) operating system.
Also, take into consideration this, because fonts are a function of the operating system, not every user will have custom fonts and therefore will view the default font for their PC.
Jul 27, 2017 02:52 AM|Eric Du|LINK
According to your description, I think you could use CSS method to load font file, then use it in CSS.
How to add some non-standard font to a website?
CSS3 Web Fonts:
Jul 27, 2017 03:33 AM|wibowowiwit|LINK
Hi Eric Du,
Thanks for your answer, I mean not to website but reportviewer (using RDLC reportviewer)
wibowo wiwit siregar
Jul 27, 2017 04:56 AM|Self Image|LINK
If you only need the font for a heading or two, or for a barcode column then you can make a column on the dataset of Image type, and premake the images as text to bitmaps
// From dreaming in code
/// Function for converting text to a Bitmap object
/// <param name="width">Width of the image</param>
/// <param name="height">Height of the image</param>
/// <param name="str">String to be converted</param>
/// <param name="textColor">Color we want the text</param>
/// <param name="recColor">Color we want the background</param>
/// <param name="f">Name of the font we want used</param>
public Bitmap ConvertTextToBitmap(ref int width, ref int height, ref string str, ref Color textColor, ref Brush recColor, ref string fontName)
using (Bitmap bmp = new Bitmap(width, height))
using (Graphics gfx = Graphics.FromImage((Image)bmp))
gfx.SmoothingMode = SmoothingMode.AntiAlias;
Font font = new Font(fontName, 11, FontStyle.Regular, GraphicsUnit.Pixel);
gfx.FillRectangle(Brushes.Transparent, new Rectangle(0, 0, bmp.Width, bmp.Height));
gfx.FillRectangle(recColor, 0, 0, width, height);
gfx.DrawString(str, font, new SolidBrush(textColor), 2, 3);
bmp.Save(Application.StartupPath + "\\" + str + ".bmp", ImageFormat.Bmp);
You could also make a Custom Report Item to replace the default textbox etc, but from all experiences these are a big PITA.
Try this, Hope this will help. If you need more help, We are here to help you as we are the Leading Web Design Company in San Diego.
Visit us, https://selfimagemedia.com
Jul 28, 2017 03:35 AM|wibowowiwit|LINK
I got the answer, your custom fonts should be installed on Operating System (eg : Windows), but my visual studio only accept .ttf font type