Use of Percentage as a measurement unit in MSOOXML is inconsistent
Percentages are defined and used inconsistently throughout the MSOOXML specification. This will cause significant confusion and does not leverage on the widely known and accepted HTML type definition.
Defined as a decimal number
The most logical use of a percentage unit is defined in Section 2.15.1.95 page 2053, "zoom" has a "percent" attribute, defined as a "ST_DecimalNumber" which has the usage:
<w:zoom w:percent="71" />
However we can easily improve this to remove ambiguities and promote better readability.
<w:zoom w:factor="71%" />
Unfortunately this “correct” usage of percentage is used only once in the entire 6039 page specification, and the others are far more confusing, as described below.
Defined inconsistently as a enumerated type
There is a strange definition of shadings in section 2.18.85 page 2583, "ST_Shd" (Shading Patterns). This section has an example where a horizontal or diagonal or vertical shading pattern has a 10% coverage is defined as:
<w:shd w:val="pct10" .../>
This is predefined and not adjustable as the shading density is fixed as an enumerated type.
pct5, pct10, pct12, pct15, pct20, pct25, pct30, pct35, pct37 (actually 37.5% coverage), pct40, pct45, pct50, pct55, pct60, pct62 (actually 62.5%), pct65, pct70, pct75, pct80, pct85, pct87 (actually 87.5%) pct90, pct95
In todays modern computer, where the optimum density and patterns can be created on-the-fly, a better and more generalised design of the specification could be
<w:shd w:type="diagonalPattern" w:coverage="63.5%" />
Defined as an abitrary unit
Here is where things get weird. Section 2.18.97 page 2608, "ST_TblWidth" (Table Width Units) define "pct" as fiftieths of a percent, e.g. 4975 = 99.5%.
This is extremely cryptic and not consistent with the rest of the specifications. For example, if we wanted to define the bottom width of a table as a percentage, the current Ecma 376 specifications demand that we use this:
<w:bottom w:w="525" w:type="pct" />
When a more logical and readable specification should read:
<w:bottom w:width="10.5%">
Defined as a thousandth of a percent.
As if modern computers now do not have Floating Point processors, section 5.1.12.41 page 4505, "ST_Percentage" specifies that we denote 1 unit as a 1000ths of a percent. e.g., a value of 54678 represents 54.678%. This is used almost all the other percentage data types in PresentationML and VML. For example in page 4207
<a:p>
<a:rPr baseline="30230"/>
<a:t>Some Text</a:t>
</a:p>
A more intuitive usage would be:
<a:p>
<a:rPr baselineWidth="30.23%"/>
<a:t>Some Text</a:t>
</a:p>
It becomes quite evident that the usage of Percentage units within MSOOXML is inconsistent, immature, hard to read and contradictory within itself and with well established W3C HTML4 standards.
yk
Comments