From: Jesper S. <je...@no...> - 2003-04-25 14:46:17
|
Tony, All, Sorry for the late reply. Tony Graham wrote: > > Are you able to contribute your code to xmlroff or PangoPDF? > Yes, as soon as I have some more time and the code is in reasonable shape I will. Perhaps the best thing would be to write the 'screen renderer' in a cross platform tool kit (wxWindows,QT,GTK+) and use a pango backend based on FT2/fontconfig. > > I also had to change area-to-pdf, since it used PDFLib, but I don't > > think that it would be to hard to avoid that. If that happens > > perhaps area-to-pdf could be renamed to something like > > render-area.[hc]? > > The current CVS code has fo_doc_render_layout() and > fo_doc_render_layout_lines() so area-to-pdf no longer has any > dependency on PDFlib. Time to sync with cvs. Greate! > > area-to-pdf is called that because it described what was happening at > the time. > > Now that none of area-to-pdf uses PDFlib, it is also possible to break > up area-to-pdf and put each area type's code into the area type's > implementation of the currently unused 'draw' function of FoArea. > Is this something you are planning todo in the nearest future? And now ower to something completely different. *** If I understand xmlroff correctly you are using pt as 'device-unit'. This works ok when using pangopdflib since it too (I assume) use pt as unit, but my pango-win32 backend use pixel as unit. The result of this is that all lengths/widths/heights are sometimes measured in pixel (when they are 'received' from pango) and sometimes in pt. It's not possible to know when to convert from pt to px and when not to do it. I can see two solutions to this: 1. All pango-backends compatible with xmlroff must use pt as a unit. 2. Use a 'scale' in xmlroff to convert to pango-device-units, or convert from pango-device-units to xmlroff-device-units. 1. will loose precision and will not be compatible with: http://developer.gnome.org/doc/API/2.0/pango/pango-Glyph-Storage.html#PangoGlyphUnit 2. seems the way to do it. I don't know if there is an API in pango that lets you express the device-unit in a 'known' unit, i.e. 'pango_deviceunit_to_twips' etc. If not, the 'scale' has to be set explicit by the 'client' of xmlroff/libfo. Thoughts? Have a nice weekend, Jesper. *** May contain traces of nuts. |