Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font issue from styles.xml #254

Open
bba278 opened this issue Jan 22, 2019 · 1 comment
Open

Font issue from styles.xml #254

bba278 opened this issue Jan 22, 2019 · 1 comment
Labels

Comments

@bba278
Copy link

bba278 commented Jan 22, 2019

Hi,

I am successfully reading styles.xml as explained in Styling with XML and I am placing the styles into the Document object constructor.

In my file there is the following style:

<w:style w:type="paragraph" w:styleId="Heading1">
        <w:name w:val="heading 1"/>
        <w:basedOn w:val="Normal"/>
        <w:next w:val="Normal"/>
        <w:link w:val="Heading1Char"/>
        <w:uiPriority w:val="9"/>
        <w:qFormat/>
        <w:rsid w:val="00924361"/>
        <w:pPr>
            <w:keepNext/>
            <w:keepLines/>
            <w:spacing w:after="480" w:line="280" w:lineRule="exact"/>
            <w:outlineLvl w:val="0"/>
        </w:pPr>
        <w:rPr>
            <w:rFonts w:asciiTheme="majorHAnsi" w:eastAsiaTheme="majorEastAsia" w:hAnsiTheme="majorHAnsi"
                      w:cstheme="majorBidi"/>
            <w:b/>
            <w:bCs/>
            <w:caps/>
            <w:sz w:val="28"/>
            <w:szCs w:val="28"/>
        </w:rPr>
    </w:style>

majorHAnsi is defined inside theme1.xml as

<a:fontScheme name="MFLLP">
            <a:majorFont>
                <a:latin typeface="Calibri"/>
                <a:ea typeface=""/>
                <a:cs typeface=""/>
            </a:majorFont>
            <a:minorFont>
                <a:latin typeface="Calibri"/>
                <a:ea typeface=""/>
                <a:cs typeface=""/>
            </a:minorFont>
        </a:fontScheme>

Now, when I create a new document via JS which contains 4 tables per page with some paragraphs inside the cells and apply the Heading1 style from styles.xml to the paragraphs, instead of Calibri, font Cambria is being applied.

Any help as to why this might be happening will be greatly appreciated.

Thanks

@dolanmiu dolanmiu added the bug label Jan 23, 2019
@bba278
Copy link
Author

bba278 commented Jan 25, 2019

Just to add to the previous, I noticed that also the document margins, which my template has, are not loaded properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants