Bug 634039

Summary: encodings in /usr/share/X11/fonts/encodings/large are not read by X server
Product: [Fedora] Fedora Reporter: Daiki Ueno <dueno>
Component: xorg-x11-fontsAssignee: Peter Hutterer <peter.hutterer>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ejsheldrake, fonts-bugs, i18n-bugs, masterson.andrew, mcepl, pwu, robatino, xgl-maint
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xorg-x11-fonts-7.2-12.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-07 13:07:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daiki Ueno 2010-09-15 02:04:17 UTC
Description of problem:
Installing font encoded in "large" encoding set prevents native X applications starting up normally.

Version-Release number of selected component (if applicable):
xorg-x11-fonts-misc-7.2-9.fc12

How reproducible:
Always.

Steps to Reproduce:
1. Install a font encoded in any of the encoding defined in /usr/share/X11/fonts/encodings/large/*.  For example, cjkuni-uming-fonts
2. Run a native X application like xcalc
  
Actual results:
You will see the warning on the terminal:
 Warning: Missing charsets in String to FontSet conversion
 Warning: Unable to load any usable fontset

Even worse, some applications (including m17n-edit in m17n-lib-tools) abort with:
 Error: Aborting: no fontset found

Also, you will see errors in /var/log/Xorg.0.log:
 FreeType: couldn't find encoding 'gb2312.1980-0' for '/usr/share/fo
nts/cjkuni-uming/uming.ttc'

Expected results:
No warnings will be shown and every application should not abort.

Additional info:
This is because X server does not read encoding files in /usr/share/X11/fonts/encodings/large, while it reads files in /usr/share/X11/fonts/encodings.

Possible solutions are:
1. Move the encoding files from the "large" subdir to the upper dir
2. Generate encodings.dir in /usr/share/X11/fonts/encodings with entries for "large" subdir.

I guess there may have been some reason not to generate encodings.dir, though I couldn't find any clue from the changelog.

Comment 1 Edward Sheldrake 2010-10-26 13:55:12 UTC
I don't think even the encodings in /usr/share/X11/fonts/encodings are read without the encodings.dir file, e.g. from my Xorg.0.log

FreeType: couldn't find encoding 'iso8859-13' for '/usr/share/fonts/sazanami/mincho/sazanami-mincho.ttf'

iso8859-13 is:
/usr/share/X11/fonts/encodings/iso8859-13.enc.gz

It is possible for encodings.dir to list the contents of multiple directories:
# cd /usr/share/X11/fonts/encodings
# mkfontdir -n -e /usr/share/X11/fonts/encodings -e /usr/share/X11/fonts/encodings/large

Comment 2 Edward Sheldrake 2010-11-16 11:58:13 UTC
The encodings.dir files are missing because the steps to generate them were moved (years ago) from %post to %install, but the %ghost was not removed from them in the %files list.

The command to generate the encodings.dir file is still in xorg-x11-fonts.spec.

Comment 3 Matěj Cepl 2010-11-16 14:12:04 UTC
Peter, you were doing something in xorg-x11-fonts recently. What do you think about comment 2?

Comment 4 Matěj Cepl 2010-11-16 14:20:34 UTC
Moreover, reporter, are you able to reproduce the issue with the latest builds from http://koji.fedoraproject.org/koji/packageinfo?packageID=368 ?

Comment 5 Daiki Ueno 2010-11-17 09:14:23 UTC
Yes, I can reproduce it on either F-14 and today's rawhide, with xorg-x11-fonts-7.2-11.fc14 and xorg-x11-fonts-7.5-2.fc15 respectively.

Comment 6 Peter Hutterer 2010-11-19 04:23:24 UTC
Theory goes that these two scratch builds may fix it (though I admit to stabbing into the dark a bit)

http://koji.fedoraproject.org/koji/taskinfo?taskID=2610476
http://koji.fedoraproject.org/koji/taskinfo?taskID=2610479

Comment 7 Daiki Ueno 2010-11-19 05:58:23 UTC
Thank you, it now seems to work, except for trifling error messages when installing xorg-x11-fonts-misc:

sed: -e expression #1, char 0: no previous regular expression
sed: can't read large/encodings.dir: No such file or directory

Perhaps the following lines in xorg-x11-fonts-update-dirs:

    sed -i "s@$RPM_BUILD_ROOT@@" encodings.dir
    sed -i "s@$RPM_BUILD_ROOT@@" large/encodings.dir

should be:

    sed -i "s@\$RPM_BUILD_ROOT@@" encodings.dir

?

Comment 8 Matěj Cepl 2010-11-19 08:45:31 UTC
(In reply to comment #7)
> should be:
> 
>     sed -i "s@\$RPM_BUILD_ROOT@@" encodings.dir

Did you test it? It seems to me that another culprit could be problem (if I am not mistaken, variables expansion happens BEFORE running the command). What about

     sed -i "s@${RPM_BUILD_ROOT}@@" encodings.dir

But no, I haven't tested it either (OTOH I don't have set up environment and packages to know how to reproduce the original bug in the first place).

Comment 9 Daiki Ueno 2010-11-19 09:05:32 UTC
Sorry my comment 7 was pointless.  After looking at the new spec, I think these lines are not necessary at all, since the script is only called in %post and %postun.  Perhaps a wreck of cut & paste from %install? :)

Comment 10 Peter Hutterer 2010-11-22 00:02:40 UTC
updated build now available in koji:
http://koji.fedoraproject.org/koji/taskinfo?taskID=2614960

I think this should close the bug then, thanks for testing.

Comment 11 Peng Wu 2010-12-03 02:11:52 UTC
Could you make updates for Fedora 13/14 with this fix?
I received a bug report about this, See:
Bug 658363 - Several fonts interfere with citrix receiver

Comment 12 Fedora Update System 2010-12-07 03:27:04 UTC
xorg-x11-font-utils-7.4-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/xorg-x11-font-utils-7.4-3.fc14

Comment 13 Fedora Update System 2010-12-07 03:35:45 UTC
xorg-x11-font-utils-7.2-12.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/xorg-x11-font-utils-7.2-12.fc13

Comment 14 Peter Hutterer 2010-12-07 03:37:00 UTC
please provide stable karma to these two so I can push the actual bugfix out.

Comment 15 Andre Robatino 2010-12-07 23:37:10 UTC
I was able to reproduce the problem in the OP with F14 with updates-testing and all updates including today's, after installing xcalc and cjkuni-uming-fonts. I see both the message "Warning: Unable to load any usable fontset
" on the command line when running xcalc, and the error in Xorg.0.log. I didn't provide negative karma since I didn't test bug 655925.

xorg-x11-font-utils-7.4-3.fc14.x86_64
xcalc-1.0.3-5.fc14.x86_64
cjkuni-uming-fonts-0.2.20080216.1-45.fc14.noarch

Comment 16 Peter Hutterer 2010-12-08 05:01:06 UTC
Andre, please note that the actual bugfix isn't in yet. The fix will be in xorg-x11-fonts, but before we can do so, xorg-x11-font-utils needs to be in updates. xorg-x11-fonts relies on a new file added to -utils.

Comment 17 Fedora Update System 2010-12-12 00:01:55 UTC
xorg-x11-font-utils-7.4-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2010-12-12 23:49:45 UTC
xorg-x11-fonts-7.2-12.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/xorg-x11-fonts-7.2-12.fc14

Comment 19 Fedora Update System 2010-12-17 08:37:58 UTC
xorg-x11-fonts-7.2-12.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Andre Robatino 2010-12-20 23:18:14 UTC
Still seeing this (for example, same warnings with xcalc, and m17n-edit fails to run) - is the bugfix supposed to be in place?

xorg-x11-fonts-ISO8859-1-100dpi-7.2-12.fc14.noarch
xorg-x11-font-utils-7.4-3.fc14.x86_64
cjkuni-uming-fonts-0.2.20080216.1-45.fc14.noarch

If I install xorg-x11-fonts-misc-7.2-12.fc14.noarch, the problem appears fixed, though. Should this be a dependency?

Comment 21 Fedora Update System 2010-12-25 00:26:17 UTC
xorg-x11-font-utils-7.2-12.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 22 Peter Hutterer 2011-01-04 01:31:43 UTC
(In reply to comment #20)
> If I install xorg-x11-fonts-misc-7.2-12.fc14.noarch, the problem appears fixed,
> though. Should this be a dependency?

only some fonts update the encodings directory. misc is one of them, ISO8859-1 isn't for some reason. so if you don't have one of the fonts installed that  update the encodings dir, nothing happens when you update. not sure what the proper behaviour should be. (note that I mostly operate blind here, haven't done much with the font package for fonts in general)

Comment 23 Akira TAGOH 2011-01-31 09:14:00 UTC
*** Bug 658363 has been marked as a duplicate of this bug. ***