How to transform a font into bold ?

  • Thread starter Thread starter Herve Bocuse
  • Start date Start date
H

Herve Bocuse

Hi,

I have a C# font instance. I would like to instanciate a font equal to this
one but with the bold attribute. What is the shortest way to create the
second one from the first one ?

Thank you

Herve
 
Create a new font from the current font:
Font font = new Font(...);
// Variant instantation, use the current font as the prototype, only
changing the font style.
font = new Font(font, FontStyle.Bold);
 
So easy, thank you.

Dennis Myrén said:
Create a new font from the current font:
Font font = new Font(...);
// Variant instantation, use the current font as the prototype, only
changing the font style.
font = new Font(font, FontStyle.Bold);
 
Hi,

You can clone the existing font object and use the property FontStyle.Bold
to set the font to bold.
 
Back
Top