Karl Wright | 1 Feb 02:35
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

On Tue, Jan 31, 2012 at 8:04 AM, Tim Williams <williamstw <at> gmail.com> wrote:
> On Tue, Jan 31, 2012 at 3:16 AM, Karl Wright <daddywri <at> gmail.com> wrote:
>> Hi Hitoshi,
>>
>> plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
>> does seem like the right place to conditionalize things, but I'm
>> unclear in your example where the language specifier comes from?  In
>> other words, I'd like the path to the current file to determine the
>> language, not the system settings.  Do you (or does anyone else) know
>> how to construct a conditional within the document-to-fo.xsl file that
>> would (say) base a decision for a font choice on whether a file had a
>> name that matched a particular regular expression?  That's the kind of
>> logic I'm looking for here.
>
> Hi Karl,
> Know?  Unfortunately not - this is a guess.  Create a copy of
> document-to-fo.xsl - using the project-specific locationmap to find
> it.  Then, inside your own document-to-fo.xsl you should have access
> to a "path" parameter.  You may add an additional condition to the
> font of interest (e.g. rootFontFamily) that uses XSL string functions
> against your $path parameter. Unfortunately, I can't verify any of
> this until tonight.
>
> Thanks,
> --tim

Thanks, Tim, for the reply.  I'll experiment to see if I can use $path
in the manner I need.

Could you elaborate on where the "project-specific locationmap" should
(Continue reading)

Karl Wright | 1 Feb 02:48
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

On Tue, Jan 31, 2012 at 8:35 PM, Karl Wright <daddywri <at> gmail.com> wrote:
> On Tue, Jan 31, 2012 at 8:04 AM, Tim Williams <williamstw <at> gmail.com> wrote:
>> On Tue, Jan 31, 2012 at 3:16 AM, Karl Wright <daddywri <at> gmail.com> wrote:
>>> Hi Hitoshi,
>>>
>>> plugins/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl
>>> does seem like the right place to conditionalize things, but I'm
>>> unclear in your example where the language specifier comes from?  In
>>> other words, I'd like the path to the current file to determine the
>>> language, not the system settings.  Do you (or does anyone else) know
>>> how to construct a conditional within the document-to-fo.xsl file that
>>> would (say) base a decision for a font choice on whether a file had a
>>> name that matched a particular regular expression?  That's the kind of
>>> logic I'm looking for here.
>>
>> Hi Karl,
>> Know?  Unfortunately not - this is a guess.  Create a copy of
>> document-to-fo.xsl - using the project-specific locationmap to find
>> it.  Then, inside your own document-to-fo.xsl you should have access
>> to a "path" parameter.  You may add an additional condition to the
>> font of interest (e.g. rootFontFamily) that uses XSL string functions
>> against your $path parameter. Unfortunately, I can't verify any of
>> this until tonight.
>>
>> Thanks,
>> --tim
>
> Thanks, Tim, for the reply.  I'll experiment to see if I can use $path
> in the manner I need.
>
(Continue reading)

Karl Wright | 1 Feb 03:23
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

> Then, inside your own document-to-fo.xsl you should have access
> to a "path" parameter.  You may add an additional condition to the
> font of interest (e.g. rootFontFamily) that uses XSL string functions
> against your $path parameter.
>

I've set things up so that my document path includes the language code
(e.g. 'en_US') as the first part of the path under
src/documentation/content/xdocs.  For example,
src/documentation/content/xdocs/en_US/mydocument.xml would be the
starting point.  The question is what the $path variable will contain
- if it's just "en_US/mydocument.xml" my job is easy.  If it could be
"en_US\mydocument.xml" on Windows and "en_US/mydocument.xml" on Unix
it's a bit harder.   But if it is the absolute path xsl expressions
aren't going to help me and I'd better find a better solution.

What I'd do (and this might even make a decent general patch) is look
for the property with the language specifier first.  For example,
instead of looking for "output.pdf.fontFamily.sansSerif" first, I'd
look for "output.pdf.fontFamily.sansSerif.en_US" first, and only look
for the other if that property is not found.

So, what can I expect to see for the $path parameter?

Thanks again for your help!
Karl

Karl Wright | 1 Feb 14:02
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

FWIW, the $path has just what I hoped in it and works well.

Thanks!
Karl

On Tue, Jan 31, 2012 at 9:23 PM, Karl Wright <daddywri <at> gmail.com> wrote:
>> Then, inside your own document-to-fo.xsl you should have access
>> to a "path" parameter.  You may add an additional condition to the
>> font of interest (e.g. rootFontFamily) that uses XSL string functions
>> against your $path parameter.
>>
>
> I've set things up so that my document path includes the language code
> (e.g. 'en_US') as the first part of the path under
> src/documentation/content/xdocs.  For example,
> src/documentation/content/xdocs/en_US/mydocument.xml would be the
> starting point.  The question is what the $path variable will contain
> - if it's just "en_US/mydocument.xml" my job is easy.  If it could be
> "en_US\mydocument.xml" on Windows and "en_US/mydocument.xml" on Unix
> it's a bit harder.   But if it is the absolute path xsl expressions
> aren't going to help me and I'd better find a better solution.
>
> What I'd do (and this might even make a decent general patch) is look
> for the property with the language specifier first.  For example,
> instead of looking for "output.pdf.fontFamily.sansSerif" first, I'd
> look for "output.pdf.fontFamily.sansSerif.en_US" first, and only look
> for the other if that property is not found.
>
> So, what can I expect to see for the $path parameter?
>
(Continue reading)

Tim Williams | 1 Feb 14:05
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

On Wed, Feb 1, 2012 at 8:02 AM, Karl Wright <daddywri <at> gmail.com> wrote:
> FWIW, the $path has just what I hoped in it and works well.

My apologies Karl, I got busy last night and didn't have a chance to
get back to this:(  I haven't confirmed but path should be the request
path (of the URL) - so the same on both systems.

--tim

> Thanks!
> Karl
>
> On Tue, Jan 31, 2012 at 9:23 PM, Karl Wright <daddywri <at> gmail.com> wrote:
>>> Then, inside your own document-to-fo.xsl you should have access
>>> to a "path" parameter.  You may add an additional condition to the
>>> font of interest (e.g. rootFontFamily) that uses XSL string functions
>>> against your $path parameter.
>>>
>>
>> I've set things up so that my document path includes the language code
>> (e.g. 'en_US') as the first part of the path under
>> src/documentation/content/xdocs.  For example,
>> src/documentation/content/xdocs/en_US/mydocument.xml would be the
>> starting point.  The question is what the $path variable will contain
>> - if it's just "en_US/mydocument.xml" my job is easy.  If it could be
>> "en_US\mydocument.xml" on Windows and "en_US/mydocument.xml" on Unix
>> it's a bit harder.   But if it is the absolute path xsl expressions
>> aren't going to help me and I'd better find a better solution.
>>
>> What I'd do (and this might even make a decent general patch) is look
(Continue reading)

Tim Williams | 2 Feb 01:44
Picon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

For the archives, it looks like this is the commit [
http://svn.apache.org/viewvc?view=revision&revision=1239111 ].  If
this is a common need, perhaps a candidate to just get rolled into
Forrest itself, I dunno.

FWIW, I'm pretty sure the output.xmap is unnecessary and you could
have used a project-specific locationmap to point to your custom
document-to-fo.xsl but maybe I'm missing something...

--tim

On Wed, Feb 1, 2012 at 8:02 AM, Karl Wright <daddywri <at> gmail.com> wrote:
> FWIW, the $path has just what I hoped in it and works well.
>
> Thanks!
> Karl
>
> On Tue, Jan 31, 2012 at 9:23 PM, Karl Wright <daddywri <at> gmail.com> wrote:
>>> Then, inside your own document-to-fo.xsl you should have access
>>> to a "path" parameter.  You may add an additional condition to the
>>> font of interest (e.g. rootFontFamily) that uses XSL string functions
>>> against your $path parameter.
>>>
>>
>> I've set things up so that my document path includes the language code
>> (e.g. 'en_US') as the first part of the path under
>> src/documentation/content/xdocs.  For example,
>> src/documentation/content/xdocs/en_US/mydocument.xml would be the
>> starting point.  The question is what the $path variable will contain
>> - if it's just "en_US/mydocument.xml" my job is easy.  If it could be
(Continue reading)

David Crossley | 2 Feb 01:56
Picon
Favicon

Re: Is there a decent way of using different PDF fonts for different parts of a Forrest site?

Tim Williams wrote:
> For the archives, it looks like this is the commit [
> http://svn.apache.org/viewvc?view=revision&revision=1239111 ].  If
> this is a common need, perhaps a candidate to just get rolled into
> Forrest itself, I dunno.

For the document-to-fo.xsl part.

> FWIW, I'm pretty sure the output.xmap is unnecessary and you could
> have used a project-specific locationmap to point to your custom
> document-to-fo.xsl but maybe I'm missing something...

Yes i reckon that is correct.

-David

> --tim
> 
> On Wed, Feb 1, 2012 at 8:02 AM, Karl Wright <daddywri <at> gmail.com> wrote:
> > FWIW, the $path has just what I hoped in it and works well.
> >
> > Thanks!
> > Karl
> >
> > On Tue, Jan 31, 2012 at 9:23 PM, Karl Wright <daddywri <at> gmail.com> wrote:
> >>> Then, inside your own document-to-fo.xsl you should have access
> >>> to a "path" parameter.  You may add an additional condition to the
> >>> font of interest (e.g. rootFontFamily) that uses XSL string functions
> >>> against your $path parameter.
> >>>
(Continue reading)


Gmane