thanks for the link I'll check it.

I thought about font parameterizing for one greater purpose. Consider
multilingual system, now it is not possible to have reports in Chinese ,
Russian, French etc. on one build(at once). If it would be possible to
associate font with locale and pass this font to reports, we would get truly
multilingual system. No more broken encoding, automatic document/report
translation and etc.
Of course this would require teplates(table size etc.) for fonts but it
would work without it too.

I have tested this and it works.

placed
<#if (defaultFontFamily?exists)><#if (defaultFontFamily != "
pdf.default.fontfamily" && defaultFontFamily != "")>
font-family="${defaultFontFamily}" </#if></#if>
into <fo:page-sequence master-reference="main-page"> in
reportTemplate.fo.ftl

<property-to-field field="defaultFontFamily" resource="general" property="
pdf.default.fontfamily" default=""/>
into actions in FoReportDecorator

pdf.default.fontfamily=Arial
into general.properties

maybe it is not elegant but it works, test it with your font if you like.

Krzysztof Podejma

2007/6/28, Oleg Andreyev <[EMAIL PROTECTED]>:



Krzysztof Podejma пишет:
> in trunk - current distribution default value would stay as it is now,
> and
> nobody will change it to font that use metrics that aren't in trunk.
> I think it is good idea to change default font in one place instead of
> modifying all reports each.
IMHO, for custom solutions replace works faster:) But you are right on
the whole.
>
> if you want to have more than one font in your pdf you can always
> override a
> font-family for block or for entire document.
> this property would have ability to not take effect if not set
>
> Nobody wants to crash anything, we want to have less work because we use
> non-English characters and it is a pain to track all new pdf's and
> check if
> they print correctly.
>
> +1 fop.xconf
> AFAIK fop.xconf is necessary for custom fonts but you cannot set default
> font in fop.xconf, correct me if I'm wrong
http://xmlgraphics.apache.org/fop/0.93/fonts.html
Pay attention to last topic. Theoretically if you have font Helvetica
you can embed it as any other.


> We need this property because we have fop.xconf and font metrics
> installed
> and we don't want to modify and/or merge all pdf files.
>
> Krzysztof Podejma
>
> 2007/6/27, Oleg Andreyev <[EMAIL PROTECTED]>:
>>
>> -1
>> There are no universal solutions in this field.
>> What's happened if somebody will add Arial(or Tahoma, or something
else)
>> as value this property in current distribution?
>> Nothing. Just another error message in log.
>> I have the same problems with Cyrillic fonts but apart from accessible
>> programmatically default font name we need right fop.xconf, metrics and
>> fonts itself installed in the system. Such property may be useful only
>> if you well understand the rest configuration tasks. This is a point of
>> mistake.
>>
>> As remark. I'd like to see standard fop.xconf in the trunk. One from
FOP
>> distribution just well commented and can be used as guide by new users
>> and developers.
>> https://issues.apache.org/jira/browse/OFBIZ-990
>>
>> If fop.xconf will in trunk, it would be rightly move page height/width
>> to config as part of the localization process. Now these hardcoded tags
>> define Letter, not widely used paper format outside US.
>>
>>
>> Krzysztof Podejma пишет:
>> > yes me too +1 general.properties with default fop font
>> >
>> >
>> > 2007/6/27, Jacques Le Roux <[EMAIL PROTECTED]>:
>> >>
>> >> +1 for  general.properties
>> >>
>> >> Jacques
>> >>
>> >> De : "Krzysztof Podejma" <[EMAIL PROTECTED]>
>> >> > big thanks it works perfect.
>> >> > I think the pdf font should be parametrized somewhere in
properties
>> >> i.e
>> >> > general.properties
>> >> >
>> >> > I've found that there are used two different fonts: one when you
>> set
>> >> > font-family="" and another one when you dont't specify this
>> attribute.
>> >> > maybe the second one is set somewhere...
>> >> >
>> >> > Krzysztof Podejma
>> >> >
>> >> >
>> >> > 2007/6/27, Christian Geisert <[EMAIL PROTECTED]>:
>> >> > >
>> >> > > Krzysztof Podejma schrieb:
>> >> > > > Hello,
>> >> > > > I need polish characters in pdf files, so I have to set FOP
>> >> default
>> >> font
>> >> > > to
>> >> > > > Arial.
>> >> > > > I've configured fop.xconf to use Arial and generated font
>> files.
>> >> > > > It works well when I change font-family for blocks in fo files
>> >> but I
>> >> > > don't
>> >> > > > want to modify all files.
>> >> > >
>> >> > > You can declare the font-family in the fo:root element which
>> >> means you
>> >> > > don't have to do it on every block, just once per document.
>> >> > >
>> >> > > > Do you happen to know how to do this?
>> >> > >
>> >> > > The default-value for the font-family property is 'sans-serif'
>> >> > > (Helvetica) which is hard coded in FOP.
>> >> > >
>> >> > > But if you work with FoDecorator/FoReportDecorator - which you
>> >> should
>> >> > > should do IMHO - you can declare it there and don't have to
worry
>> >> about
>> >> > > in every report.
>> >> > >
>> >> > > --
>> >> > > Christian
>> >> > >
>> >> > >
>> >> > >
>> >> >
>> >>
>> >
>>

Reply via email to