Bug 140881 - LO fails opening WOFF and WOFF2 fonts
Summary: LO fails opening WOFF and WOFF2 fonts
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: low normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:24.2.0
Keywords:
Depends on:
Blocks: console-noise
  Show dependency treegraph
 
Reported: 2021-03-08 13:48 UTC by Eyal Rozenberg
Modified: 2023-08-24 20:23 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
tarball of the woffs and ttf triggering the error message (100.89 KB, application/x-compressed-tar)
2022-05-17 21:13 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2021-03-08 13:48:51 UTC
I run LO on a Linux system with some locally-installed fonts. Specifically, there are a few font families named "OS Aran FFC 400", "OS Aran FFC 600" etc installed (they're from freefonts.co.il originally). They're .woff files (Web Open Font Format), although if I use `file` on them, it also says "TrueType".  I also have a dingbat font named "ITC Zapf Dingbats", a TTF file.

When I start a recent LO daily, I get, among others, the following log lines:

warn:vcl.fonts:19907:19907:vcl/unx/generic/fontmanager/fontmanager.cxx:664: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_400ffc-webfont.woff": 6
warn:vcl.fonts:19907:19907:vcl/unx/generic/fontmanager/fontmanager.cxx:664: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_r_600ffc-webfont.woff": 6
warn:vcl.fonts:19907:19907:vcl/unx/generic/fontmanager/fontmanager.cxx:664: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_w_500ffc-webfont.woff": 6
warn:vcl.fonts:19907:19907:vcl/unx/generic/fontmanager/fontmanager.cxx:664: Could not OpenTTFont "/usr/local/share/fonts/windows/ITC Zapf Dingbats.ttf": 6

These files seem to open fine with a font viewer, so - why the errors? The log message don't say what the exact problem is.
Comment 1 Eyal Rozenberg 2021-03-08 14:13:52 UTC
Version info:

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: c1659be6ff0e0c91e0c7d1e6acb6ab18821e2bf7
CPU threads: 4; OS: Linux 5.9; UI render: default; VCL: gtk3
Locale: en-US (en_IL); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-03-02_06:18:34
Comment 2 Xisco Faulí 2021-03-08 19:51:52 UTC
(In reply to Eyal Rozenberg from comment #0)
> These files seem to open fine with a font viewer, so - why the errors? The
> log message don't say what the exact problem is.

Those are warning, not errors. Apart from the logs, is there any bug on the documents? Otherwise, this should be closed as RESOLVED NOTABUG
Comment 3 Eyal Rozenberg 2021-03-08 20:17:01 UTC
(In reply to Xisco Faulí from comment #2)
> Those are warning, not errors.

Let me rephrase: Why the failures opening the files, if the fonts are ok and usable?

Also, when I think about it - why is LO trying to open any fonts it's not actively using, when I haven't even started Writer?
Comment 4 Xisco Faulí 2021-03-09 07:41:43 UTC
(In reply to Eyal Rozenberg from comment #3)
> (In reply to Xisco Faulí from comment #2)
> > Those are warning, not errors.
> 
> Let me rephrase: Why the failures opening the files, if the fonts are ok and
> usable?

again, it's not a failure, it's a warning
Comment 5 Eyal Rozenberg 2021-03-09 18:13:45 UTC
(In reply to Xisco Faulí from comment #4)
> again, it's not a failure, it's a warning

The message is a warning. The content of the message tells us about a _failure_ to open the font file.
Comment 6 Robert Großkopf 2021-10-15 07:28:23 UTC
Changed component. Has nothing to do with Base, the database module.
Comment 7 Eyal Rozenberg 2021-10-16 16:01:45 UTC
With a newer build, I get a sequence of such warnings twice:
```
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:429: Unimplemented mac encoding 18432 to unicode conversion for fontname Kammer
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_400ffc-webfont.woff": 6
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_400ffc-webfont.woff2": 6
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_r_600ffc-webfont.woff": 6
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_r_600ffc-webfont.woff2": 6
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_w_500ffc-webfont.woff": 6
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_w_500ffc-webfont.woff2": 6
warn:sal.textenc:2797:2797:sal/textenc/textcvt.cxx:187: Missing rtl_TextToUnicodeConverter
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:429: Unimplemented mac encoding 18432 to unicode conversion for fontname YoavKtav Black
warn:vcl.fonts:2797:2797:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/windows/ITC Zapf Dingbats.ttf": 6
warn:vcl.gdi:2814:2814:vcl/source/font/fontcharmap.cxx:223: Format 4 char should not be 0xFFFF
warn:sal.textenc:2814:2814:sal/textenc/textcvt.cxx:187: Missing rtl_TextToUnicodeConverter
warn:sal.textenc:2814:2814:sal/textenc/textcvt.cxx:187: Missing rtl_TextToUnicodeConverter
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:429: Unimplemented mac encoding 18432 to unicode conversion for fontname Kammer
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_400ffc-webfont.woff": 6
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_400ffc-webfont.woff2": 6
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_r_600ffc-webfont.woff": 6
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_r_600ffc-webfont.woff2": 6
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_w_500ffc-webfont.woff": 6
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/freefonts.co.il/‏‏‏‏OS-Aran-Free-V2.00/OS-Aran-FFC-Webfonts/os_aran_w_500ffc-webfont.woff2": 6
warn:sal.textenc:2814:2814:sal/textenc/textcvt.cxx:187: Missing rtl_TextToUnicodeConverter
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:429: Unimplemented mac encoding 18432 to unicode conversion for fontname YoavKtav Black
warn:vcl.fonts:2814:2814:vcl/unx/generic/fontmanager/fontmanager.cxx:665: Could not OpenTTFont "/usr/local/share/fonts/windows/ITC Zapf Dingbats.ttf": 6
```
Comment 8 Eyal Rozenberg 2021-12-14 19:35:15 UTC
Bug still manifests with:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 250e4886d85a7e131da76f181b3fa7be02d1a76d
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US

and the same errors.
Comment 9 Timur 2022-05-17 11:39:27 UTC
This bug needs a sample so that it can be tested.
Comment 10 Eyal Rozenberg 2022-05-17 16:52:36 UTC
(In reply to Timur from comment #9)
> This bug needs a sample so that it can be tested.

Sample of what?
Comment 11 Timur 2022-05-17 17:27:01 UTC
(In reply to Eyal Rozenberg from comment #10)
> (In reply to Timur from comment #9)
> > This bug needs a sample so that it can be tested.
> 
> Sample of what?

Sample of useless questions and philosophy... or woff as reported.
Comment 12 tripleo 2022-05-17 21:10:16 UTC
(In reply to Timur from comment #11)

> Sample of useless questions and philosophy... or woff as reported.

https://duckduckgo.com/?t=ffab&q=os_aran_400ffc-webfont.woff&ia=web

First result:

http://freefonts.co.il/css/fonts/os_aran_400ffc-webfont.woff


I don't know if this is what he is talking about or if it's what you are talking about, but...
Comment 13 Eyal Rozenberg 2022-05-17 21:13:45 UTC
Created attachment 180173 [details]
tarball of the woffs and ttf triggering the error message
Comment 14 QA Administrators 2022-05-18 03:36:40 UTC Comment hidden (obsolete)
Comment 15 Timur 2022-05-18 08:47:21 UTC
I don't see why both WOFF and TTF are reported, when it's different. 
Also ITC Zapf Dingbats is IIUC commercial font and it should not be attached here. Xisco, please remove. 

Let this bug be about WOFF. WOFF wasn't supported and it would be an Enhancement. 
But I couldn't find a way to "install" WOFF in Windows and Linux. 
There's a decompression but that's a different. 
So 2 questions here:
1. how did you install WOFF?
2. can you use them in some other editor?
Comment 16 Eyal Rozenberg 2022-05-18 16:39:31 UTC
(In reply to Timur from comment #15)
> I don't see why both WOFF and TTF are reported, when it's different. 
> Also ITC Zapf Dingbats is IIUC commercial font and it should not be attached
> here. Xisco, please remove. 

Sorry, I wasn't looking at the license.

> Let this bug be about WOFF. WOFF wasn't supported and it would be an
> Enhancement. 

I don't particularly care about WOFF support - this bug is about trying to open the WOFFs as TTFs and failing.

> But I couldn't find a way to "install" WOFF in Windows and Linux. 

> There's a decompression but that's a different. 
> So 2 questions here:
> 1. how did you install WOFF?

I didn't; it's just some files in a collection of fonts I unpacked into /usr/local/share/fonts. Then fc-cache just does its thing I guess.

> 2. can you use them in some other editor?

I can use them in LO Writer, actually... but that may be because there are also `.woff2` files with the same base names. And in other apps too, I can't really tell whether it's the .woff or .woff2 which gets used.
Comment 17 QA Administrators 2022-05-19 03:38:09 UTC Comment hidden (obsolete)
Comment 18 Timur 2022-05-19 08:56:37 UTC
Hm. I found woff and woff2 in /usr/share/fonts/woff/
But since those also had ttf, I downloaded another one. 
WPS and MSO used it but LO couldn't. So I set this to New for WOFF and WOFF2. 
There's another bug for WOFF in SVG.
Comment 19 ⁨خالد حسني⁩ 2022-10-01 12:05:58 UTC
WOFF and WOFF2 are compressed OpenType/TrueType fonts for use on the web (where file size matters). While WOFF uses GZIP for compression and is somewhat relatively easy to decompress, WOFF2 uses Brotli compression and on top of that many font tables are transformed to compress better and need to de-transformed back (I wrote the WOFF2 test suite for the W3C webfonts working group). Supporting such fonts will require at least a couple of extra dependencies for very little gain since Linux system are the only systems that allow installing these fonts.

Also installing WOFF/WOFF2 files is a bad idea, if your distribution did this report it as a bug, and installing multiple formats of the same fonts is even worse, also report to your distribution.

FontConfig does not provide a way to distinguish WOFF/WOFF2 from regular fonts, they are reported as their contained font, so we have no way to filter them out as we do with Type 1 and bitmap fonts other than sniffing the fonts (I don’t even think FontConfig intentionally support WOFF/WOFF2, it just happens to work for it because it uses FreeType to identify the fonts and FreeType supports them).

My suggestion is WONTFIX unless someone has a clear idea what to do here.
Comment 20 Eyal Rozenberg 2022-10-01 22:28:53 UTC
(In reply to خالد حسني from comment #19)
> Supporting such fonts will require at least a couple of
> extra dependencies for very little gain since Linux system are the only
> systems that allow installing these fonts.

I don't have a strong opinion on this. Although - the dependency could be in Linux only, i.e. only use the dependencies when building on Linux.

> FontConfig does not provide a way to distinguish WOFF/WOFF2 from regular
> fonts, they are reported as their contained font

>,we have no way to
> filter them out... other than sniffing the fonts

And would it not makes sense to do this sniffing when we fail to load TTF fonts?
Comment 21 ⁨خالد حسني⁩ 2022-10-02 06:54:41 UTC Comment hidden (obsolete)
Comment 22 Eyal Rozenberg 2022-10-02 10:48:36 UTC Comment hidden (obsolete)
Comment 23 ⁨خالد حسني⁩ 2022-10-02 19:26:56 UTC
(In reply to Eyal Rozenberg from comment #22)
> (In reply to خالد حسني from comment #21)
> > But that is basically what is happening here, the code is detecting that it
> > is a font it cannot handle and rejects it.
> 
> But then there's no need to warn: It's just a font that's in a format that
> we chose not to support.
> 
> Note that this bug was filed because of the console noise.

I don’t see why the warning is a bad thing, if you installed a font you want to know why LibreOffice ignored it.
Comment 24 Eyal Rozenberg 2022-10-03 13:58:55 UTC
(In reply to خالد حسني from comment #23)
> I don’t see why the warning is a bad thing,

Because it adds console lines about something that's not a problem, but intentional.

I am also not sure this NeedsUXEval, since the console is not part of most user's experience, but since you wanted to ask for it - ok.
Comment 25 Heiko Tietze 2022-10-04 12:52:51 UTC
(In reply to خالد حسني from comment #19)
> Supporting such fonts will require at least a couple of
> extra dependencies for very little gain since Linux system are the only
> systems that allow installing these fonts.
> 
> Also installing WOFF/WOFF2 files is a bad idea...
> 
> My suggestion is WONTFIX unless someone has a clear idea what to do here.

Concur.

(In reply to Eyal Rozenberg from comment #24)
> I am also not sure this NeedsUXEval...

It's a warning, something developer information above information but below errors. Ordinary users don't start from the console.
Comment 26 Eyal Rozenberg 2022-10-04 13:12:40 UTC
(In reply to Heiko Tietze from comment #25)
> It's a warning, something developer information above information but below
> errors. Ordinary users don't start from the console.

We're talking about developers/QA people; note also the meta-bug tracking it.  In this situation - it is not a failure or error or misconfiguration of the system for a WOFF file to exist; and it is the intended behavior of LO to not-load it. In this case - only an INFO-level or DEBUG-level message should be logged, not WARNING-level.

Removing these warnings will clear the console log for the person reading to better notice _actual_ warnings about unexpected and possibly-problematic situations.

Please consider reopening.
Comment 27 Heiko Tietze 2022-10-05 12:47:29 UTC
(In reply to Eyal Rozenberg from comment #26)
> Please consider reopening.

Feel free to do so. I don't mind whether it is SAL_WARNING() or SAL_INFO() - and hacking it is very easy. Maybe a good start for you?
Comment 28 Eyal Rozenberg 2022-10-05 13:34:57 UTC
Reopening merely for reducing the severity of the log message (SAL_WARNING() to SAL_INFO()).
Comment 29 ⁨خالد حسني⁩ 2023-08-03 17:58:22 UTC
The message is gone with c7ac7a5eb8746d443ad70317e80b1575c4291153, now preventing loading WOFF/WOFF2 file depends on FontConfig 

https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/375
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/288
Comment 30 Commit Notification 2023-08-24 20:23:21 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5ca5acdd6e12fec08927743b60899100bc89af4d

tdf#140881: Ignore WOFF/WOFF2 fonts with FontConfig

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.