'Can someone break down the Panose property for me?
I'm working with PowerPoint and I've got an element like this:
<a:latin typeface="Arial" panose="020B0604020202020204" pitchFamily="34" charset="0"/>
I understand conceptually that the panose property rolls up a bunch of properties in a coded string, but all the docs have this in a format that is not hex, like this value here. I tried converting this to decimal, but it yielded results that didn't line up with the panose domain, as far as I could tell.
Solution 1:[1]
Okay, I hammered on this for a while and figured it out, I think. That hex string in the panose property needs to be converted to a ten-byte array. I stole this answer to do that:
Enumerable.Range(0, hex.Length)
.Where(x => x % 2 == 0)
.Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
.ToArray();
Once you have that byte array, each position represents a different aspect of the custom font:
- Family Kind
- Serif Style
- Weight
- Proportion
- Contrast
- Stroke Variation
- Arm Style
- Letterform
- Midline
- X-height
Keep in mind indexes, positions, and off-by-one errors there. Each has a value from 0 to 15 (natch), indicating different values for each font quality, which are enumerated here.
The particular aspect I was focused on was font-weight, which is represented at position 3, index 2.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Chris B. Behrens |
