Closed Bug 100570 Opened 21 years ago Closed 20 years ago

add support for anti-aliased fonts (Render); Part 2

Categories

(Core :: Internationalization, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: bstell, Assigned: bstell)

References

Details

(Keywords: intl)

Attachments

(7 files, 6 obsolete files)

this is a continuation of bug 82076 which has passed 4,000 lines of comments
and is thus hard to scroll.
*** Bug 82076 has been marked as a duplicate of this bug. ***
Ps, Will the latest patch file from bug 82076 moved here as well?
assigning to bstell
Assignee: yokoyama → bstell
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Attached patch patch; fix bit rot (obsolete) — Splinter Review
Keywords: intl
QA Contact: andreasb → ylong
QA Contact: ylong → teruko
*** Bug 104744 has been marked as a duplicate of this bug. ***
Comment on attachment 53822 [details]
trivial patch to make gdkxft work with moz, still runs without gdkxft. not sure if this breaks other things though.

xft is not supported on a variety of platforms that mozilla supports
Attachment #53822 - Attachment is obsolete: true
Attachment #53822 - Attachment is patch: false
I recently rebuilt this patch against mozilla 0.9.5 and freetype 2.0.4 and found
that though it worked with an existing font catalog file, it was unable to
generate a new one usefully from scratch -- all fonts were marked invalid, with
no usable glyphs.

This was due to every call to nsFTLoad_Glyph in nsFontCatalogFceFromFontFile
returning an error, TT_Invalid_PPem.

This error has something to do with the requested glyph size being invalid, and
shouldn't happen as far as I can tell from the freetype documentation (since
when you create a face, you get a valid size by default, suppsedly). But at any
rate, it was easy to fix by adding FT_LOAD_NO_SCALE to the options on the call.

Does anyone else see this problem?
Nathaniel: I'm not surprised by this. It seems that FreeType2 is
changing quite a bit between the 2.0.x releases. I suspect we may need to
static link it to workaround this.
The time has come to discuss using/not-using Xft to access FreeType2.

As I expect that there may be a lot of discussion on this topic 
I've opened a bug to address this particular issue: 

  bug 109423: FreeType2 on Linux Mozilla with/without Xft

If you would like to participate in this please add yourself to that
bugs cc: list.

What exactly would attachment 53822 [details] break?  Would it hurt performance?
dbaron: I've been using it for a while now without any problems. There is a
slight performance hit but it's the same as any other GTK app when switched from
regular fonts to gdkxft.
I talked to Pavlov about this and he saig that to back out the code
as is done in attachment 53822 [details] would be a mean a large performance
impact.

Second, using XLDF to access 10646 font implies a huge performanc
penalty when searching for glyphs not in the primary font.

Updated so it would compile.
There are new features this needs to be changed to use:

 1) use the new alpha blending routines (see bug 107018)

 2) use the name value DB (see bug 96768)

(I made the patch in 2 parts because the patch command has trouble with
 Makefile.in)
Attachment #50001 - Attachment is obsolete: true
Attached patch patch for mozilla dir; (obsolete) — Splinter Review
use this attachment and attachment 59009 [details] [diff] [review]
as always one needs to run autoconf after changing configure.in as is done in
attachment 59010 [details] [diff] [review]
> 1) use the new alpha blending routines (see bug 107018)


Isn't the whole point of using XRender that it provides hardware-accelerated
alpha blending for antialiased fonts? Wouldn't it be a significant step back to
use this (afaik) software-only alpha blending routines?
same comments as attachment 59009 [details] [diff] [review]
Attachment #59009 - Attachment is obsolete: true
> Isn't the whole point of using XRender that it provides hardware-accelerated
> alpha blending for antialiased fonts? Wouldn't it be a significant step back 
> to use this (afaik) software-only alpha blending routines?

Yes, Xrender is faster *where* *available*. The client side software alpha
blending is available everywhere.

I recently learned a subtlety: while Xft does not have bloat control 
Xrender does. This removes a major detraction and I am currently evaluating 
how to integrate Xrender which I have always seen as the preferred choice
over client side blending.

minor point: Xrender uses hardware if possible else it falls back to software.
Xrender using software blending is still faster than client side blending 
since it does not need to move the text's background down to the client and 
then back up to the server every time a character (or run of characters) is
drawn. A character's alpha mask only needs to be sent up to the Xrender
extension once which keeps a copy on the server. 

another minor point: Xrender is also faster since it does not try to blend
(move) the blank pixels over the video bus which is significant since text 
tends to have a high percentage of blank pixels. Sadly, this may not matter 
for Mozilla since I note that the code seems to draw the text to an off screen
copy of the window and then blit the off screen copy to the screen. I suspect
that this "double buffering" is done to prevent flicker. I do not know if
Xrender is able to use hardware blending for off screen windows.

(the diffs are broken up since patch chokes on Makefile.in)
Attachment #59010 - Attachment is obsolete: true
Attachment #59046 - Attachment is obsolete: true
Attached patch patch; mozilla/gfx/src dir (obsolete) — Splinter Review
now uses the alpha blending routines from bug 90813
now uses the DB code from bug 96768
the db code is already in attachment 60415 [details] [diff] [review]
this fixes MOZ_MATHML=1 building, although nsFreeType::InitLibrary rejects to
do initialization with MOZ_MATHML defined. but this might be needed for the
future.
removed gfx/src/gtk bits
Attachment #60414 - Attachment is obsolete: true
the non Xft version is in, see bug 116147 

blizzard is working on a Xft version

hopefully we will merge the best of the 2 versions 
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.