Bug 131349 - FILESAVE: default fonts selected in Cell Style are getting changed while saving to XLSX & XLS format
Summary: FILESAVE: default fonts selected in Cell Style are getting changed while savi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx
Depends on:
Blocks: XLSX 130796
  Show dependency treegraph
 
Reported: 2020-03-15 09:04 UTC by Joseph
Modified: 2024-06-04 17:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
default fonts selected in Cell Style (123.26 KB, image/png)
2020-03-15 09:05 UTC, Joseph
Details
fonts after re-opening the xlsx file (124.69 KB, image/png)
2020-03-15 09:06 UTC, Joseph
Details
ods sample file (11.90 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-03-15 09:07 UTC, Joseph
Details
xlsx sample file (5.28 KB, application/zip)
2020-03-15 09:08 UTC, Joseph
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph 2020-03-15 09:04:27 UTC
Description:
I've selected the fonts Liberation Sans for English (India) and Baloo Chettan 2 for Malayalam as default in Cell Styles. When I save the sheet in XLSX or XLS format and reopen it, fonts for both languages are getting changed to Arial! No issues while saving in ODS.

Steps to Reproduce:
1. Set Cell Style: Default fonts for English (India) and Malayalam to Liberation Sans and Baloo Chettan 2 [https://fonts.google.com/specimen/Baloo+Chettan+2] respectively.
2. Add some dummy English and Malayalam text [https://charapara.in/] in Sheet.
3. Save the sheet in XLSX or XLS and re-open it.

Actual Results:
Fonts selected in Cell Styles: Default are getting changed to Arial.

Expected Results:
Fonts selected in Cell Styles: Default should be preserved.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.3.5.2 (x64)
Build ID: dd0751754f11728f69b42ee2af66670068624673
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-IN (en_IN); UI-Language: en-GB
Calc: threaded
Comment 1 Joseph 2020-03-15 09:05:49 UTC
Created attachment 158690 [details]
default fonts selected in Cell Style
Comment 2 Joseph 2020-03-15 09:06:55 UTC
Created attachment 158691 [details]
fonts after re-opening the xlsx file
Comment 3 Joseph 2020-03-15 09:07:50 UTC
Created attachment 158692 [details]
ods sample file
Comment 4 Joseph 2020-03-15 09:08:42 UTC
Created attachment 158693 [details]
xlsx sample file
Comment 5 Justin L 2022-09-06 17:45:49 UTC
repro 7.5+

Wow, this is pretty basic stuff. There MUST be a default style in xlsx format isn't there?  Yes - there is, but we don't export to it I guess.

<fonts count="1">
  <font>
    <sz val="20"/>
    <name val="Liberation Sans"/>
  </font>
</fonts>
Comment 6 Justin L 2024-06-04 17:15:51 UTC
repro 24.8+ (looking at the settings in the Default style.)

The language always changes to English (USA), and the font is explicitly Arial.
At first I thought it was probably XclExpFontBuffer::InitDefaultFonts()
    aFontData.maName = "Arial";

However, apparently exchanging Liberation Sans into Arial is _very intentional_, based on XclFontData::FillFromVclFont
    // #106246# substitute with MS fonts
    maName = XclTools::GetXclFontName( rFont.GetFamilyName() );

where maName == Arial when rFont.GetFamilyName() == "Liberation Sans" (at least for the "en" locale).