Return-Path: Delivered-To: apmail-xmlgraphics-fop-dev-archive@www.apache.org Received: (qmail 4820 invoked from network); 22 Dec 2005 13:35:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Dec 2005 13:35:10 -0000 Received: (qmail 16489 invoked by uid 500); 22 Dec 2005 13:35:09 -0000 Delivered-To: apmail-xmlgraphics-fop-dev-archive@xmlgraphics.apache.org Received: (qmail 16168 invoked by uid 500); 22 Dec 2005 13:35:07 -0000 Mailing-List: contact fop-dev-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-dev@xmlgraphics.apache.org Delivered-To: mailing list fop-dev@xmlgraphics.apache.org Received: (qmail 16155 invoked by uid 99); 22 Dec 2005 13:35:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 05:35:07 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [213.239.215.103] (HELO tux17.hoststar.ch) (213.239.215.103) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Dec 2005 05:35:06 -0800 Received: from [127.0.0.1] (zux221-208-093.adsl.green.ch [81.221.208.93]) (authenticated bits=0) by tux17.hoststar.ch (8.12.11/8.12.11) with ESMTP id jBMDYgY7000112 for ; Thu, 22 Dec 2005 14:34:50 +0100 Date: Thu, 22 Dec 2005 14:34:20 +0100 From: Jeremias Maerki To: fop-dev@xmlgraphics.apache.org Subject: Doing changes in the font area Message-Id: <20051222140018.6FF8.DEV@jeremias-maerki.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.12.01 [en] X-Antivirus: avast! (VPS 0551-3, 12/22/2005), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I feel bad about the font story, especially since Vincent put so much work into something that I first supported and now had to recommend to put off. Even worse, I now have to do some changes in the font area which will certainly create merge conflicts on his working copy. Here's what I plan to do: Currently the area tree saves the internal font key (F1, F2, F3 etc.) as the FONT_NAME trait. This key maps directly to the font that was chosen during the font lookup. One such F-key can map to several font-triplets (ex. "Helvetica,oblique,600"). All is fine as long as the area tree is used as it is now: just a temporary data structure until the renderers convert it into the target format. Even if single pages are off-loaded to temporary files by the CachedRenderPagesModel, everything still happens in one rendering run. Now, when the intermediate format comes into play, the whole thing gets a little more complicated. Assume that during the day a company renderers several documents to the intermediate format and stores them in a buffer. In the night, all the pending documents are gathered together by a batch process and a PostScript print stream is generated from all the documents created during the day. In the morning the print departments prints all the documents of the previous day. Now, imagine that one evening the IT people add a new font to the font configuration and restart the server. The F-keys might not point to the same font as before anymore. Maybe a special scenario but it shows that this approach is not stable enough for the intermediate format. It seems much more stable to store the font triplet in the area tree instead of the F-key. Directly storing the original font specification would not be such a good idea because there's font subsitution in the middle and the layout is done after the font subsitution. It would be bad to rely on the font substitution to be stable. A lot of words to describe a relatively simple change I plan to do: I want to define a simple (Serializable) FontKey class that replaces the mere String that is built by FontInfo.createFontKey(). FontKey will contain the same three values as the String. The FontKey class will be used instead of the String for the FONT_NAME trait (which I'll rename to "FONT" trait). The requirement for any trait is to be serializable, something, BTW, that the FontUse object from aXSL isn't. In Vincent's patch the FontUse object is stored in the FONT_NAME trait instead of the internal F-key. That is not to make Vincent's patch bad. He probably couldn't know. This is simply an aspect we neglected a little lately (see the references on the FO tree I removed, for example). BTW, I successfully rendered a document using the CachedRenderPagesModel today where unresolved pages were off-loaded to disk until they were ready to be resolved and rendered. A little step in the direction of handling bigger documents as a side-product of my current work. Jeremias Maerki