[GH-ISSUE #96] How to keep default font size? #79

Closed
opened 2026-05-05 11:37:40 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @Paxa on GitHub (Feb 27, 2017).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/96

Originally assigned to: @jmcnamara on GitHub.

Whenever I create format it will set font size to 11

I think it should not set font size when we create format, people may change default Excel font size settings in on their computer.
And it should allow to call format_set_font_size(format, 0) to reset to default

What you think? I can create pull request

Originally created by @Paxa on GitHub (Feb 27, 2017). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/96 Originally assigned to: @jmcnamara on GitHub. Whenever I create format it will set font size to 11 I think it should not set font size when we create format, people may change default Excel font size settings in on their computer. And it should allow to call `format_set_font_size(format, 0)` to reset to default What you think? I can create pull request
gitea-mirror 2026-05-05 11:37:40 -06:00
Author
Owner

@jmcnamara commented on GitHub (Feb 27, 2017):

Same comment as #95. Changing the default font changes the row and column sizes which in turn changes object dimensions on the worksheet.

So this isn't supported.

<!-- gh-comment-id:282680840 --> @jmcnamara commented on GitHub (Feb 27, 2017): Same comment as #95. Changing the default font changes the row and column sizes which in turn changes object dimensions on the worksheet. So this isn't supported.
Author
Owner

@Paxa commented on GitHub (Feb 27, 2017):

If some dimensions are not correct we can always specify manually, right?

I try to make some examples:

All font sizes: 11 (current code)
screen shot 2017-02-27 at 21 10 54

All fonts sizes: 20
screen shot 2017-02-27 at 21 10 00

Using system settings (no font-size specified)
screen shot 2017-02-27 at 21 12 59

How can I see affected size calculations?

If we specify bigger font size for every fields in a document, will size calculations be affected?

<!-- gh-comment-id:282717443 --> @Paxa commented on GitHub (Feb 27, 2017): If some dimensions are not correct we can always specify manually, right? I try to make some examples: All font sizes: 11 (current code) ![screen shot 2017-02-27 at 21 10 54](https://cloud.githubusercontent.com/assets/26019/23362648/b0e405ee-fd31-11e6-921e-523cbd3ff9b7.png) All fonts sizes: 20 ![screen shot 2017-02-27 at 21 10 00](https://cloud.githubusercontent.com/assets/26019/23362617/9485b67c-fd31-11e6-87ef-e72d636898d7.png) Using system settings (no font-size specified) ![screen shot 2017-02-27 at 21 12 59](https://cloud.githubusercontent.com/assets/26019/23362659/bfdd4880-fd31-11e6-98a5-438fbc3af6a2.png) How can I see affected size calculations? If we specify bigger font size for every fields in a document, will size calculations be affected?
Author
Owner

@jmcnamara commented on GitHub (Feb 27, 2017):

If some dimensions are not correct we can always specify manually, right?

Yes. If the row height or column width changes you can scale your images accordingly via the APIs.

How can I see affected size calculations?

You can see that in your screenshots the C image is different sizes. It should be the same as the first one in each of the others.

If we specify bigger font size for every fields in a document, will size calculations be affected?

Yes. The internal calculations for object sizes and positioning is based on default, or user specified, row heights and column widths. Changing the font type or size will affect this.

<!-- gh-comment-id:282770140 --> @jmcnamara commented on GitHub (Feb 27, 2017): > If some dimensions are not correct we can always specify manually, right? Yes. If the row height or column width changes you can scale your images accordingly via the APIs. > How can I see affected size calculations? You can see that in your screenshots the C image is different sizes. It should be the same as the first one in each of the others. > If we specify bigger font size for every fields in a document, will size calculations be affected? Yes. The internal calculations for object sizes and positioning is based on default, or user specified, row heights and column widths. Changing the font type or size will affect this.
Author
Owner

@Paxa commented on GitHub (Feb 28, 2017):

Thank you for detailed explanation. I think now days displays having higher DPI, so I think many people will just set bigger font size for all fields (adding custom format), and that will affect image size calculations:
screen shot 2017-02-28 at 20 17 37

I usually generate xslx files for financial reports, so never needed to insert picture or a chart, and image size calculation will work right only if people use 11th font size, so I think it make sense to let people change default workbook's styles and be able to use users' default font size

I could not make size calculations based on font-size yet (some help would be appreciated), but I add some function to access default format

<!-- gh-comment-id:283027706 --> @Paxa commented on GitHub (Feb 28, 2017): Thank you for detailed explanation. I think now days displays having higher DPI, so I think many people will just set bigger font size for all fields (adding custom format), and that will affect image size calculations: ![screen shot 2017-02-28 at 20 17 37](https://cloud.githubusercontent.com/assets/26019/23405253/58ab0aee-fdf4-11e6-907d-74a78f3120dd.png) I usually generate xslx files for financial reports, so never needed to insert picture or a chart, and image size calculation will work right only if people use 11th font size, so I think it make sense to let people change default workbook's styles and be able to use users' default font size I could not make size calculations based on font-size yet (some help would be appreciated), but I add some function to access default format
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#79
No description provided.