[wx-dev] Re: Needing infos and test/sample application(s) for wxWidgets printing framework

Stefan Csomor csomor at advancedconcepts.ch
Fri Jan 19 22:19:13 PST 2007


Hi Ulrich

> > what I meant is that wxPdfDC is needed, and that on some platforms
> > this might be implemented using a native backend and on all others
> using
> > wxPdfDocument
> 
> Which platforms would need an implementation based on wxPdfDocument?
> Mac
> OSX has Quartz and/or Cairo, GTK has GnomePrint/Pango/Cairo. On
> Windows
> one could install a PDF printer driver (there are commercial and
> freeware solutions). That is, on the most used platforms usable PDF
> printing solutions already exist. Is it really worth the effort to
> implement a wxPdfDocument based wxPdfDC?

Definitely yes, having this integrated increases the usability in an
application tremendously. 
 
> wxPdfDocument is currently able to embed Type1 PostScript fonts,
> TrueType and TrueTypeUnicode fonts and OpenTypeUnicode fonts. For
> TrueType and TrueTypeUnicode font subsetting is supported. In the
> process of creating subsets TrueType font files are analyzed.
> Probably it would not be too hard to extend this process to generate
the
> needed font metrics information. For OpenType fonts it's a bit
different as
> to my knowledge the format is more complex. The tool I use to generate
> the font metrics files for OpenType fonts uses the Freetype library.

> Another restriction of wxPdfDocument is that TrueTypeUnicode and
> OpenTypeUnicode fonts are only supported in the Unicode build. In the
> ANSI build only Type1 PostScript fonts and normal TrueType fonts are
> supported.
> 
> Would it be acceptable to restrict wxPdfDC to the use of the standard
> fonts (like in the current implementation of wxPostScriptDC)?

I think as a first version this would absolutely be ok, we have to
document it properly. In my own app - being a word processor component -
I'm not in the position to tell the users just to use the PDF standard
fonts when creating documents, but in normal situations we are in the
position to determine which fonts to use for output, and so can we for
wxPdfDc

> In any case adding support for analyzing font files on the fly to
> wxPdfDocument would be a major effort.

As I said, I think supporting truetype fonts for version 2 would be
enough, I can give you the code I had to write in order to find the
matching fonts - and some help for analyzing the tables.

Thanks,

Stefan





More information about the wx-dev mailing list