Closed Bug 357733 Opened 18 years ago Closed 14 years ago

Use Pango for printing

Categories

(Core Graveyard :: GFX: Gtk, defect)

1.8 Branch
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE
mozilla1.8.1

People

(Reporter: mozilla, Unassigned)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Epiphany/2.14 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Epiphany/2.14 Attaching patch that makes firefox make use of Pango for printing whenever it's using it for text rendering. This makes it possible to print Indic for example. It also prints bitmap fonts by tracing them (one square per pixel!). As a bonus, I've made it to print MathML too! Downstream Red Hat bug is: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=182533 And sample output can be found at: http://www.gnome.org/~behdad/FirefoxPangoPrinting/ Basically what I have done: * copied nsFontExtentsPango.{cpp,h} and mozilla-decoder.[ch] from gfx/src/gtk into gfx/src/ps and rename them appropriately. * Change nsFontExtentsPSPango to work with a nsRenderingContextPS instead of nsRenderingContextGTK, and to implement a PangoRenderer to generate PS output. * Move DrawString, GetTextDimensions, and GetBoundingMetrics implementations from nsRenderingContextPS to nsFontExtentsPS and make the rendering context delegate to the nsFontExtentsPS. * Change nsDeviceContextPS to instantiate nsFontExtentsPSPango instead of nsFontExtentsPS if Pango text rendering is enabled at run-time. * Change nsPostScriptObject to use accept glyphs instead of characters, and to generate output from a PangoGlyphString object. Reproducible: Always
Attached patch the patch (obsolete) — Splinter Review
Differences to the previous patch: - Wrap impl of GetBoundingMetrics around #ifdef MOZ_MATHML - Add system-headers wrappers for includes so that building with visibility on e.g. x86-64 works.
Attachment #243261 - Attachment is obsolete: true
Attachment #243837 - Flags: superreview?(roc)
Attachment #243837 - Flags: review?(roc)
Where are we going to land this? This code isn't going to be used in Gecko 1.9. Do you want to land this on the 1.8.1 branch?
(In reply to comment #3) > Where are we going to land this? This code isn't going to be used in Gecko 1.9. > Do you want to land this on the 1.8.1 branch? Any branch that affects future releases of Firefox 1.5.x (if any) and 2.x.
Those branches are only going to be taking security or serious stability fixes, I think, so this doesn't qualify.
Attached patch Updated patchSplinter Review
Attaching updated patch. I merged back the PS nsFontMetricsPango into the Gtk+ one. They are not the same file copied into gtk/ and ps/, with #ifdef sections when necessary. Reduces maintenance. Also in the patch is improved ligature and combining marks handling in justified text, and robust NUL/invalid text sequence handling.
(In reply to comment #5) > Those branches are only going to be taking security or serious stability fixes, > I think, so this doesn't qualify. > I'm just curious, does "Those branches" include 2.x too?
Yes. However, at the Firefox Summit we agreed to a change in policy that should allow this to land on branches. Stay tuned
Blocks: 346062
Status: UNCONFIRMED → NEW
Ever confirmed: true
roc, what do you think about this patch. Is it good enough for distributors to prefetch it?
I don't know. It's a pretty huge patch.
So, no one has been touching the pango backend for a few years, and now I have a patch that fixes crashes, fixes printing, and fixes rendering of ligatures. The patch is shipped in Fedora Core 6 and Red Hat Enterprise Linux 5. I'm not sure that letting it sit here helps moving forward. On the other hand, in a year or two it will be obsolete, so maybe I don't really care. Cheers,
Component: General → GFX: Gtk
Product: Firefox → Core
QA Contact: general → gtk
Target Milestone: --- → mozilla1.8.1
Version: unspecified → 1.8 Branch
I haven't looked at the code, but knowing Behdad it's likely to be pretty good. I would suggest that you guys look at the patch when he uploads it.
The patch in comment #6 is the latest version for ff1.5. Someone is porting it to ff2, I'll attach when it's done.
Product: Core → Core Graveyard
I'm thinking there's no reason to leave this bug open anymore?
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
Heh, yeah.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: