FreeType2 glyph rendering issues

ASSIGNED
Assigned to

Status

()

ASSIGNED
17 years ago
9 years ago

People

(Reporter: bstell, Assigned: bstell)

Tracking

Trunk
Future
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(7 attachments)

(Assignee)

Description

17 years ago
The Linux/Unix version of moz will use FreeType2 to display TrueType fonts.

http://www.freetype.org/

The is a forum to discuss FreeType2 rendering issues
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Future
(Assignee)

Comment 1

17 years ago
Created attachment 61480 [details]
FreeType2 vs paintshop pro version 7

from an email:
> The top sentence was rendered using FreeType 2's ftstring with hinting. The 
> bottom was with paintshop pro version 7.
(Assignee)

Comment 2

17 years ago
The image is from:
Antoine Leca <Antoine-Freetype@Leca-Marti.org>

Comment 3

17 years ago
I'm not sure if this is the place to put this, and I'm not sure what all other
information I should include, so smack me down if I'm being bad.

Both me and a friend are having issues with FreeType rendering; none of the fonts
we have will render in italics or in boldface.

(Assignee)

Comment 4

17 years ago
For bold/italic please see bug 130661.

This bug is about the detail (eg: blurryness) of the individual glyphs.

Comment 5

17 years ago
I hope this is the right place to post this comment.  I'm using Mozilla with
FreeType2 font support.  It works very well for the most part, however I noticed
that any text rendered in one HTML's generic font styles (i.e., Serif,
Sans-serif, Cursive, etc.) is not antialiased, even if that font style is set to
an anti-aliasable font in Mozilla preferences.

For example, if a paragraph is in the "Arial" font, it will be rendered
anti-aliased.  However, if a paragraph is in the "Sans-serif" font and Mozilla's
"Sans-serif" font is set to use "Arial," the paragraph will not be anti-aliased.
 I'll attach a sample HTML file illustrating this.  This happens in Mozilla 0.9.9.

Comment 6

17 years ago
Created attachment 79201 [details]
Shows the render difference between "Arial" and "Sans-serif"
(Assignee)

Comment 7

17 years ago
Paul: this bug is here to address FreeType2 rendering issues.
This issue you are seeing appears to be moz not using FreeType2 when it should.
Would you kindly open a new bug on that (and cc: me)? 

Thanks

Comment 8

17 years ago
i'll continue with the typical first line here - not sure if this is the right
place for it, but...

i noticed that when i enable AA in mozilla, the fonts used on mozilla itself,
e.g. menu font, bookmark toolbar font, address bar font, etc. are very blocky
and artifacty.  the AA fonts used on webpages is much better, but not perfect.

to be honest, i really like whatever rendering method they are using for the
gdkxft project - a hack to make gnome 1.4 use xft/freetype to antialias fonts
(http://gdkxft.sourceforge.net/).  now, i don't really know anything about their
code, but when i patch mozilla (all the patch does is tell mozilla to let gdk
draw text) to make use of the gdkxft library (which basically just overrides
several of gdk's built-in text rendering routines), mozilla looks really great
(at least to me).  the only gripe i have is that i notice a slight performance
hit.  (note: the patch to mozilla in its current form does not apply to current
mozilla cvs due to a very large offset, but, since it is a trivial patch it can
be applied by hand.)

as i said, i don't know how the gdkxft developer(s) is/are handling font
rendering, autohinting, correction, etc., but i think taking a look at their
code might not be a bad idea...

i'll try to post a screenshot both with moz's AA and with gdkxft's AA, but i
only have a patched moz with gdkxft, and recompiling often takes quite some time...

Comment 9

17 years ago
Created attachment 80367 [details]
mozilla AA-ed with gdkxft library
(Assignee)

Comment 10

17 years ago
This is the correct place for this kind of issue.

I looked at http://gdkxft.sourceforge.net/. The image at the top of the page 
(http://gdkxft.sourceforge.net/preview.gif) seems unnecessarily blurry to me.

Could you attach a screen shot showing the moz text you thought was "very blocky
and artifacty"?

Comment 11

17 years ago
Created attachment 80673 [details]
mozilla AA-ed with built-in freetype support, unhinted

Comment 12

17 years ago
Created attachment 80675 [details]
mozilla AA-ed with built-in freetype support, hinted (not auto)

Comment 13

17 years ago
ok, so here are two more screenshots - both using mozilla's builtin freetype
support, the first ("unhinted") with:

pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", true);

the second ("hinted") with:

pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", false);

the unhinted version, IMHO, looks awful.  the text of the webpage looks
passable, but not really great.  the menu and button fonts look terrible.

with the hinting turned on, it gets a little better, but the text looks "blocky"
to me.  i personally prefer gdkxft's rendering over this.

i tried autohinting set to true, but it looked the same as my second pic with
hinting, so i suspect that i do not have autohinting compiled into freetype.

while it would be nice to tune mozilla's font rendering, i think it would be
appropriate to add a hidden pref - to optionally allow gdk to draw the text.  if
the user is using a gnome desktop, one would think that he/she would want
mozilla to draw text just like the rest of his/her gtk/gnome apps.  esp if/when
mozilla is ported to use gtk 2.0, which has support for AA.  yes, i know,
another pref...
(Assignee)

Comment 14

17 years ago
Are you on a CRT or and LCD display?

Could you try turning off the sharpening code?
In unix.js change this pref to "0.0".

  pref("font.scale.tt_bitmap.dark_text.gain", "0.0");

Comment 15

17 years ago
Created attachment 80910 [details]
mozilla AAed, unhinted, dark_text.gain=0.0

Comment 16

17 years ago
Created attachment 80911 [details]
mozilla AA-ed, hinted, dark_text.gain=0.0

ok, here are two more, both with dark_text.gain set to 0.0. the first is
unhinted, the second hinted (normal hinting, i don't have autohinting as i
mentioned before).  the two look similar, except that the hinted version is a
bit darker.  also note the italicised "Mozilla at a Glance" (blue link) on the
right - the "z" is missing the diagonal bar!  this doesn't happen in the
unhinted pic, interestingly.

i am using a CRT, not an LCD screen.

while it is just a matter of personal taste i suppose, i still like how gdkxft
renders AA text much better than mozilla does.	esp compare the menu titles and
the personal toolbar button text.  gdkxft appears to be _much_ smoother.

i believe someone mentioned that the pic on the gdkxft website looked very
blurry.  interestingly enough, this is not the case for me - i was actually
surprised when i looked at that pic.  then again, i'm not using the default gtk
theme that they 'tweaked.'  also, it seems that gdkxft looks a lot more like
the antialiasing used for gtk 2.0 than mozilla's implementation does.  not that
that  fact is terribly significant...
(Assignee)

Comment 17

17 years ago
> also note the italicised "Mozilla at a Glance"
> (blue link) on the right - the "z" is missing the diagonal bar!  this
> doesn't happen in the unhinted pic, interestingly.

It was a similar problem with a 'G' losing the upper part of the
curve that made me set unhinted true (and eventually open this bug).

> i am using a CRT, not an LCD screen.

Just checking since Xft does a subpixel rendering on LCDs.

> while it is just a matter of personal taste i suppose, i still like how
> gdkxft renders AA text much better than mozilla does.  esp compare the
> menu titles and the personal toolbar button text.  gdkxft appears to be
> _much_ smoother.

To me the "mozilla AA-ed, hinted, dark_text.gain=0.0" (attachment 80911 [details]) 
seems much cleaner and far less blurry than  "mozilla AA-ed with gdkxft 
library" (attachment 80367 [details]) but that is my personal taste.
(Assignee)

Comment 18

16 years ago
*** Bug 160916 has been marked as a duplicate of this bug. ***

Comment 19

16 years ago
For what it's worth, I am not getting any anti-aliased fonts at all using
Mozilla 1.0

Galeon, however, IS. The page at 
http://bugzilla.mozilla.org/attachment.cgi?id=79201&action=view    is able to
verify this.
(Assignee)

Comment 20

16 years ago
> I am not getting any anti-aliased fonts at all using Mozilla 1.0

This bug is intended to be about problems with individual glyphs.

If http://www.mozilla.org/projects/fonts/unix/enabling_truetype.html (non Redhat
rpms) or bug 126919 does not help then would you kindly open a separate bug?
QA Contact: teruko → i18n
You need to log in before you can comment on or make changes to this bug.