Currently, there is no option to specify the font family of a cell using the Continental nodes extension. Generally when you create a new Excel sheet, it writes everything into the current default body font, Aptos Narrow. Here is a preview of my sample sheet:
However, if you use the XLS Font Formatter node from the Continental extension, it changes the font to Calibri (the previous microsoft default font):
This leads me to believe the Calibri font family is hardcoded somewhere in the Continental nodes code, since obviously it is not using the lastest microsoft default font. This is inconvenient because now the only way to standardize the font across the whole file would be to use the Font Formatter node to change them all to Calibri, but I really prefer Aptos Narrow, and currently there is no way to do that.
Will the Continental nodes extension be updated to use Aptos instead of Calibri? Or could we potentially have the option to specify the font family in the XLS Font Formatter node?
I’ve seen other solutions that use Python to change the font in Excel, but since the backend code of the Continental nodes is changing the font family to Calibri, the capability to do this through the Continental nodes already exists–we just don’t have the option to control it yet.
In the meantime… as you mentioned other solutions using python, I have revisited one of those solutions, which was mentioned here:
The “Excel Font Changer” component included on that link was written in 2021, and used the (now) legacy python nodes.
I have created a new version for use with KNIME 5, to use the new python extension environment rather than the older legacy python nodes.
You will still need to have the openpyxl module installed.
You would include this component in the workflow after the XLS Formatter (Apply) node. Make sure the spreadsheet isn’t open when executing or it will fail! If you need to automatically open the spreadsheet after changing the font, you could additionally pass a path variable representing the spreadsheet to my Open Path component:
Hello @cbirch,
Thanks for pointing this out. Looks interesting. A quick analysis reveals, that we don’t define any standard font in the Continental extension, but rather rely on the underlaying POI Java library to create a font:
I would assume that the your intended feature would best be implemented there. In our extension, we avoided a possibility to define fonts explicitly, as it is a complex topic: list of available fonts is system specific, not all fonts installed on all systems, etc.
So for a currently pending extension update, I unfortunately don’t see an option to change this behaviour. But we will reconsider the possibilities for one of the next updates, hopefully then advancing to a newer version of POI in KNIME as well.
Best regards
Arne