Blog

All Blog Posts  |  Next Post  |  Previous Post

A farewell to Calibri

Friday, August 4, 2023

Some weeks ago, Microsoft released a new default theme and font for all Office applications, replacing the old Calibri. Yesterday, we updated FlexCel (VCL, .NET, and DLL), so you can now create a new file with those defaults too. It goes without saying, the old FlexCel versions will still work with the newer files, but if you want to make a new file from scratch using the new defaults, go and grab FlexCel 7.18.

But in this post, I wanted to discuss something I haven't seen discussed often: at the time of writing, the new Aptos font is not available as a "Windows font" but as a "Cloud font" instead. Cloud fonts are nice in theory, but they have the big problem that they are only available to Office, so Windows (and your app) won't see them. And if your app doesn't find the font, it will use some substitute that will likely have different metrics, causing your layout to break when you print or export to PDF from FlexCel.

As a blog post gets buried by newer posts soon, we also published a new tip on how to deal with the new font here: https://doc.tmssoftware.com/flexcel/vcl/tips/cloud-fonts.html


Now, going back to our problem: The metrics of Aptos are very different from Calibri. Here is some example text to compare them:

Excel file with 3 lines

The first line is Aptos 11, the second is Calibri 11, and just for fun, I added Arial 10 for the third line. As you can see, Aptos is narrower, so text that might fit in a column when using Aptos, might not fit anymore once you see this file with an app that is not Office and that uses a substitute font.
You can also see in the screenshot that even Excel is not completely nailing this new "cloud font" stuff. If you look closely at column D, the gridline at the right of cell D1 is missing because Excel thinks the text doesn't fit in there even when there is a lot of space. Interstingly, cells D2 and D3 show the gridline, even when the text is wider. Why would Excel think that the text in D1 doesn't fit? Well, likely, it is using the substitute font instead of the cloud font for that measurement. This bug will probably be fixed soon, but I wanted to mention it to show that the whole thing might not be fully mature yet.

Now, let's compare it with what FlexCel sees. But before going into that, as FlexCel mimics a "Print Preview", let's see what Excel shows in Print Preview:

TMS Software Delphi  Components

Ok, now the line with Calibri goes well into column E. That's not the same, but that's expected, and we can't do much about it.

So let's compare it with the FlexCel Preview:

TMS Software Delphi  Components


What is this? Now the first line is wider than the other two. How is this happening? But before you ask for that deserved refund on your FlexCel purchase, let me say in its defense that it did the best it could. It asked Windows for the Aptos font, but Windows couldn't find it because it is a cloud font, so it returned a "substitute" font that Windows believes might be similar to this Aptos thing it doesn't know about. If you are curious, you can export this file to PDF and use this tip to find out which font FlexCel is actually using. Spoiler alert, the first line is in Arial 11. This same thing will happen in LibreOffice or Google Docs, or any other app that is not Office.

For example, this is Google Docs showing the file:

TMS Software Delphi  Components

Note how the Aptos text in A1 was directly replaced with Arial.

So to end up this post, let's try installing Aptos in Windows itself and reopening the preview:

TMS Software Delphi  Components

Much better now. That's as near the print preview in Excel as we are going to get. And just for completeness, now with the font properly installed Excel doesn't show the glitch at the end of D1 anymore:

Excel With Font installed

So that's another reason to install the fonts in Windows directly and not use the cloud font approach. We hope the new fonts will be distributed with Windows soon, but until then, it might make sense to wait and stay with Calibri or Arial.



Adrian Gallero




This blog post has received 5 comments.


1. Friday, August 4, 2023 at 2:05:05 PM

Very interesting.

ian hamilton


2. Friday, August 4, 2023 at 10:26:22 PM

Is installing or using this font with non-Microsoft products a viable option? Seems they''re up to their usual antics there. Why not make the font easily available everywhere?

Andrew Simard


3. Saturday, August 5, 2023 at 1:06:25 AM

@Andrew: Right now the font is not available, but ms said it will be available in the future. But I am not sure what the licensing will be

Adrian Gallero


4. Friday, August 11, 2023 at 2:56:26 PM

Hello
Do you know PDF/A3 files? (new supplier invoice format for example)?
It is a combined file (a PDF + an integrated XML file) to retrieve the values without going through an OCR (unreliable)

Menant Didier


5. Monday, August 14, 2023 at 6:57:10 AM

Hi,
FlexCel supports PDF/A3 files, you can see an example here: https://doc.tmssoftware.com/flexcel/vcl/samples/delphi/printing-and-exporting/pdfa/index.html
But note that the idea of PDF/A3 is not that it is PDF+XML (you can easily retrieve the values without OCR in a standard PDF file). The "A" in PDF/A stands for "Archive", and the idea of PDF/A is that it is a format you should still be able to read it 100 years from now. There are many things you need to do to support that, like for example the file format can''t change, the fonts must be embedded (because 100 years from now you might not have access to the fonts), etc.

See also https://doc.tmssoftware.com/flexcel/vcl/guides/pdf-exporting-guide.html#creating-pdfa-files

Adrian Gallero




Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post