Bug 367188

Summary: web apps cannot find Nimbus Sans L Condensed
Product: [openSUSE] openSUSE 11.0 Reporter: Felix Miata <mrmazda>
Component: X11 ApplicationsAssignee: Mike Fabian <mfabian>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P5 - None CC: werner
Version: Alpha 2   
Target Milestone: ---   
Hardware: PC   
OS: openSUSE 11.0   
URL: http://mrmazda.no-ip.com/auth/Font/fonts-comps-narrow.html
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot on Mandriva's Firefox showing Nimbus Sans L Condensed compared to various other fonts
Cooker's n019063l.pfb
urw-fonts-1.0.7pre43.tar.bz2
nimbus-sans-l-in-font-selection-dialogs.png
ghostscript-fonts-std-8.11.patch

Description Felix Miata 2008-03-05 05:20:20 UTC
Nimbus Sans L Condensed is the only narrow aspect font otherwise widely available by default on Linux that works well on web pages. Firefox and Konq cannot find this font on most distros, including OpenSUSE. Mandriva proves that it's possible, using the same ghostscript n019043l.pfb file, so OpenSUSE should be able to do it too - the output of 'fc-list "nimbus sans l" family style width' on Factory and Cooker match, showing the existence of the condensed variant. 

URL is testcase. Attachment is using that testcase.
Comment 1 Felix Miata 2008-03-05 05:22:06 UTC
Created attachment 198668 [details]
screenshot on Mandriva's Firefox showing Nimbus Sans L Condensed compared to various other fonts
Comment 2 Stefan Dirsch 2008-03-05 06:14:16 UTC
# fc-list "nimbus sans l" family style width file
[...]
/usr/share/fonts/URW/n019043l.pfb: Nimbus Sans L:style=Regular Condensed:width=75
[...]

As long as toolkits/applications use fontconfig, they should be able to use this font, unless they are limited to a set of font styles. This might be the case for Qt/gtk. Maybe they can only use 

- Regular
- Italic 
- Bold
- Bold italic

Mike should know this.
Comment 3 Felix Miata 2008-03-05 07:11:37 UTC
Probably gtk can be ruled out. I just tried http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0b3/linux-i686/en-US/firefox-3.0b3.tar.bz2
on both Cooker and Factory. Success similar to distro's FF2 on Cooker, failure same as distro's FF2 on Factory.
Comment 4 Mike Fabian 2008-03-05 07:14:44 UTC
Felix Miata> URL is testcase. Attachment is using that testcase.

http://mrmazda.no-ip.com/auth/Font/fonts-comps-narrow.html
Comment 5 Mike Fabian 2008-03-05 07:21:06 UTC
Your web page source:

<span style="font-family: 'nimbus sans l condensed'

fc-list output:

mike@nozomi:~$ fc-list : | grep Nimbus.*Condensed
Nimbus Sans L:style=Bold Condensed
Nimbus Sans L:style=Regular Condensed Italic
Nimbus Sans L:style=Regular Condensed
Nimbus Sans L:style=Bold Condensed Italic
mike@nozomi:~$

You see that the family name doesn’t match. Your web page
requests the family name "Nimbus Sans L Condensed" which doesn’t
exist.

We could make "Nimbus Sans L Condensed" an alias
for "Nimbus Sans L:style=Regular Condensed" though.
Maybe Mandriva has done this?

Comment 6 Felix Miata 2008-03-05 07:43:32 UTC
Grepping for Condensed through Cooker's /etc/fonts tree turned up no hits.

If you look at the bottom of the screenshot, you can see Cooker's KDE font control panel does find a font named Nimbus Sans L Condensed.

Maybe this says something useful:
# fc-list "nimbus sans l" file
/usr/share/fonts/default/Type1/n019024l.pfb: 
/usr/share/fonts/default/Type1/n019023l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019023l.pfb: 
/usr/share/fonts/default/Type1/n019004l.pfb: 
/usr/share/fonts/default/Type1/n019003l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019024l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019003l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019004l.pfb: 
Comment 7 Felix Miata 2008-03-05 07:49:22 UTC
Compare also from Cooker:
# fc-list "nimbus sans l condensed" file
/usr/share/fonts/default/Type1/adobestd35/n019063l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019064l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019043l.pfb: 
/usr/share/fonts/default/Type1/adobestd35/n019044l.pfb: 
/usr/share/fonts/default/Type1/n019064l.pfb: 
/usr/share/fonts/default/Type1/n019063l.pfb: 
/usr/share/fonts/default/Type1/n019044l.pfb: 
/usr/share/fonts/default/Type1/n019043l.pfb: 
Comment 8 Mike Fabian 2008-03-05 11:39:49 UTC
Felix Miata> If you look at the bottom of the screenshot, you can see
Felix Miata> Cooker's KDE font control panel does find a font named
Felix Miata> Nimbus Sans L Condensed.

This, and the fact that the command

   fc-list "nimbus sans l condensed" file

lists font files like

/usr/share/fonts/default/Type1/n019063l.pfb

shows that this font *is* indeed called "Nimbus Sans L Condensed" on
Cooker. We have a font with the same file name on openSUSE:

/usr/share/fonts/URW/n019063l.pfb

but it is called "Nimbus Sans L" and has the style "Regular Condensed
Italic".

Can you attach this font from Cooker please?

Do you have further information where it comes from on Cooker?
.spec file, upstream source?

Comment 9 Felix Miata 2008-03-05 14:17:43 UTC
Created attachment 198799 [details]
Cooker's n019063l.pfb

I don't know anything about spec files. The RPM headers claim a ftp.cs.wisc.edu source, but that ultimately only leads to a self-referencing README. Maybe the packager listed in the headers can provide more information. RPM headers summary says "Free, good quality versions of the 35 standard PostScript(TM) fonts, donated under the GPL by URW++ Design and Development GmbH."

http://ftp5.gwdg.de/pub/linux/mandrivalinux/devel/cooker/SRPMS/main/release/urw-fonts-2.0-21mdv2008.1.src.rpm
http://ftp5.gwdg.de/pub/linux/mandrivalinux/devel/cooker/i586/media/main/release/urw-fonts-2.0-21mdv2008.1.noarch.rpm
Comment 10 Mike Fabian 2008-03-05 14:43:17 UTC
Yes, the name is indeed different in the font:

Our font:

mfabian@magellan:~$ ftdump /usr/share/fonts/URW/n019063l.pfb
There is 1 face in this file.

----- Face number: 0 -----

font name entries
   family:     Nimbus Sans L
   style:      Regular Condensed Italic
   postscript: NimbusSanL-ReguCondItal

font type entries
   FreeType driver: type1
   sfnt wrapped:    no
   type:            scalable
   direction:       horizontal
   fixed width:     no
   glyph names:     yes
   EM size:         1000
   global BBox:     (-139,-286):(1021,959)
   ascent:          959
   descent:         -286
   text height:     1245
   glyph count: 558

charmaps
   0: platform 3, encoding 1 (active)
   1: platform 7, encoding 0
mfabian@magellan:~$

Mandriva’s font:

mfabian@magellan:~$ ftdump /tmp/bnc/bnc367188/n019063l.pfb 
There is 1 face in this file.

----- Face number: 0 -----

font name entries
   family:     Nimbus Sans L Condensed
   style:      Regular Italic
   postscript: NimbusSanL-ReguCondItal

font type entries
   FreeType driver: type1
   sfnt wrapped:    no
   type:            scalable
   direction:       horizontal
   fixed width:     no
   glyph names:     yes
   EM size:         1000
   global BBox:     (-139,-286):(1021,959)
   ascent:          959
   descent:         -286
   text height:     1245
   glyph count: 633

charmaps
   0: platform 3, encoding 1 (active)
   1: platform 7, encoding 0
mfabian@magellan:~$

The glyph count is higher in Mandriva’s font, I guess Mandriva’s
version is newer.

If you look into the font with “less”, you can also see that
Mandriva’s version has been edited with fontforge whereas our version
has not.  This is another indication that Mandriva’s font is newer.

Comment 11 Felix Miata 2008-03-05 19:34:38 UTC
According to http://lists.freedesktop.org/archives/fontconfig/2008-March/002873.html it appears also Gentoo has a separate condensed Nimbus Sans L.
Comment 12 Mike Fabian 2008-03-06 14:16:43 UTC
See also:

http://bugs.ghostscript.com/show_bug.cgi?id=687297

for further problems with the fonts from

ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/ghostscript-fonts-std-8.11.tar.bz2

Mandriva has included some fixes and we have included some fixes.
It would be really nice if a new upstream release for
ghostscript-fonts-std could be done which collects all available
fixes.

Comment 13 Mike Fabian 2008-03-06 14:50:32 UTC
The tarball mentioned in the last comment of the upstream
bug report http://bugs.ghostscript.com/show_bug.cgi?id=687297, i.e.

> ------- Additional Comment #24 From Valek Filippov  2007-08-06 14:40 -------
> 
> 1.0.7pre43 was released.
> ftp://ftp.gnome.ru/fonts/urw/release/urw-fonts-1.0.7pre43.tar.bz2
> 
> Metrics have been checked against gs-fonts-6.0.
> Non-russian cyrillic glyphs were 'fixed or removed'.

seems to have disappeared, the directory ftp://ftp.gnome.ru/fonts/
is now empty.

Comment 14 Mike Fabian 2008-03-06 14:51:23 UTC
But I found a copy on this mirror:

http://be.lunar-linux.org/lunar/mirrors/urw-fonts-1.0.7pre43.tar.bz2
Comment 15 Mike Fabian 2008-03-06 14:53:15 UTC
Created attachment 199177 [details]
urw-fonts-1.0.7pre43.tar.bz2

Attaching the urw-fonts-1.0.7pre43.tar.bz2 for reference.
Comment 16 Mike Fabian 2008-03-06 14:59:39 UTC
By the way, the change from

   family:     Nimbus Sans L
   style:      Regular Condensed Italic

to 

   family:     Nimbus Sans L Condensed
   style:      Regular Italic

is not in urw-fonts-1.0.7pre43.tar.bz2, this seems to be
a Mandriva specific fix which I found only in
urw-fonts-2.0-16.1mdk.tar.bz2 contained in the package
Felix Miata pointed out in comment #9:

http://ftp5.gwdg.de/pub/linux/mandrivalinux/devel/cooker/SRPMS/main/release/urw-fonts-2.0-21mdv2008.1.src.rpm
Comment 17 Mike Fabian 2008-03-06 15:21:31 UTC
Created attachment 199196 [details]
nimbus-sans-l-in-font-selection-dialogs.png

“Nimbus Sans L” in a GTK2 font selection dialog (left) and
a KDE3 font selection dialog (right).
Comment 18 Mike Fabian 2008-03-06 15:31:12 UTC
The Mandriva fix appears reasonable to me because it makes the
condensed font selectable in many applications where it currently
cannot be used at all.

As the screen shot in comment #17 shows, the font can be selected
in GTK2 and it also can be selected in applications where you
can give the full fontconfig specification like

    xfd -fa "Nimbus Sans L:style=Regular Condensed Italic"

But it cannot be selected in

    KDE3/Qt3
    KDE4/Qt4
    OpenOffice
    Webpages
    ... probably many others ...

because most applications (unfortunately) offer only the basic four
styles “Regular”, “Italic”, “Bold”, and “Bold Italic”.

Therefore, I think the Mandriva fix to move the “Condensed” in
the family name is useful.
Comment 19 Mike Fabian 2008-03-06 17:46:08 UTC
Created attachment 199247 [details]
ghostscript-fonts-std-8.11.patch

updated patch for the Ghostscript standard fonts.
Contains some older fixes and renames the "Nimbus Sans L" condensed
fonts.

Thu Mar 06 17:30:39 CET 2008 - mfabian@suse.de

- bnc#367188: for the condensed variants of "Nimbus Sans L",
  move the "Condensed" from the style to the end of the family
  name. Otherwise these fonts are not selectable in most
  applications.

Submitted to STABLE/Factory.
Comment 20 Mike Fabian 2008-03-06 17:49:08 UTC
I’m closing this bug as FIXED now because I have fixed
the “Condensed” problem.

For the other problems in the ghostscript-fonts-std-8.11 release,
I think I’ll wait until something gets going upstream.
Comment 21 Felix Miata 2008-03-07 02:31:17 UTC
http://lists.freedesktop.org/archives/fontconfig/2008-March/002887.html claims a fontconfig solution that seems like it could be simpler than patching pfb files, and a template for solutions for latent condensed or expanded styles.
Comment 22 Mike Fabian 2008-03-07 11:49:25 UTC
For a similar problem with the DejaVu fonts see bug #330658.
Comment 23 Mike Fabian 2008-03-07 15:09:53 UTC
Felix Miata> http://lists.freedesktop.org/archives/fontconfig/2008-March/002887.html
Felix Miata> claims a fontconfig solution that seems like it could be
Felix Miata> simpler than patching pfb files, and a template for
Felix Miata> solutions for latent condensed or expanded styles.

Yes, that’s what I ment in comment #5.

It achieves about the same as editing the font files.
Something like this is necessary if fonts are concerned
which cannot be changed because of license reasons.
In the case of the URW fonts, the license permits editing,
i.e. we have both options. 

In this case, I think it is slightly better to edit the font files.

I don’t like the fontconfig hack much because:

Using the above hack in fontconfig:

mfabian@magellan:~$ fc-list : family style width | grep Nimbus.*Condensed 
Nimbus Sans L Condensed:style=Bold Condensed Italic:width=75
Nimbus Sans L Condensed:style=Regular Condensed Italic:width=75
Nimbus Sans L Condensed:style=Regular Condensed:width=75
Nimbus Sans L Condensed:style=Bold Condensed:width=75
mfabian@magellan:~$

Editing the fonts like Mandriva does:

fabian@magellan:~$ fc-list : family style width | grep Nimbus.*Condensed 
Nimbus Sans L Condensed:style=Regular:width=100
Nimbus Sans L Condensed:style=Regular Italic:width=100
Nimbus Sans L Condensed:style=Bold:width=100
Nimbus Sans L Condensed:style=Bold Italic:width=100
mfabian@magellan:~$

Notice the difference in the style names, the above fontconfig hack
doesn’t yet remove the “Condensed” from the style names.  Of course
this can be done as well by using 4 fontconfig hacks as above one for
each of the 4 fonts. But where shall this end? I agree
with Nicolas Mailhot here:

http://lists.freedesktop.org/archives/fontconfig/2008-March/002878.html

Nicolas Mailhot> And then change wide narrow ultra-condensed
Nicolas Mailhot> extra-condensed semi-condensed semi-expanded expanded
Nicolas Mailhot> extra-expanded ultra-expanded fonts too to cater for
Nicolas Mailhot> web designers that want the corresponding stretch
Nicolas Mailhot> variants.

I don’t think it is a good idea to pile up such hacks without
limits in the fontconfig setup and maintain this forever.

Changing the fonts seems to make some sense to me because:

The "Nimbus Sans L" font is *intended* to be a replacement for
"Helvetica" (and "Helvetica" clones like "Arial").  Therefore, it
seems reasonable to me that the condensed version of "Nimbus Sans L"
is intended to be a replacement for the condensed version of
"Helvetica". The condensed version is called "Helvetica Narrow" in the
family name and the condensed version of "Arial" is called "Arial
Narrow" in the family name. I.e. look at the "Arial Narrow" which
comes with Windows Vista:

    ARIALNBI.TTF: Arial Narrow:style=Bold Italic
    ARIALNI.TTF: Arial Narrow:style=Italic
    ARIALN.TTF: Arial Narrow:style=Regular
    ARIALNB.TTF: Arial Narrow:style=Bold

If "Nimbus Sans L Condensed" is intended to be a replacement for these
fonts, I think it is more reasonable to have the Condensed in the
family name and not in the style name because it is closer to what
"Helvetica Narrow" and "Arial Narrow" do.  I.e. original naming scheme
of the condensed version of "Nimbus Sans L" seems like an
unintentional bug to me which is really "fixed" the way Mandriva does
it.

By the way, I agree with most of what Nicolas Mailhot wrote on the
fontconfig list on the above thread.

Comment 24 Felix Miata 2008-03-16 00:45:43 UTC
Fix is apparent in ghostscript-fonts-std-8.61-2 using Firefox, Konq & Opera on Optional Fields URL.