Bug 11494 - Italic is mislabeled as oblique
Summary: Italic is mislabeled as oblique
Status: RESOLVED FIXED
Alias: None
Product: DejaVu
Classification: Unclassified
Component: Serif (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Deja Vu bugs
QA Contact:
URL: http://www.2a.pl/~ne01026/serif.xml
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-07 07:34 UTC by Christopher Yeleighton
Modified: 2007-07-18 05:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Christopher Yeleighton 2007-07-07 07:34:44 UTC
*Problem statement
The X font server configuration file 
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/fonts.dir
contains the following entry:
DejaVuSerif-Oblique.ttf -bitstream-dejavu serif-medium-o-normal--0-0-0-0-p-0-iso10646-1
However, the font in question is not oblique, it is italic.

 *Detailed explanation:
<http://www.reference.com/browse/wiki/Italic_type> says:
"In typography, italic type refers to cursive typefaces based on a stylized form of calligraphic handwriting.  Sometimes the term italic is wrongly applied on oblique fonts (mostly sans-serif), when they are merely distorted into a slanted orientation."
In this case, the common mistake is committed the other way round: the typeface with has an italic design but is labeled as oblique.

 *Test case (how it hurts):
Konqueror renders the following HTML formula using a slanted typeface rather than an italic one:
<style type="text/css" > .formula { font-family: serif } </style ><p class="formula" 
><var >x</var ><sup >2</sup >&nbsp;+<var >y</var ><sup >2</sup >&nbsp;
=&nbsp;<var >z</var ><sup >2</sup ></p >
It is not what I meant; it makes HTML formulae render ugly on Wikipedia.

 *Explanation (my theory about what happens about the scenes)
The style for the text 'x' contains "font-family: serif" inherited from the  class 'formula' and "font-style: italic" inherited from the 'var' element.  Konqueror substitutes the font Dejavu serif by default; the style wants to have it italic.  However, when I look at the XLFDs available "out of the box" using xfontsel (or in the aforementioned file fonts.dir) I can see that the X font server has the following XLFDs to choose from:
-*-dejavu serif-medium-r-*-*-*-*-*-*-*-*-*-*
-*-dejavu serif-medium-o-*-*-*-*-*-*-*-*-*-*
And the font requested to render the formula must match
-*-dejavu serif-medium-i-*-*-*-*-*-*-*-*-*-*
Since no match is found, the X font server generates the font on the fly by slanting the regular font (-r- to -i-).

 *Remedy (my suggestion how to fix it)
 - Rename DejaVuSerif-Oblique.ttf to DejaVuSerif-Italic.ttf (this will probably require changing the contents of the TTF accordingly)
 - Change the corresponding XLFDs in fonts.dir
from -bitstream-dejavu serif-medium-o-normal--0-0-0-0-p-0-* 
to -bitstream-dejavu serif-medium-i-normal--0-0-0-0-p-0-*
Comment 1 Ben Laenen 2007-07-07 11:15:51 UTC
In our last release (2.18) Serif Oblique ws renamed to Serif Italic, so it is fixed by now.

And AFAIK, Konqueror cannot handle any MathML, so it won't display correctly there. Not knowing what to do when an italic font is requested and there's an oblique font has never been an issue.

btw, why do you have the "bitstream" tag in those lines in fonts.dir? It should be "misc"... I'll look into that a bit further.
Comment 2 Christopher Yeleighton 2007-07-12 10:29:31 UTC
(In reply to comment #1)
> btw, why do you have the "bitstream" tag in those lines in fonts.dir? It should
> be "misc"... I'll look into that a bit further.
> 

Here is what Adept has to say about ttf-dejavu:

Bitstream Vera fonts with additional characters
These fonts are based on the famous Bitstream Vera font family adding better support for non-English languages. They currently cover the entire Latin Ext-A range and parts of Latin Ext-B, Cyrillic, Greek and other ranges.
They are designed for use on low-resolution devices (mainly computer screens) but can be used in printing as well.
Comment 3 Christopher Yeleighton 2007-07-12 11:27:46 UTC
(In reply to comment #1)
> And AFAIK, Konqueror cannot handle any MathML, so it won't display correctly
> there. Not knowing what to do when an italic font is requested and there's an
> oblique font has never been an issue.

Please note that I have not alluded to MathML in any way.  It is possible to display a simple formula in HTML; Konqueror fails to render that correctly.
Comment 4 Ben Laenen 2007-07-12 13:59:11 UTC
(In reply to comment #2)
> Here is what Adept has to say about ttf-dejavu:
> 
> Bitstream Vera fonts with additional characters
> These fonts are based on the famous Bitstream Vera font family adding better
> support for non-English languages. They currently cover the entire Latin Ext-A
> range and parts of Latin Ext-B, Cyrillic, Greek and other ranges.
> They are designed for use on low-resolution devices (mainly computer screens)
> but can be used in printing as well.
> 

Sure, Vera is from Bitstream. But DejaVu isn't, and it shouldn't have that tag there. And according to the license, we cannot use the Bitstream name. So that's why I'm wondering where that tag was added to that line (is it in our fonts, or was it added by a packager, or by you?)
Comment 5 Ben Laenen 2007-07-12 14:06:49 UTC
(In reply to comment #3)
> Please note that I have not alluded to MathML in any way.  It is possible to
> display a simple formula in HTML; Konqueror fails to render that correctly.

I've checked the simple test case you made above, and Konqueror displays it fine, with real italic glyphs from DejaVu Serif Italic. If you only get slanted glyphs, it probably means that you didn't install Serif Italic, or you have a very old version of the fonts installed, which didn't have real italic glyphs yet.

The reason that you get slanted glyphs when you didn't install Serif Italic is that Fontconfig will generate those automatically if there is not italic/oblique.

If you still cannot find out what's wrong, please post a screenshot here.
Comment 6 Christopher Yeleighton 2007-07-17 08:07:49 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Please note that I have not alluded to MathML in any way.  It is possible to
> > display a simple formula in HTML; Konqueror fails to render that correctly.
> I've checked the simple test case you made above, and Konqueror displays it
> fine, with real italic glyphs from DejaVu Serif Italic. If you only get slanted
> glyphs, it probably means that you didn't install Serif Italic, or you have a
> very old version of the fonts installed, which didn't have real italic glyphs
> yet.
> The reason that you get slanted glyphs when you didn't install Serif Italic is
> that Fontconfig will generate those automatically if there is not
> italic/oblique.
> If you still cannot find out what's wrong, please post a screenshot here.

Explanation: this was fixed in version 2.18 only <http://dejavu.sourceforge.net/wiki/index.php/News>.  My KUbuntu distribution contains version 2.5 <http://packages.ubuntu.com/dapper/x11/ttf-dejavu>; thus, it is not strange at all that I encountered this problem.
Comment 7 Christopher Yeleighton 2007-07-18 05:00:50 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > Here is what Adept has to say about ttf-dejavu:
> > 
> > Bitstream Vera fonts with additional characters
> > These fonts are based on the famous Bitstream Vera font family adding better
> > support for non-English languages. They currently cover the entire Latin Ext-A
> > range and parts of Latin Ext-B, Cyrillic, Greek and other ranges.
> > They are designed for use on low-resolution devices (mainly computer screens)
> > but can be used in printing as well.
> > 
> Sure, Vera is from Bitstream. But DejaVu isn't, and it shouldn't have that tag
> there. And according to the license, we cannot use the Bitstream name. So
> that's why I'm wondering where that tag was added to that line (is it in our
> fonts, or was it added by a packager, or by you?)

It seems it was fixed in version 1.6.  I have no idea why it did not make it into Ubuntu though.  The Ubuntu installer still describes these fonts as coming from Biststream.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.