GNOME Bugzilla – Bug 95885
[GNOMEVER2.3] extesion for i18n printing with font subsettings
Last modified: 2004-12-22 21:47:04 UTC
installer uses freetype to get TrueType font family/subfamily/fullname. And freetype 2.1.3 does handle only Unicode encoded ASCII names. But Solaris CJK TrueType has localized names in them, so these names will be ??? or such font entry is not written.
Want to apply two changes into libgnomeprint to enable CJK printing, and also it could be done quikckly. [change in libgnomeprint/installer] Add CJK TrueType fonts into gnome-print.fontmap file. The current one has only latin font information on Solaris. Adding this change enabled CJK printing itself, but it results in a large size of ps output since whole font glyphs are embedded in the ps output and making it very slowly printed. Hence, we need to add the following change so that only a required subset of font glyphs to be embedded into the ps output. [change in libgnomeprint/libgnomeprint] Use the font subsetter code for multibyte character printing. The font subsetter code in the 'sft' sub-directory was copied over *as is* from the OpenOffice.org where it was first developed and integrated. [That's the only reason why the patch is large, while only a subset of functions are used. but we don't like to commit a risk to break the patch by cutting it out.] Please review two patches in sun-patches module in cvs. They are at libgnomeprint/324-95885-s.diff and libgnomeprint/325-95885-s.diff.
changing summary to suite to what the patch is proposing.
This fuctionality is great, I'd love to have it in gnome-print. However, we no longer build, use or ship gnome-font-install. Can you update the patch to reflect this? After you do, I will be more than happy to review it and apply it. I'm going to put the bug in NEEDINFO for now, please reopen after you update the patch. thanks again, Chema
Attached an updated patch (doesn't include the sft directory). Changes I made: - sft lives in the toplevel directory, not in libgnomeprint - the "if (pso->encodedbytes == 1)" goes inside gff_pso_ensure_buffer so that the _ensure_buffer functions takes care of embeding the font, how it wants to do it (subset or not) becomes a decision for that function. - removed the font-install part of the patch since we don't have an installer anymore. Stuff that we need to resolve: 1. const gchar *no_type42 = g_getenv("GNOME_PRINT_NO_TYPE42"); needs not to be an enviromental variable but a config option side GnomePrintConfig (but don't worry about this part, I will fix this issue myself since the code in GnomePrintConfig needs work) 2. On the original patch, the font names where modified and thus changed the structure of the gnome-print fontmap (which is wrong since it breaks older fontmaps for the users). Since we no longer have a font-map, we need to update the patch to be able to interpret the name given by fontconfig. Question: Is the code inside 'sft' unmodified from the openoffice.org?
Created attachment 12821 [details] [review] patch
>Is the code inside 'sft' unmodified from the openoffice.org? Mostly, unmodified. The original is found at oo_1.0.1_src/psprint/source/fontsubset/ in OpenOffice 1.0.1 tarball. An only major change was to remove the reference to GSUB code (written in C++).
Chema: With further testing, we've realized that: gf_pso_sprintf (pso, "/Encoding 256 array 01 255 {1 index exch 0 put} for def\n"); have to be like: gf_pso_sprintf (pso, "/Encoding 256 array 01 255 {1 index exch .notdef put} for def\n"); to work with Adobe Interpreter. Please apply this change when you commit the patch in.
oops, sorry. It had to be "/.notdef", so the correct code is: gf_pso_sprintf (pso, "/Encoding 256 array 0 1 255 {1 index exch /.notdef put} for def\n");
It would be best if the patch was updated. It doesn't need to happen right now, but some time in the future. The patch is still not ready to go in, it needs a bit of work.
Is there any chance of updating the patch per chema's suggestions ? It would be nice to get this in for gnome-2.6
Yes, I'll do and attach a new patch. will reassign to myself.
Any chance to receive a patch before code-freeze ?
I suspect any patch would conflict horribly with the pdf/ps2 changes for fontsubsetting. Hopefully those have addressed this too. If not we can reopen