I am reviewing image generation code that uses FontFamily.GenericSansSerif from the system.drawing namespace. I typically see code like that at the tail end of xhtml/css font selection statements as a fall back / last resort if a more desireable (specific) font is not discovered. In the .net framework, what are the environmental parameters that will affect which font this actually selects? Is there some sort of chart out there that states how the .net framework selects the font when you specify GenericSansSerif?
In terms of GenericSansSerif
, it will try to return the family from the following fonts by name "Microsoft San Serif", "Arial", "Tahoma" in that order. If none of those fonts are installed, it appears it picks the family of the first installed font, ordered by name.
In terms of GenericSerif
, it tries to return the family from the font named "Times New Roman". If that isn't installed the same rules as GenericSanSerif
are used. i.e. if you remove the "Times New Roman" font, it's the same as calling GenericSanSerif
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With