Prev | Current Page 357 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

As a result,
you can configure an element to use Arial Regular, set the FontWeight property to Bold, and
be confident that WPF will switch over to the Arial Bold typeface.
When choosing a font, you must supply the full family name, as shown here:

It??™s much the same in code:
cmd.FontFamily = "Times New Roman"
cmd.FontSize = "18"
When identifying a FontFamily, a shortened string is not enough. That means you can??™t
substitute Times or Times New instead of the full name Times New Roman.
Optionally, you can use the full name of a typeface to get italic or bold, as shown here:

However, it??™s clearer and more flexible to use just the family name and set other properties
(such as FontStyle and FontWeight) to get the variant you want. For example, the following
markup sets the FontFamily to Times New Roman and sets the FontWeight to FontWeights.Bold:

Text Decorations and Typography
Some elements also support more advanced text manipulation through the TextDecorations
and Typography properties. These allow you to add embellishments to text. For example, you
can set the TextDecorations property using a shared property from the TextDecorations class.


Pages:
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369