question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fonts are completely broken

See original GitHub issue

Currently the first declared font will affect the entire worksheet. It doesn’t seem to matter if you set a column, row, or cell - all of these will affect the whole document with seemingly no way to override it once it’s been set.

It also seems like subsequently declared fonts affect future cells. Are fonts meant to be some sort of stateful thing? It seems like they should be reset unless they have been explicitly declared.

Here’s a simple script to reproduce this issue:

const Excel = require('exceljs');

const wb = new Excel.Workbook();
const ws = wb.addWorksheet('My Sheet');

ws.columns = [
    {header: 'First', key: 'first', width: 10},
    {header: 'Second', key: 'second', width: 10},
];

const a2 = ws.getCell('A2');
const b2 = ws.getCell('B2');

a2.value = 'a2 test';
b2.value = 'b2 test';

a2.font = {
    name: 'Comic Sans MS',
    family: 4,
    size: 16,
    underline: true,
    bold: true
};

b2.font = {
    name: 'Arial Black',
    color: {argb: 'FF00FF00'},
    family: 2,
    size: 14,
    italic: true
};

wb.xlsx.writeFile(__dirname + '/test.xlsx');

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
havietduc91commented, Jul 2, 2019

@trappar + 1 We can down version to resolve this issue, the exact version is "exceljs": "1.12.0" I try it and it’s work pretty perfectly

0reactions
hzamircommented, Jul 31, 2019

supposedly fixed today 1.14.0 found it 15 minutes after it was published.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fonts broken : r/firefox - Reddit
I run Firefox in Windows 7 32 bits. I remember Firefox working perfectly like a year or two ago. Any idea what could...
Read more >
80 Free Broken Fonts - 1001 Fonts
We have 80 free Broken Fonts to offer for direct downloading · 1001 Fonts is your favorite site for free fonts since 2001....
Read more >
Troubleshoot font issues - Adobe Support
Get the latest app · 4 Ways to remove damaged fonts · Remove third-party font management plug-in · Clear the system font cache...
Read more >
Broken Fonts - FontSpace
Looking for Broken fonts? ✓ Click to find the best 124 free fonts in the Broken style. Every font is free to download!...
Read more >
Font broken in many sites/across many browsers - Super User
This is a widespread problem, especially with Helvetica Neue fonts. Here's what worked for me to fix Helvetica Neue and Helvetica Neue Bold ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found