dolanmiu / docx

Easily generate and modify .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
https://docx.js.org/
MIT License
4.44k stars 486 forks source link

Custom size is not applied in "empty" TextRun #2707

Open quentin-ineat-ca opened 3 months ago

quentin-ineat-ca commented 3 months ago

Hello, Thank you for the library.

I use default style at top like : styles: { default: { document: { run: { size: 20, }, }, }, },

I use the classical to make an empty line (I know it could be shorter but for the example). return new Paragraph({ children: [new TextRun({ text: "" })], }); But using the following, the size is not override and staying at the default 20. If text not empty, it's working fine with the correct 40 size. return new Paragraph({ children: [new TextRun({ text: "", size: 40 })], });

In Word, it's possible to increase the font of an empty line. Is it a bug or I do it wrong ? Thank you !