Closed Bug 90385 Opened 24 years ago Closed 23 years ago

Linux: how to print using FreeType

Categories

(Core :: Internationalization, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 144663
mozilla1.1alpha

People

(Reporter: bstell, Assigned: bstell)

Details

(Keywords: intl)

Attachments

(12 files, 15 obsolete files)

169.38 KB, patch
Details | Diff | Splinter Review
66.41 KB, image/png
Details
128.92 KB, application/octet-stream
Details
82.82 KB, image/png
Details
245.63 KB, application/octet-stream
Details
5.28 KB, image/png
Details
95.79 KB, text/plain
Details
12.24 KB, image/png
Details
120.58 KB, text/plain
Details
42.70 KB, application/octet-stream
Details
53.66 KB, application/octet-stream
Details
1.52 KB, patch
Details | Diff | Splinter Review
assumming Mozilla is modified to use FreeType we will need to determine how printing will work with FreeType
Depends on: 82076
Status: NEW → ASSIGNED
Target Milestone: --- → Future
QA Contact: andreasb → ylong
My current plan is to generate Postscript and send it to Ghostscript for which will rendering to the specific piece of hardware (the printer). To maintain the best visual quality I plan to embedd the TrueType data in the Postscript (AKA: Type42). To provide for a large character set I plan to use CID keying. To make the output as compact as possible I plan to do "incremental glyph loading" (only send the needed glyphs). The name for a Postscript CID keyed Type42 font is Type11. I have "hand" built a Type11 font with incremental glyph loading. I plan to start with the OpenOffice psprint code and add Type11 to it.
bstell: Is there any PostScript printer which understands "Type42" ?
My plan is to send the data to Ghostscript not a Postscript printer.
For the first step I'm going to build a demo. For the demo I will aim for functionality and will not spend time on things I am fairly sure are doable. The demo should be able to print a Japanese page but will have the following issues that will still need to be addressed: hardcoded the font name (should come from CSS / prefs) always load the one font in the begin document (should load fonts as needed) always send the glyph data everytime a char is output (should keep track of which glyphs have been sent so we only send them once) assume the fonts supports all the needed chars send the all the Unicode CID ranges (only need to send those where the font has chars) When the demo is working we can discuss what to do next.
Target Milestone: Future → mozilla1.1
No longer depends on: 82076
-> nsbeta1
Keywords: intl, nsbeta1
Yuying: thanks for the nsbeta1 vote. I also really want to get this in. I doubt however, I will have code ready before the freeze for 1.0.
Just FYI.... The ultimate solution to bug 121879 and bug 126602 (and many other printing issues, needless to say) appears to be FT printing.
could you expand on what 'FT printing' means
nsbeta1- . This is a post m1.0 feature .
Keywords: nsbeta1nsbeta1-
Attached file sample postscript output (obsolete) —
sample postscript with the hmtx table
Attached file tar/gz of demo program (obsolete) —
There are several problems: Currently Ghostscript can has problems reading the metrics from the incrementaly loaded glyphs. Ghostscript seems to crash on certain fonts/glyphs. The demo code is working but far from beautiful. My Postscript is still limited so I'm probably doing many things wrong.
Attached image postscript displayed via ghostview (obsolete) —
Attached image without hmtx table (obsolete) —
This bit puts the OpenOffice fontsubsetting code in mozilla/gfx/src/ps/OpenOffice. I'm not sure where it should go right now.
I just wanted to get something started so I hacked in the gfs/src/ps dir to make moz use truetype to print. This is a total hack and needs lots of rework. It requires the modified OpenOffice printing code. It is fairly buggy. It crashes Ghostscript.
Attachment #74255 - Attachment is obsolete: true
this sort of works (still buggy)
Attachment #74252 - Attachment is obsolete: true
Attachment #74275 - Attachment is obsolete: true
Attachment #74737 - Attachment is obsolete: true
Attached patch patches to Ghostscript (6.53) (obsolete) — Splinter Review
Attachment #74276 - Attachment is obsolete: true
Attachment #74254 - Attachment is obsolete: true
Attachment #74739 - Attachment is obsolete: true
Attached patch add string width measuring code (obsolete) — Splinter Review
Attachment #75131 - Attachment is obsolete: true
Attached patch patches to Ghostscript (6.53) (obsolete) — Splinter Review
Attachment #75013 - Attachment is obsolete: true
Attachment #75009 - Attachment is obsolete: true
Attached patch minor tweaks (obsolete) — Splinter Review
this still needs: 1) code to find the correct font (currently hard coded to use '/tmp/font.ttf') 2) code to allow the existing AFM code to co-exist with this code 3) support for multiple fallback fonts
Attachment #75258 - Attachment is obsolete: true
substitute '-' for spaces in family name
Separated FreeType2 access code (nsFreeType) from code that draws to screen (nsFreeTypeX11). Printing code now uses (a separate copy of) the font catalog. Printing code now falls back to font prefs if CSS font not found. This still needs lots of work.
Attachment #75671 - Attachment is obsolete: true
Attachment #75673 - Attachment is obsolete: true
(note: requires patched Ghostscript; see attachments)
(Note: requires patches to Ghostscript; see attachments)
Attachment #75876 - Attachment description: png of www.mozilla.org/start using a font I found on the web → png of www.mozilla.org/start using a font I found on the web displayed via GhostScript
Attachment #75876 - Attachment description: png of www.mozilla.org/start using a font I found on the web displayed via GhostScript → png of www.mozilla.org/start using a font I found on the web (displayed via GhostView)
Attachment #75879 - Attachment description: png of www.yahoo.co.ja printout displayed via GhostView → png of www.yahoo.co.ja printout (displayed via GhostView)
Attachment #75873 - Attachment description: Still needs lots of work. Print code now uses font catalog and prefs. → Print code now uses font catalog and prefs. Still needs lots of work.
Attached image png; simplified chinese
Can Sun's china team verify Bstell's PS can be viewed on Solaris DPS?
Can Sun China try applying the patches to Ghostscript 6.53 and ghostscript/ghostview/print the postscript examples?
Brian, No problem. We will do it later. I just compiled mozilla with freetype enabled last week. And I will try your patch this week.
Brian, I have built ghostscript on my workstation with your patch. And all the ps files you uploaded work fine for me.
Pete, how about Solaris DPS? Does it work also?
My platform is SunOS 5.9 s81_51 sun4u sparc SUNW,Sun-Blade-100 And I used gcc to build ghostscript. Masaki:I will try DPS later.
> I have built ghostscript on my workstation with your patch. And all the > ps files you uploaded work fine for me. very cool ;) Just curious: do you use ghostview (gv) to display the output? You might also want to try building the "tar/gz; minor fixes to OpenOffice fontsubstting code" (attachment 75871 [details]) 'stand alone'. You could then generate your own postscript.
Katakai, Can not use DPS to view those ps files. Does DPS need upgrade? Brain, I'm using gs to view them.
I finally figured a way to handle the "gsave/grestore removes the incremental glyph definitions": 1) Wrap the gsave calls to push a hash on a stack of inc-glyph hashes. 2) Everytime a glyph to be drawn check if the bit in the font's bit array is set. If the bit is not set then set the bit, add an entry for the font/glyphID to the current (top of stack) inc-glyph hash, and output the outline info. 3) Wrap the grestore call to pop the current inc-glyph hash and clear the bit in the font's bit array for the font/glyphID pairs that are found in the hash
All, > My plan is to send the data to Ghostscript not a Postscript printer. We shouldn't assume the destination for printing is only ghostscript. It would not be acceptable on non-Linux system which do not have ghostscript. If the system has the ghostscript but if user needs to update to the latest to use Mozilla, it would not be acceptable too. It's OK if we consider only power-users of Linux. They can configure their ghostscript and Mozilla easily by their needs. But it does not work for normal enduser and Linux/Unix distributors. It would be OK if the first version of prototype is only Type42 and requires ghostscript patch, but the final version of this support should have Type1 or Type3 embedded fonts also, to support existing PostScript printers and existing ghostscript. I think it would be required, - output is Type42, Type1 or Type3 embedded fonts - Should have UI for selection of these types on preferences dialog - Should have preference to control the default value If there is a distribution who doesn't want to update ghostscript but wants to support Mozilla FreeType2 printing, the distribution can define "type3" or "type1" in preference as e.g. "freetype2. print.outputformat".
> We shouldn't assume the destination for printing is only ghostscript. > It would not be acceptable on non-Linux system which do not have > ghostscript. Could you list the systems where Linux/Unix Mozilla/Netscape works but Ghostscript is not available? > If the system has the ghostscript but if user needs to > update to the latest to use Mozilla, it would not be acceptable too. Could you state why you think it not acceptable to ask the user to update Ghostscript? > It would be OK if the first version of prototype is only Type42 and > requires ghostscript patch, but the final version of this support > should have Type1 or Type3 embedded fonts also, to support > existing PostScript printers and existing ghostscript. How do you plan to support CJK fonts with existing printers? Do you plan to implement font subsetting to handle the 8 bit font limit?
Attachment #75871 - Attachment is obsolete: true
no longer need fix for composite glyphs
Attachment #75669 - Attachment is obsolete: true
Attachment #79547 - Attachment description: tar/gz; fix composite glyph layout bug → tar/gz; OpenOffice code with fix for composite glyph layout bug
*** This bug has been marked as a duplicate of 144663 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Mark as verified due bug 144663 handles all the free type print issues.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: