Bug 95814 - serbian font support missing
Summary: serbian font support missing
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Usability (show other bugs)
Version: unspecified
Hardware: Other All
: P5 - None : Enhancement (vote)
Target Milestone: ---
Assignee: Mike Fabian
QA Contact: Siegfried Olschner
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-08 20:50 UTC by Kalman Kemenczy
Modified: 2007-06-05 12:41 UTC (History)
2 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
compose file (6.45 KB, application/octet-stream)
2005-07-31 07:30 UTC, Kalman Kemenczy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kalman Kemenczy 2005-07-08 20:50:36 UTC
Both ghostscript-fonts-std
and freefont packages have incorrect Serbian Cyrillic glyphs.  Patches
are available for both (and some are available for around three years).

If it's not an option to patch these fonts now (though Debian is doing
that, and they have a very strict control), we should at least ask for
including DejaVu fonts (available from http://dejavu.sf.net/) which
are Bitstream Vera derivative with added Cyrillic and much more.
Comment 1 Thorsten Kukuk 2005-07-11 08:03:41 UTC
Serbian support is enhancement, not critical. 
Comment 2 Siegfried Olschner 2005-07-12 08:28:57 UTC
If a patch is available to fix the font problems -- it should be done. 
Aj, is there anybody responsible for such font settings? Mfabian? 
Msommer, are the DejaVu fonts of interrest to you? 
Comment 3 Andreas Jaeger 2005-07-12 08:48:23 UTC
Mike, could you look into this for our next release?

A "Bitstream Vera derivative" good be a license problem, so please take care.
Comment 4 Mike Fabian 2005-07-12 10:22:19 UTC
Kalman Kemenczy> Both ghostscript-fonts-std and freefont packages have incorrect
Kalman Kemenczy> Serbian Cyrillic glyphs.  Patches are available for both

Where are these patches?




Comment 5 Mike Fabian 2005-07-12 10:23:35 UTC
By the way, all the fonts from the agfa-fonts package support Serbian:

mfabian@magellan:~$ fc-list :lang=sr:outline=true | grep AMT
Cumberland AMT:style=Regular
Albany AMT:style=Regular
Thorndale AMT:style=Regular
Albany AMT:style=Bold
Albany AMT:style=Italic
Thorndale AMT:style=Bold
Albany AMT:style=Bold Italic
Cumberland AMT:style=Bold Italic
Cumberland AMT:style=Bold
Thorndale AMT:style=Bold Italic
Thorndale AMT:style=Italic
Cumberland AMT:style=Italic
mfabian@magellan:~$
Comment 6 Kalman Kemenczy 2005-07-12 12:44:11 UTC
For ghostscript‑fonts‑std, these are integrated in URW‑CYR (package
which is a base for ghostscript fonts 8.* releases):

  ftp://ftp.gnome.ru/fonts/urw/release/

1.0.7pre40 and 1.0.7pre41 should have them.  You can't simply use
URW‑CYR because Valek Filipov (upstream author) broke some of the
standard PostScript metrics, so these can't be distributed as is for
purposes of ghostscript (that's why they decided to fork and not keep
track too much with him anymore, I guess).

Also, Debian package contains fixes already, which cares not to mess
metrics for anything:

  http://packages.debian.org/stable/source/gsfonts

You can use their patches, but they probably contain a few more bits
than just correct Serbian glyphs.  Dafydd Harries has worked on fixing
this for Debian and Ubuntu, as described in:

  http://bugs.debian.org/cgi‑bin/bugreport.cgi?bug=271472

and the above Debian package is a result of this effort (you can find
there instructions on how he produced the patches, along with scripts
he used; I have some older instructions for merging glyphs back on 
http://srpski.org/fonts/, if you don't want to go the Daf's route).

FreeFonts basically use the same glyphs (since Sans, Serif and Mono are
based on Nimbus Sans, Nimbus Serif and Nimbus Mono), and I've sent a
patch long ago to Primoz Peterlin (maintainer), but I think he missed
to apply it to all the fonts.  I can recreate those patches again, but
these glyphs can also be taken from URW‑CYR fonts (there's no need to
worry about metrics corruption with FreeFont, since they're not
claiming metric‑compatibility with Adobe's fonts).

Missing or incorrect in them are:

FreeSansBoldOblique: DZE, dze (0x40f, 0x45f)
FreeSansOblique: DZE, dze (0x40f, 0x45f)
FreeSerif: DJE (0x402), CJE (0x40b) 
FreeSerifBold: DJE (0x402), CJE (0x40b) 
FreeSerifBoldItalic: DJE (0x402), CJE (0x40b), DZE (0x40f), 
                     LJE (0x409), NJE (0x408),
                     dje (0x452), cje (0x45b), dze (0x45f), 
                     lje (0x409), nje (0x458)
FreeSerifItalic: DJE (0x402), CJE (0x40b), DZE (0x40f), 
                 LJE (0x409), NJE (0x408),
                 dje (0x452), dze (0x45f), 
                 lje (0x409), nje (0x458)

All these can be taken from URW‑CYR Nimbus fonts (or corrected gsfonts
package), and I can prepare another patch to fix all of these (one can
do that with FontForge [http://fontforge.sf.net]).

> By the way, all the fonts from the agfa‑ fonts package support
> Serbian:

Indeed, and so does Computer Modern Unicode (cm‑unicode) set of
fonts.  But I don't know if they're installed by default, and whether
they're default used on the desktop.

Especially big problem is that both gsfonts and freefonts contain
incorrect glyphs in places of Serbian glyphs, so fontconfig doesn't
try any other font (since it assumes the fonts are correct):
otherwise, it wouldn't be too big a problem.

Because of these fontconfig features to fall back on different fonts,
intermediate solution might be to simply remove all these offending
glyphs from fonts: that's way better than keeping them in, since then
they would get picked from other fonts which contain correct glyphs.

> mfabian@magellan:~$ fc‑ list :lang=sr:outline=true | grep AMT
> Cumberland AMT:style=Regular
> Albany AMT:style=Regular
> Thorndale AMT:style=Regular
> Albany AMT:style=Bold
> Albany AMT:style=Italic
> Thorndale AMT:style=Bold
> Albany AMT:style=Bold Italic
> Cumberland AMT:style=Bold Italic
> Cumberland AMT:style=Bold
> Thorndale AMT:style=Bold Italic
> Thorndale AMT:style=Italic
> Cumberland AMT:style=Italic
> mfabian@magellan:~$

Are these installed by default, and are "Sans", "Serif" and "Mono"
fontconfig aliases set to point to them?
Comment 7 Mike Fabian 2005-07-12 13:32:02 UTC
The cm-unicode package is only installed by default when the
installation is done in Russian or Bulgarian or when Russian and/or
Bulgarian are selected as secondary language.

The agfa-fonts are *always* installed by default (except wehn doing a
minimal installation without X11). And there are entries in the
fontconfig configuration for the "sans-serif", "serif" and "monospace"
aliases to prefer the agfa-fonts for all languages they support.

That means by default Serbian should be displayed correctly, only if
the user manually changes the defaults and explicitly selects fonts
from the freefont or the ghostscript-fonts-std package she will see
the incorrect glyphs.

Of course there is the problem that the Serbian locales are currently
missing in glibc, fontconfig selects appropriate fonts depending on
the locale. But with the current fontconfig setup, the agfa-fonts are
used by default for most locales, you will have suitable fonts for
Serbian as the default fonts unless you choose locales for exotic
languages like Japanese, Arabic, Indian languages, ...



Comment 8 Mike Fabian 2005-07-12 13:39:45 UTC
Kalman>  and I've sent a patch long ago to Primoz Peterlin (maintainer), but I
Kalman>  think he missed to apply it to all the fonts.  I can recreate those
Kalman>  patches again,

Yes, can you please create a patch for freefont again? That would help
a lot.

I'll apply it immediately to our freefont package of course and we
should also try to contact Primoz Peterlin again to include it.

Kalman> Because of these fontconfig features to fall back on different fonts,
Kalman> intermediate solution might be to simply remove all these offending
Kalman> glyphs from fonts: that's way better than keeping them in, since then
Kalman> they would get picked from other fonts which contain correct glyphs.

Yes, this is a reasonable workaround, I used this workaround for
Japanese already in our freefont package because freefont contains
incomplete Japanese support which is worse than no Japanese support at
all.

But if you can recreate you patch, it would be a better solution to
add your patch.

Comment 9 Kalman Kemenczy 2005-07-16 19:57:15 UTC
Danilo uploaded a full tarball of TTF fonts (patches are not really
usable with them, but I probably didn't generate the fonts with the
same settings as Primoz does, so I think we should wait for his reply
as well), and full tarball of SFD files at:

http://kvota.net/fonts/freefont/ 

Danilo used the same procedure Daf used for Debian gsfonts, so he
uploaded slightly modified scripts to get there as well (file
copy-cyrillic.sh, copy-glyphs.sh and copy-glyphs.pe--copy-cyrillic.sh
contains a list of all the modified glyphs).  Note that he didn't do
any extensive testing of these (just hand-checked to see if the
glyphs look right in all these fonts).

Danilo also contacted Primoz as well, and I hope he'll integrate all the
useful changes upstream.
Comment 10 Kalman Kemenczy 2005-07-31 07:30:10 UTC
Created attachment 44178 [details]
compose file
Comment 11 Kalman Kemenczy 2005-07-31 07:31:15 UTC
I received this mail from Danilo Segan:

Apart from compose.dir, locale.alias and locale.dir changes, we want
to have a different Compose file as well. 

I'd rather have that extend en_US.UTF-8/Compose instead (I'm attaching
a patch: there are no precomposed Serbian Cyrillic accented glyphs,
and some of these actually are used by common people quite often, like
"аˆ"; so far, people have done ugly things like using the same looking
precomposed Latin a with circumflex -- that's pretty bad for a hack,
since it breaks everything like script and language handling, etc.).
Apply sr_CS.Compose.patch to en_US.UTF-8/Compose file.

This also means that ISO-8859-5 is not good enough (afaik) for this,
so I'd suggest we provide only UTF-8 locale (besides, ISO-8859-5 never
got widespread enough in Serbia and Montenegro [Microsoft CP 1251 is
still more common, as is old 7-bit YUSCII which is incompatible with
ASCII], so I don't see a reason in pushing it when it simply limits
what one can do for Serbian language).

I don't know which versions of locale.dir, locale.alias and
compose.dir should I patch, but I generally simply replicate whatever
entries there are for sr_YU for both sr_CS and sr_CS@Latn.
Comment 12 Kalman Kemenczy 2005-08-04 15:06:48 UTC
Accidentaly I added the last two comment here rather the right place to bug@95813.
sorry guys
Comment 13 Mike Fabian 2007-01-23 20:21:21 UTC
Kalman Kemenczy> we should at least ask for including DejaVu fonts
Kalman Kemenczy> (available from http://dejavu.sf.net/) which are
Kalman Kemenczy> Bitstream Vera derivative with added Cyrillic and
Kalman Kemenczy> much more.

Déjà Vu fonts are now included in openSUSE 10.2.

Comment 14 Kalman Kemenczy 2007-01-23 21:11:41 UTC
I think we can close this I will talk to the original reporter and I will reopen it if necessary.
thanks
Comment 15 Mike Fabian 2007-01-24 11:50:35 UTC
At least some of the problems in the freefont package still exist,
for example 0x40f in FreeSansBoldOblique still looks incorrect.

If you think this is important please open a new bug against the
freefont package *and* attach the patches.

Comment 16 Mike Fabian 2007-01-24 11:51:57 UTC
The probles in the ghostscript-fonts-std package most likely still
exist as well.

If necessary, please open a bug report against that package with
exact procedures/patches how to fix it.