OpenXML Filter: run fonts hint improperly handled

Issue #851 resolved
Denis Konovalyenko created an issue

Consequential runs with different meanings of rFonts hint attributes are merged into one run:

On the left is the part of the original document and on the right is the output. For more details please refer to the attached files.

Comments (6)

  1. Denis Konovalyenko reporter

    A bit more information on the issue.

    The document default style:

    <w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorEastAsia" w:hAnsiTheme="minorHAnsi"  w:cstheme="minorBidi"/>
    

    is substituted by default paragraph style:

    <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New"/>
    

    So, every run without rFonts formatting obtains the default.

    Furthermore, the first run with w:hint="eastAsia" attribute (a symbol before ) get the following:

    <w:rFonts w:ascii="SimSun" w:eastAsia="SimSun" w:hAnsi="Far East" w:cs="Courier New" w:hint="eastAsia"/>
    

    And the consequential run () with the default rStyle property is merged with the previous one with the very same hint attribute value:

    <w:rFonts w:ascii="Courier New" w:eastAsia="SimSun" w:hint="eastAsia"/>
    

    The spec says that hint specifies the font type which shall be used to format any ambiguous characters, which are not explicitly stored in the document, and may be mapped into multiple categories of the four available, in the current run. This is primarily used to handle the formatting on the paragraph mark glyph, and other “special” characters.

    And the following table values can be used to select one or another category:

    <cs> (Complex Script Font): Specifies that the font hint for this text run shall be to use the Complex Script font defined on the run via the style hierarchy.

    <default> (High ANSI Font): Specifies that the font hint for this text run shall be to use the High ANSI font defined on the run via the style hierarchy.

    <eastAsia> (East Asian Font): Specifies that the font hint for this text run shall be to use the East Asian font defined on the run via the style hierarchy.

    That is great, but there is nothing said about the <ascii> category which is selected when there is no hint attribute provided! Hence, when the “special” characters are present in the document content, hint attributes and then rFonts properties and then runs mustn’t be merged if their (hint) values are different.

  2. Log in to comment