exceljs / exceljs

Excel Workbook Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong base font: hardcoded Calibri instead of font from the document

victornikitin opened this issue · comments

There is a problem with a base font style in a lib:
/xlsx/xform/style/styles-xform.js

Currently a new base font is created for a workbook: Calibri, size 11.
But some documents have another base font style that is set in fonts collection in styles. For example: Arial, 8pt.

Problems:

  1. This font style is used to determine columns size. When a Calibri font in applyed all columns get another width.
  2. This font style can be not mentioned in any columns, rows and cell styles. So after saving the file this font is removed and everything become wrong.

Solution:
I suppose it will be right if library get the first exisiting in document font style and set it to font collection to first position instead of hardcoded Calibri, 11pt.

Is it possible to fix?

@guyonroche could you take a look on it?
I've also created 2 other issues on the same topic