You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Varadharajan Sethuraman <va...@yahoo.com> on 2004/07/28 05:57:36 UTC

Absolute path of font file ...

Hi,
 
I am using Fop_0.20.5. And i have some issue with supporting fonts ...
 
userconfig.xml
<fonts>
 <font metrics-file="C:\Fop_0.20.5\fonts\arial.xml" kerning="yes" embed-file="c:\windows\fonts\arial.ttf">
    <font-triplet name="Arial" style="normal" weight="normal"/>
 </font>

</fonts>

my problem is that I don't want to specify the absolute path for the font-metrics or embed-file attribute (C:\Fop_0.20.5\fonts\ or C:\windows\fonts\) in the userconfig.xml to support the fonts. Because it will cause the portablity problem.
 
Anybody knows the solution for this issue kindly mail me ...
 
or is there any way to set or pass the value for font-metrics or embed-file attribute dynamically .
 
 
-Varadha

		
---------------------------------
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!

Re: Absolute path of font file ...

Posted by Clay Leeds <cl...@medata.com>.
On Jul 30, 2004, at 7:53 AM, Chris Bowditch wrote:
> Varadharajan Sethuraman wrote:
>> Thank you very much ...
>>  is It possible to refer metrics-file attribute for one directory, 
>> and embed-file attribute for another directory?
>>  for example  ...
>> I have metrics xml file in c:\my\metrics-base\dir\fontmetrics1.xml 
>> and ttf file in c:\my\embed-base\dir\arial.ttf
>
> Yes this is possible. Suppose the fontBaseDir is 
> c:\my\metrics-base\dir then font entry in userconfig.xml would be:
>
> <font metrics-file="fontmetrics1.xml" kerning="yes" 
> embed-file="..\embed-base\dir\arial.ttf">
>     <font-triplet name="Arial" style="normal" weight="normal"/>
> </font>
>
> So every path to do with fonts is resolved *relative* to the 
> fontBaseDir setting.
>
> <snip/>
>
> Chris

 From the 'more than 1-way-to-accomplish-your-task" dept., ... you could 
also set the fontBaseDir higher (i.e., to c:\my) and then use relative 
paths like this:

<font metrics-file="fontmetrics1.xml" kerning="yes" 
embed-file="embed-base\dir\arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
</font>

Web Maestro Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Absolute path of font file ...

Posted by Chris Bowditch <bo...@hotmail.com>.
Varadharajan Sethuraman wrote:

> Thank you very much ...
>  
> is It possible to refer metrics-file attribute for one directory, and 
> embed-file attribute for another directory?
>  
> for example  ...
> I have metrics xml file in c:\my\metrics-base\dir\fontmetrics1.xml and 
> ttf file in c:\my\embed-base\dir\arial.ttf

Yes this is possible. Suppose the fontBaseDir is c:\my\metrics-base\dir then 
font entry in userconfig.xml would be:

<font metrics-file="fontmetrics1.xml" kerning="yes" 
embed-file="..\embed-base\dir\arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
</font>

So every path to do with fonts is resolved *relative* to the fontBaseDir setting.

<snip/>

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Absolute path of font file ...

Posted by Varadharajan Sethuraman <va...@yahoo.com>.
Thank you very much ...
 
is It possible to refer metrics-file attribute for one directory, and embed-file attribute for another directory?
 
for example  ...
I have metrics xml file in c:\my\metrics-base\dir\fontmetrics1.xml and ttf file in c:\my\embed-base\dir\arial.ttf 

org.apache.fop.configuration.Configuration.put("baseDir","C:/my/metrics-base/dir");
org.apache.fop.configuration.Configuration.put("fontBaseDir","C:/my/embed-base/dir");

<font metrics-file="fontmetrics1.xml" kerning="yes" 
embed-file="arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
  </font>

 
--- Varadha
 
 
Chris Bowditch <bo...@hotmail.com> wrote:

Just specify relative paths in the font metrics or embed file attributes in 
the userconfig.xml file and the relative paths will be resolved against the 
base directory. So for example, if you want to reference a metrics file at 
c:\my\base\dir\fontmetrics1.xml and ttf file c:\my\base\dir\arial.ttf then specify

org.apache.fop.configuration.Configuration.put("fontBaseDir","/my/base/dir");

and in the userconfig.xml


<font metrics-file="fontmetrics1.xml" kerning="yes" 
embed-file="arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
  </font>


Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org



		
---------------------------------
Do you Yahoo!?
Yahoo! Mail - Now with 25x more storage than before!

Re: Absolute path of font file ...

Posted by Chris Bowditch <bo...@hotmail.com>.
Varadharajan Sethuraman wrote:

<snip/>

> org.apache.fop.configuration.Configuration.put("baseDir","/my/base/dir");
> Here is another that sets baseDir in a Windows environment:
> org.apache.fop.configuration.Configuration.put("baseDir","C:\my\base\dir");
>  
> How do I use that values for /font-metrics or embed-file attribute /in 
> the userconfig.xml?

Just specify relative paths in the font metrics or embed file attributes in 
the userconfig.xml file and the relative paths will be resolved against the 
base directory. So for example, if you want to reference a metrics file at 
c:\my\base\dir\fontmetrics1.xml and ttf file c:\my\base\dir\arial.ttf then specify

org.apache.fop.configuration.Configuration.put("fontBaseDir","/my/base/dir");

and in the userconfig.xml

  <font metrics-file="fontmetrics1.xml" kerning="yes" embed-file="arial.ttf">
     <font-triplet name="Arial" style="normal" weight="normal"/>
  </font>

<snip/>

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Absolute path of font file ...

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Varadharajan Sethuraman wrote:
> we can set the *baseDir and fontBaseDir* using 
> org.apache.fop.configuration.Configuration.

Unless I'm greatly mistaken, you can set fontBaseDir, baseDir
and baseURL in the userconfig.xml file too.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Absolute path of font file ...

Posted by Varadharajan Sethuraman <va...@yahoo.com>.
Hi,
 
As per the http://xml.apache.org/fop/configuration.html and http://xml.apache.org/fop/embedding.html document, 
 
we can set the baseDir and fontBaseDir using org.apache.fop.configuration.Configuration.

Here is an example that sets the "baseDir" configuration in a Unix environment: 
org.apache.fop.configuration.Configuration.put("baseDir","/my/base/dir");
Here is another that sets baseDir in a Windows environment: 
org.apache.fop.configuration.Configuration.put("baseDir","C:\my\base\dir");
 
How do I use that values for font-metrics or embed-file attribute in the userconfig.xml?
 
 
Clay Leeds <cl...@medata.com> wrote:
On Jul 27, 2004, at 8:57 PM, Varadharajan Sethuraman wrote:
> my problem is that I don't want to specify the absolute path for the 
> font-metrics or embed-file attribute (C:\Fop_0.20.5\fonts\ or 
> C:\windows\fonts\) in the userconfig.xml to support the fonts. Because 
> it will cause the portablity problem.
>
> Anybody knows the solution for this issue kindly mail me ...
>
> or is there any way to set or pass the value for font-metrics or 
> embed-file attribute dynamically .
>
> -Varadha

According to the FOP Fonts Page[1]:

* Starting with FOP version 0.20.5 you can use URLs for the paths to 
the font files. Relative URLs are resolved relative to the fontBaseDir 
property (or baseDir) if available. See FOP: Configuration[2] for more 
information.

[1]
http://xml.apache.org/fop/fonts.html

[2]
http://xml.apache.org/fop/configuration.html

In addition, if you must port this to another system, you should be 
able to modify the fontBaseDir only once. Does this solve your dilemma?

Web Maestro Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Re: Absolute path of font file ...

Posted by Clay Leeds <cl...@medata.com>.
On Jul 27, 2004, at 8:57 PM, Varadharajan Sethuraman wrote:
> my problem is that I don't want to specify the absolute path for the 
> font-metrics or embed-file attribute (C:\Fop_0.20.5\fonts\ or 
> C:\windows\fonts\) in the userconfig.xml to support the fonts. Because 
> it will cause the portablity problem.
>
> Anybody knows the solution for this issue kindly mail me ...
>
> or is there any way to set or pass the value for font-metrics or 
> embed-file attribute dynamically .
>
> -Varadha

According to the FOP Fonts Page[1]:

* Starting with FOP version 0.20.5 you can use URLs for the paths to 
the font files. Relative URLs are resolved relative to the fontBaseDir 
property (or baseDir) if available. See FOP: Configuration[2] for more 
information.

[1]
http://xml.apache.org/fop/fonts.html

[2]
http://xml.apache.org/fop/configuration.html

In addition, if you must port this to another system, you should be 
able to modify the fontBaseDir only once. Does this solve your dilemma?

Web Maestro Clay


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org