Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 455819 - Font substitution in open office not working
Summary: Font substitution in open office not working
Alias: None
Product: Fedora
Classification: Fedora
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Caolan McNamara
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-07-18 00:37 UTC by Christian Lupien
Modified: 2009-03-05 06:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-16 12:37:33 UTC

Attachments (Terms of Use)
this patch might do the right thing (deleted)
2008-07-18 10:01 UTC, Caolan McNamara
no flags Details | Diff

System ID Priority Status Summary Last Updated 98139 None None None Never

Description Christian Lupien 2008-07-18 00:37:54 UTC
Description of problem:
In openoffice writer (that is the one I played with), there is a menu for font
substitutions/replacements (tool->options->>Fonts). 
In the fedora 9 version (and it has been like that for a while, I remember
trying this in fedora 5 with the same results), that menu has no effect.

In the version from directly, some fonts substitutions work.

Version-Release number of selected component (if applicable):
  or the version from directly

How reproducible:

Steps to Reproduce:
1-Create a new document (writer) containing a few sentences with different fonts
 This is Lucida Sans
 This is DejaVu Serif
 This is DejaVu Sans Mono
 This is NotARealFontName
(You can choose the font names you like. And choose one that does not exists)

2-Now open the font substitution menu and make entries to change all the above
to something else (i.e substitute "Lucida Sans" to "Nimbus Sans L", ..., and
"NotARealFontName" also to "Nimbus Sans L"). Don't forget to activate the
substitution (Apply replacement table checked and Always column checked).

3. Then select OK and look at the result.
Actual results:
Nothing has changed in the Fedora version.
In the version from all the existing fonts have changed but not
the unknown font. 

If the programs are run with the following environment variable set
Then all the fonts are substituted properly. (You might have to save and reload
the file to fix some spacing problems but otherwise the change is immediate)

Expected results:
I expect the fedora version to produce the same results as 
but without using the environment variable

Obviously there seem to be some problems with fontconfig

Additional info:
see <a
comment 11</a> of <a
Ubuntu bug 126784</a>.
Another <a href="">related

Comment 1 Caolan McNamara 2008-07-18 08:34:36 UTC
It does appear that the fontconfig stuff has disabled the application of the
hard font-replacement table, which should be fixed. The long-time fedora patches
for using fontconfig were integrated into upstream OOo so this shouldn't be a
fedora-specific problem anymore.

But, for reference, what exactly do you want to achieve ? The default
configuration is to take the suggestions that fontconfig gives so as to have
uniform replacements across the desktop in all apps. e.g. modifying the global
fontconfig replacements might be a better solution depending on your goals

Comment 2 Caolan McNamara 2008-07-18 10:01:16 UTC
Created attachment 312115 [details]
this patch might do the right thing

Comment 3 Christian Lupien 2008-07-18 16:39:02 UTC
What I want to accomplish is that sometimes I get files (word documents)
containing fonts I don't have and the the fontconfig/openoffice default font
substitution is not optimal. In that case I want to play with the substitutions
to improve things. 

I know how to change fontconfig manually but the files with bad fonts are not
numerous enough and I don't need to apply a change for the whole desktop (and
the fix might change from file to file)

There are no GUI to easily change the fontconfig and anyway this is just changes
that really should only apply to the openoffice application which does have a
GUI for this (except it does not work currently).

I would like to try the patch. Do I have to recompile the full openoffice or is
there a short cut I could use?

Comment 4 Caolan McNamara 2008-07-18 16:49:23 UTC
Unfortunately there's no short-cut except to build OOo :-(. I'll make a build of
this for testing soon, and mention here when it is available

I'd be interested in knowing with what fonts are you having problems with, the
classic fonts of Times New Roman, Arial and Courier New should be taken care of
with the Liberation Fonts. So I assume it is some less common fonts.

Comment 5 Christian Lupien 2008-07-22 23:15:46 UTC
There are no particular fonts I am having trouble right now. I remember having
trouble a while back with old star office fonts (Albany, Cumberland and
Thorndale) but that is not a problem now (there are aliases and I have installed
the fonts anyway). 
At the time (might have been fedora 3 or 5) I lost some time trying this
function in openoffice that simply did not work.

Since then I have checked once in a while if it was fixed. Since it was still
not fixed I decided to finally file the bug report, in the objective that if I
need this option later, it might finally be working.

Comment 6 Caolan McNamara 2009-01-16 12:37:33 UTC
Going to take this upstream to hdu to see if my proposed fix makes sense

Comment 7 arbeels-zoo 2009-03-05 06:55:43 UTC
Re: your question about what fonts people are having problems with.

I am specifically having problems with the classic fonts: Times New Roman, Arial and Courier New.  The problem is precisely that these fonts are taken care of with the Liberation Fonts and I want to override that choice.

The Liberation Fonts are very hard on the eyes.  I want to use something else to substitute for Times New Roman when I am editing a long document sent me by a Windows user.

Of course, my opinion about the Liberation Fonts is subjective.  But fonts are very, very subjective to start with, so we should expect users to want to change default font settings, including these substitutions.  This should be possible without having to use environment variables or change global system settings.

(Non-technical users, like professional editors, will expect to be able to control OOo fonts from within OOo.  They will find the Font Substitution GUI, but it will fail to substitute these default fonts, with no explanation or error message.  If they are really savvy, they will then go looking for some global font control in the desktop preferences menus, and find nothing there either.  They will conclude that either OOo or Linux is "broken".)

Finally, in my experience the main use of the Font Substitution table is to provide local equivalents for missing fonts.  This is a problem I encounter all the time with heavily formatted documents and presentations.  There is almost never a need to substitute one existing font for another via the Font Substitution table, since that can be done much more effectively via styles.  Unfortunately, on systems where fontconfig makes global substitutions, the Font Substitution table only works for existing fonts -- the case most users do not need.

And...thank you for the patch.  I'll test it when I next have time to compile OOo.

Note You need to log in before you can comment on or make changes to this bug.