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 name gets overwritten when setting bold font style #93

Open
cymn14 opened this issue Nov 4, 2024 · 0 comments
Open

Font name gets overwritten when setting bold font style #93

cymn14 opened this issue Nov 4, 2024 · 0 comments

Comments

@cymn14
Copy link

cymn14 commented Nov 4, 2024

When setting the font name globally, and then set a bold font style for the header row as an example, the font name is "reset" and has to be set again.

here's my code where that happens:

$excel = Excel::create([$this->sheetName])->setDefaultFont(
    [Style::FONT_NAME => 'Arial'];
);
$sheet = $excel->sheet();
$headerData = $this->getHeaderData();
$sheet->writeHeader(array_keys($headerData))->applyFontStyleBold();

I then have to do this so the header has the default font agian:

$sheet->writeHeader(array_keys($headerData))->applyFontStyleBold()->applyFontName(self::DEFAULT_FONT_NAME);

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

No branches or pull requests

1 participant