Bug 64509 - CONFIGURATION: Enhance Font Substitution Table with common commercial and old fonts
Summary: CONFIGURATION: Enhance Font Substitution Table with common commercial and old...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
4.0.3.3 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
: 68880 107115 109525 (view as bug list)
Depends on:
Blocks: Font-Substitution
  Show dependency treegraph
 
Reported: 2013-05-12 21:10 UTC by João Paulo
Modified: 2024-02-28 23:37 UTC (History)
17 users (show)

See Also:
Crash report or crash signature:


Attachments
vcl.xcu partial patch (336.01 KB, patch)
2015-09-04 08:08 UTC, João Paulo
Details
Personal LO replacement table (68.99 KB, image/jpeg)
2018-12-26 12:40 UTC, Timur
Details
Personal LO replacement table (72.73 KB, image/png)
2020-10-20 13:00 UTC, Timur
Details
Personal LO replacement table (80.05 KB, image/png)
2020-11-10 10:49 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description João Paulo 2013-05-12 21:10:37 UTC
Problem description: 

There are many fonts in existence, yet one's system doesn't have it all installed.

There are fonts which originated from real world types (digitized fonts), but each type designer or foundry made it differently from each other.

They are the so called fonts variations, as Adobe Caslon (Carol Twombly based on William Caslon's specimens pages), and ITC Founder's Caslon (digitized by Justin Howes, based on  resources of the St. Bride Printing Library).

And there are fonts whose types originated on the virtual world (virtual typefaces), even if the initial drawings were made on paper. These fonts could have been abandoned by their designers or foundries, but adopted by others; they could have been licensed in such a way the name of the font should be changed; or they could have intended variations for each script so to avoid software issues.

The primary examples for the first case are the TeX GYRE Collection of Fonts (Bonum, Chorus, Cursor, Heros, Pagella, Schola, Termes are all based, respectively, on URW Gothic L, URW Bookman L, URW Chancery L Medium Italic, URW Nimbus Mono L - itself based on IBM's Courier, URW Nimbus Sans - itself based on Helvetica, URW Palladio L, URW Century Schoolbook L, Nimbus Roman No9 L - itself based on Times); for the second case we have the BitStream Vera and DejaVu families of fonts; and for the latter we have the DejaVu and DejaVu LGC (which contains only Latin, Greek, and Cyrillic characters, instead of Chinese, Japanese, Korean and Arabic characters).

To ease the life of many users not typographic savvy, LibreOffice should have a preinstalled font substitution table, at the same time it should indicate when the fonts needed to render a file isn't installed on the system (such as a warning when opening it).

Steps to reproduce:

1. Create a document on a machine which has, for example, the Calligraffiti font installed (a calligraphic font available for free at http://www.fontsquirrel.com/fonts/calligraffiti), and format it to use the font.
2. Send it to another user who doesn't have the font (or just uninstall the font from the system).
3. Open the file on a system without the font.

Current behavior:

LibreOffice doesn't show any messages the font specified on the file doesn't exist on the system; worse, it shows the name of the font on the toolbar and presents it as the sans serif font DejaVu Sans.

Expected behavior:

LibreOffice should warn the user that because the Calligraffiti font isn't available on the system it will use <font name> on its place.

And for the well known families of fonts which have been substituted, such as the TeX GYRE Fonts (http://www.gust.org.pl/projects-1/e-foundry/tex-gyre), LibreOffice could have it prepopulated on the font substitution table.
Operating System: All
Version: unspecified
Comment 1 Julien Nabet 2013-05-18 06:46:46 UTC Comment hidden (obsolete)
Comment 2 João Paulo 2013-05-19 16:36:37 UTC
(In reply to comment #1)
> What's your LO version? on which env are you?

I am running LibreOffice 4.0.3.3 on Windows XP and Vista, but I found this behavior on every LO release since the fork from OpenOffice.org, and also on every OOo release I used then.
Comment 3 João Paulo 2013-05-19 16:43:32 UTC
Maybe I should create another bug for the lack of warning when the font isn't installed on the user's system? Because I realized I reported two bugs:
- the lack of a prepopulated font substitution table (installation issue);
- the lack of a warning the font isn't installed nor substituted (UI issue).
Comment 4 João Paulo 2013-05-19 16:57:20 UTC
I created a small table for well known fonts (and the Lobster font):

Lobster				Lobster Two

Bitstream Vera Sans		DejaVu Sans
Bitstream Vera Sans Mono	DejaVu Sans Mono
Bitstream Vera Serif		DejaVu Serif

CenturySchL			TeXGyreSchola
NimbusMonL			TeXGyreCursor
NimbusMono			TeXGyreCursor
NimbusRomanNo9			TeXGyreTermes
NimbusRomNo9L			TeXGyreTermes
NimbusSanL			TeXGyreHeros
NimbusSanLCon			TeXGyreHerosCn
URWBookmanL			TeX Gyre Bonum
URWChanceryLMed			TeXGyreChorus
URWGothicL			TeXGyreAdventor
URWGothicLDem			TeXGyreAdventor
URWPalladioL			TeXGyrePagella

And a small table for fonts that always should be substituted, regardless of having the font on the system (the "G" versions have Graphite enabled, so its rendering is better):

Linux Biolinum			Linux Biolinum G
Linux Libertine			Linux Libertine G
Comment 5 Julien Nabet 2013-05-20 17:04:36 UTC
On pc Debian x86-64 with master sources updated today, I reproduced the problem.

Caolán: one for you?
Comment 6 Caolán McNamara 2013-06-05 16:17:20 UTC
re "not reporting the font is not installed and is being substituted"

in 4.1 the font name is italicized in the font selectors if it's not installed, so that's fixed now.

re "having a substitution table", so...

for most Unix platforms e.g Linux we run the font through fontconfig which has a pile of rules and tables to give the best replacement font. So on those platforms this is "taken care of", and on MacOSX there's a similar built-in MacOSX thing I believe.

The remaining issue is Windows, there we use our built-in tables in registry/data/org/openoffice/VCL.xcu (http://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/VCL.xcu) see near the end, the section starting with <node oor:name="FontSubstitutions"> so we should already have the bitstreamverasans replacements for example.

It shouldn't be too hard to add to add extra entries or improve the existing ones. Not something for me though, seeing as it doesn't affect the platform I develop on.

I suggest you have a go at adding what entries are missing there from your own list and submit the result to us. See https://wiki.documentfoundation.org/Development/Patch_Handling_Guidelines for some help.
Comment 7 QA Administrators 2015-03-16 23:40:22 UTC Comment hidden (obsolete)
Comment 8 João Paulo 2015-06-08 05:51:53 UTC Comment hidden (no-value)
Comment 9 João Paulo 2015-09-04 04:54:08 UTC
Just recently found (via Google) the page https://wiki.documentfoundation.org/LibreOffice_Localization_Guide/Advanced_Source_Code_Modifications with some instructions on how to edit vcl.xcu. I will try it this weekend.
Comment 10 João Paulo 2015-09-04 08:08:58 UTC
Created attachment 118408 [details]
vcl.xcu partial patch

Partial patch containing extra font substitutions for the following fonts:

- Lobster -> Lobster Two
- Utopia <-> Heuristica

(these were added to other places as well)
- CenturySchL <-> TeXGyreSchola
- NimbusMonL <-> TeXGyreCursor
- NimbusMono <-> TeXGyreCursor

Bitstream Vera and DejaVu font families weren't altered, as they were already there.

More will be added with time. Please test this patch.
Comment 11 Timur 2016-09-21 07:39:02 UTC
Reading Comment 6 here and the similar https://bugs.documentfoundation.org/show_bug.cgi?id=91004#c7, I understand that Linux (and Mac) first runs fontconfig and Windows first runs Font Substitution Table. 
If it so, Help should be amended to clarify that priority: https://help.libreoffice.org/index.php?title=5.1/Common/Fonts&Language=en-US
Before I open a new bug, please confirm.
Comment 12 QA Administrators 2017-10-23 13:59:07 UTC Comment hidden (obsolete)
Comment 13 João Paulo 2017-11-06 16:14:31 UTC
On Comment #10 I made a partial patch enabling font substitutions of fonts I know are drop-in replacements. However, I don't know how to add the patch to LibreOffice: I'm no developer, just an advanced user with configuration and script skills.

Could someone please add the patch to the source code?

Also, answering to Comment #12, this is not a bug, but an enhancement request.
Comment 14 Yousuf Philips (jay) (retired) 2017-11-06 22:54:23 UTC
(In reply to João Paulo from comment #13)
> On Comment #10 I made a partial patch enabling font substitutions of fonts I
> know are drop-in replacements. However, I don't know how to add the patch to
> LibreOffice: I'm no developer, just an advanced user with configuration and
> script skills.

If you would like to send in your patch, you can follow instructions here to learn how to do so.

https://wiki.documentfoundation.org/Development/gerrit

> Could someone please add the patch to the source code?

Unfortunately the file has been modified since your patch, so i cant identify just the changes you have made, but if you can grab the latest version of the file below[1] and make the changes, i could push it in on your behalf if you add yourself to the contributor's list[2].

[1] https://cgit.freedesktop.org/libreoffice/core/plain/officecfg/registry/data/org/openoffice/VCL.xcu
[2] https://wiki.documentfoundation.org/Development/Developers

> Also, answering to Comment #12, this is not a bug, but an enhancement
> request.

I've change the bug type to enhancement.
Comment 15 Ulrich Windl 2018-03-06 07:16:35 UTC
The problem with a font substitution table is that, while fonts are similar, they are not the same. Even if the glyphs look identical, there my be significant differences in kerning information.
So what the use typically sees if a font is missing and was substituted, is an ugly or broken layout (caused by different kerning, character spacing, or line spacing). (You can see this effect in PDFs also where the kerning information is basically hard-coded (glyphs positioned absolutely), but the fonts can be missing.)
My personal preference over a manually edited (and probably huge) font substitution table is using typeface information (like PANOSE (https://en.wikipedia.org/wiki/PANOSE)) to find ou which fonts are similar to each other. I don't know whether Windows or other OSes support it, but I remember that Smalltalk-80 had it in the 80ies ;-) Of course the usefulness of typeface metadata depend on its accuracy. If people just copy it blindly from another font, it will be hardly useful...
Comment 16 Timur 2018-12-25 18:13:01 UTC
*** Bug 109525 has been marked as a duplicate of this bug. ***
Comment 17 Timur 2018-12-26 12:40:00 UTC Comment hidden (obsolete)
Comment 18 Timur 2020-10-20 13:00:34 UTC Comment hidden (obsolete)
Comment 19 Timur 2020-10-20 13:57:15 UTC
*** Bug 107115 has been marked as a duplicate of this bug. ***
Comment 20 Timur 2020-10-21 08:40:31 UTC Comment hidden (obsolete)
Comment 21 Paddy Landau 2020-10-25 15:06:03 UTC
LO identifies a replaced font in the font bar by using italics for the font name, and a tooltip that reads, "Font Name. The current font is unavailable and will be substituted."

While this information is both useful and welcome, it is insufficient: I need to know which font has been used as a replacement.

After some searching, the only method that I can find is clumsy and entirely unintuitive. Export as a PDF; open the PDF in LibreOffice Draw; select the text > right-click > Character > Fonts.

It would be hugely helpful if the tooltip could show the replacement font, or at least if we could view the replacement from some menu option — perhaps Tools > Options > LibreOffice > Fonts > "View replaced fonts" or something like that.

LO 7.0.2.2
Ubuntu 20.04

Thank you
Comment 22 Timur 2020-10-26 06:57:20 UTC
(In reply to Paddy Landau from comment #21)
> I need to know which font has been used as a replacement.
When looking at the bug, you need to also take in account See Also bugs, this is bug 61134 still waiting for a volunteer dev. 
And also meta bug at "Blocks" where you cab see other similar requests.
Comment 23 Timur 2020-11-10 10:49:12 UTC
Created attachment 167165 [details]
Personal LO replacement table

"Personal LO replacement table" that would be a nice thing if we didn't have bug 43185.
Comment 24 Timur 2022-04-21 10:05:59 UTC
*** Bug 68880 has been marked as a duplicate of this bug. ***
Comment 25 Timur 2022-07-02 21:10:24 UTC
*** Bug 120131 has been marked as a duplicate of this bug. ***
Comment 26 Eyal Rozenberg 2022-07-02 22:31:21 UTC
Coming from the potentially-duplicate bug 120131:

LO's popular competitor, Microsoft Office, has had several fonts chosen by default for various styles - which have naturally found their way into MS-Office-created documents. This is true both for Latin fonts, and for other languages, including RTL languages like Hebrew and Arabic which I am particularly concerned about.

Now, if you use Windows, the fonts an MS Office document will use will most likely be pre-installed on your system (all of them? Not sure); but if you're opening an MS Office document on another OS, these fonts are very likely _missing_.

For that reason I proposed that LO include a default substitution table for some or all of the fonts used in Microsoft Office in different languages, where LO bundles fonts that can serve as such substitutes.

In the context of this bug, I propose adding these fonts to the standard font substitution table proposed here. If Joao and other agree that is appropriate, we can close the other bug as a dupe.

In addition to the Latin-only fonts here are my suggested substitutions regarding fonts one tends to see in Hebrew documents:

David           -> David CLM
Frank Ruehl     -> Frank Ruehl CLM

The two on the right are bundled with LO and have an appropriate license. Of course the same should be done for other languages, and even for Hebrew I'm not sure this covers everything.

What say you?
Comment 27 João Paulo 2022-08-27 06:12:55 UTC
(In reply to Eyal Rozenberg from comment #26)
> Coming from the potentially-duplicate bug 120131:
> 
> In the context of this bug, I propose adding these fonts to the standard
> font substitution table proposed here. If Joao and other agree that is
> appropriate, we can close the other bug as a dupe.
> 
> (...)
> 
> What say you?

I agree to add the Microsoft Windows and Microsoft Office fonts that have a proper substitute font here.  However, I only know of:

Segoe UI	Selawik1
Tahoma		Wine Tahoma
Calibri		Carlito
Cambria		Caladea
Consolas	DMCA Sans Serif, maybe also Inconsolata (I don't know if they are metrically equivalent)

I created a table for my own use that I can share here, however it is a bit messy, as there are many fonts that can be used in place of the "original/proprietary" version.
Comment 28 Eyal Rozenberg 2022-08-27 07:10:58 UTC
(In reply to João Paulo from comment #27)
> ... However, I only know of: etc. etc.

The fonts I mentioned are two of the most common fonts used for Hebrew; and the bundled fonts in LO are free versions of proprietary fonts of almost the same name. So, it's somewhat like Tahoma and Wine Tahoma.