I'm trying to get the equivalent of a font file's
usWeightClass from the OS2 table to determine a font's boldness in a GlyphTypeface, but I can't figure out where GlyphTypeface is getting it's value of Weight from. Moreover,
FontWeights Class appears to just be an enum of usWeightClass possible values and can't get the Weight Class of a font.
For example, Arial Rounded MT Bold, in a GlyphTypeface, as a value of
Bold, 700. But this is incorrect in terms of it's Weight Class (usWeightClass in the OS2 table), which is actually
400, and the
fsSelection (also in the OS2 table) has bit 6 set, which means "Normal" or "Regular" (i.e. not bold or italic). Obviously, GlyphTypeface is interpretting something in the file to set .Weight = Bold, but I don't know where it is getting its value from.
Dim arialRoundedMTBold As GlyphTypeface = New GlyphTypeface(New Uri("file:///C:/WINDOWS/FONTS/ARLRDBD.TTF"))
Dim weight = arialRoundedMTBold.Weight
Dim weightClass = weight.ToOpenTypeWeight
Console.WriteLine("Weight: " & weight.ToString & ":" & weightClass.ToString)
Is there anyway to get a font's usWeightClass value in .NET?
View Complete Post