Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make font italic and bold

Tags:

c#

fonts

How do you apply multiple font styles to text?

System.Drawing.Font MyFont = new System.Drawing.Font(     thisTempLabel.LabelFont,     ((float)thisTempLabel.fontSize),     FontStyle.Bold + FontStyle.Italic,    // + obviously doesn't work, but what am I meant to do?     GraphicsUnit.Pixel ); 

Thanks for any help!

like image 399
Tom Gullen Avatar asked Mar 18 '11 10:03

Tom Gullen


People also ask

How do I make text bold and italic in HTML CSS?

To bold the text in HTML, use either the strong tag or the b (bold) tag. Browsers will bold the text inside both of these tags the same, but the strong tag indicates that the text is of particular importance or urgency. You can also bold text with the CSS font-weight property set to “bold.”

How do I make text italicized?

</i> tag or <em>… </em> tag. Both the tags have the same functioning, but <em> tag is a phrase tag, which renders as emphasized text.


2 Answers

System.Drawing.Font MyFont = new System.Drawing.Font(     thisTempLabel.LabelFont,     ((float)thisTempLabel.fontSize),     FontStyle.Bold | FontStyle.Italic,     GraphicsUnit.Pixel ); 

Maybe you wanted to use the OR operator (|)

like image 134
usr-local-ΕΨΗΕΛΩΝ Avatar answered Oct 26 '22 03:10

usr-local-ΕΨΗΕΛΩΝ


FontStyle is a flag enum and therefore you can set multiple styles by:

FontStyle.Bold | FontStyle.Italic 
like image 22
anothershrubery Avatar answered Oct 26 '22 03:10

anothershrubery