Re: Problem with creation of font cache on Windows 7 64 bit

2010-08-13 Thread Adrian Cumiskey
Hi Jonathan,

The font caching was written prior to the Windows 7 release so it was never
tested at the time.  There is currently no way of telling Fop where to put
its font cache but it shouldn't be too much effort to add this feature.
I'll look at adding support for this.

Adrian.

On 14 August 2010 05:38, Jonathan Levinson <
jonathan.levin...@intersystems.com> wrote:

>  On Windows XP, fop creates it font-cache in “C:\Documents and
> Settings\\.fop”.
>
>
>
> I’ve had a couple of reports that on Windows 7 64 bit, fop puts its font
> cache in c:\.fop, a directory to which the user may not have write
> permissions.
>
>
>
> Is this a known issue?
>
>
>
> Is there a way of telling fop where to put the font cache?
>
>
>
> Best Regards,
>
> Jonathan Levinson
>
>
>


Re: Problem with creation of font cache on Windows 7 64 bit

2010-08-14 Thread Adrian Cumiskey
Sorry Jonathan, I've just looked into the matter and realised that what I
told you was incorrect (partially at least).

If you take a look at
http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements
you'll
see that there is a "cache-file" option that you can provide to tell Fop
where you would like your font cache file to be created.  Unfortunately this
documentation does not reflect the current state of the system.  At some
stage during further development of the font caching mechanism, this setting
was lost as a configuration setting and instead Fop tries to always store
the font cache file in the user's home directory.

I will work this weekend on reinstating this feature and integrate it into
the current font caching system.

Cheers, Adrian.

On 14 August 2010 09:09, Adrian Cumiskey  wrote:

> Hi Jonathan,
>
> The font caching was written prior to the Windows 7 release so it was never
> tested at the time.  There is currently no way of telling Fop where to put
> its font cache but it shouldn't be too much effort to add this feature.
> I'll look at adding support for this.
>
> Adrian.
>
>
> On 14 August 2010 05:38, Jonathan Levinson <
> jonathan.levin...@intersystems.com> wrote:
>
>>  On Windows XP, fop creates it font-cache in “C:\Documents and
>> Settings\\.fop”.
>>
>>
>>
>> I’ve had a couple of reports that on Windows 7 64 bit, fop puts its font
>> cache in c:\.fop, a directory to which the user may not have write
>> permissions.
>>
>>
>>
>> Is this a known issue?
>>
>>
>>
>> Is there a way of telling fop where to put the font cache?
>>
>>
>>
>> Best Regards,
>>
>> Jonathan Levinson
>>
>>
>>
>
>


Re: Problem with creation of font cache on Windows 7 64 bit

2010-08-15 Thread Adrian Cumiskey
Hi Jonathan,

I have just committed a fix to the missing "cache-file" configuration option
(see
http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements)
to the Fop trunk code.  All the documentation regarding font caching should
now reflect the actual implementation.

I also added a convenience "-delete-cache" option to the Fop command line as
quite a few users have previously asked how to delete/clear this file (when
not knowing its location on the filesystem).

Hope this helps,

Adrian.

On 14 August 2010 20:38, Adrian Cumiskey  wrote:

> Sorry Jonathan, I've just looked into the matter and realised that what I
> told you was incorrect (partially at least).
>
> If you take a look at
> http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements 
> you'll
> see that there is a "cache-file" option that you can provide to tell Fop
> where you would like your font cache file to be created.  Unfortunately this
> documentation does not reflect the current state of the system.  At some
> stage during further development of the font caching mechanism, this setting
> was lost as a configuration setting and instead Fop tries to always store
> the font cache file in the user's home directory.
>
> I will work this weekend on reinstating this feature and integrate it into
> the current font caching system.
>
> Cheers, Adrian.
>
> On 14 August 2010 09:09, Adrian Cumiskey wrote:
>
>> Hi Jonathan,
>>
>> The font caching was written prior to the Windows 7 release so it was
>> never tested at the time.  There is currently no way of telling Fop where to
>> put its font cache but it shouldn't be too much effort to add this feature.
>> I'll look at adding support for this.
>>
>> Adrian.
>>
>>
>> On 14 August 2010 05:38, Jonathan Levinson <
>> jonathan.levin...@intersystems.com> wrote:
>>
>>>  On Windows XP, fop creates it font-cache in “C:\Documents and
>>> Settings\\.fop”.
>>>
>>>
>>>
>>> I’ve had a couple of reports that on Windows 7 64 bit, fop puts its font
>>> cache in c:\.fop, a directory to which the user may not have write
>>> permissions.
>>>
>>>
>>>
>>> Is this a known issue?
>>>
>>>
>>>
>>> Is there a way of telling fop where to put the font cache?
>>>
>>>
>>>
>>> Best Regards,
>>>
>>> Jonathan Levinson
>>>
>>>
>>>
>>
>>
>


RE: Problem with creation of font cache on Windows 7 64 bit

2010-08-15 Thread Jonathan Levinson
Thank you Adrian!

Also I've noticed you can redirect the font-cache with the Java system property 
-Duser.home, so one can direct it to a different place by editing the JAVAOPTS 
set in fop.bat.

Best Regards,
Jonathan Levinson

From: Adrian Cumiskey [mailto:adrian.cumis...@gmail.com]
Sent: Sunday, August 15, 2010 12:28 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Problem with creation of font cache on Windows 7 64 bit

Hi Jonathan,

I have just committed a fix to the missing "cache-file" configuration option 
(see http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements) 
to the Fop trunk code.  All the documentation regarding font caching should now 
reflect the actual implementation.

I also added a convenience "-delete-cache" option to the Fop command line as 
quite a few users have previously asked how to delete/clear this file (when not 
knowing its location on the filesystem).

Hope this helps,

Adrian.

On 14 August 2010 20:38, Adrian Cumiskey 
mailto:adrian.cumis...@gmail.com>> wrote:
Sorry Jonathan, I've just looked into the matter and realised that what I told 
you was incorrect (partially at least).

If you take a look at 
http://xmlgraphics.apache.org/fop/1.0/configuration.html#general-elements 
you'll see that there is a "cache-file" option that you can provide to tell Fop 
where you would like your font cache file to be created.  Unfortunately this 
documentation does not reflect the current state of the system.  At some stage 
during further development of the font caching mechanism, this setting was lost 
as a configuration setting and instead Fop tries to always store the font cache 
file in the user's home directory.

I will work this weekend on reinstating this feature and integrate it into the 
current font caching system.

Cheers, Adrian.

On 14 August 2010 09:09, Adrian Cumiskey 
mailto:adrian.cumis...@gmail.com>> wrote:
Hi Jonathan,

The font caching was written prior to the Windows 7 release so it was never 
tested at the time.  There is currently no way of telling Fop where to put its 
font cache but it shouldn't be too much effort to add this feature.  I'll look 
at adding support for this.

Adrian.

On 14 August 2010 05:38, Jonathan Levinson 
mailto:jonathan.levin...@intersystems.com>> 
wrote:
On Windows XP, fop creates it font-cache in "C:\Documents and 
Settings\\.fop".

I've had a couple of reports that on Windows 7 64 bit, fop puts its font cache 
in c:\.fop, a directory to which the user may not have write permissions.

Is this a known issue?

Is there a way of telling fop where to put the font cache?

Best Regards,
Jonathan Levinson






Re: RE: Problem with creation of font cache on Windows 7 64 bit

2010-08-15 Thread Adrian Cumiskey
Hi Jonathan,

Well spotted, yes that should work well also.  Although its a bit of a
sneaky "back door" way of achieving it : -).

Cheers, Adrian.

On 2010-08-16 1:23 AM, "Jonathan Levinson" <
jonathan.levin...@intersystems.com> wrote:

 Thank you Adrian!



Also I’ve noticed you can redirect the font-cache with the Java system
property –Duser.home, so one can direct it to a different place by editing
the JAVAOPTS set in fop.bat.



Best Regards,

Jonathan Levinson



*From:* Adrian Cumiskey [mailto:adrian.cumis...@gmail.com]
*Sent:* Sunday, August 15, 2010 12:28 PM
*To:* fop-users@xmlgraphics.apache.org
*Subject:* Re: Problem with creation of font cache on Windows 7 64 bit





Hi Jonathan,



I have just committed a fix to the missing "cache-file" configuration option
(...


RE: RE: Problem with creation of font cache on Windows 7 64 bit

2010-08-16 Thread Jonathan Levinson
Hi Adrian,

Thanks for your help!  I'm noticing behavior I did not expect after reading 
your code and reading https://issues.apache.org/bugzilla/show_bug.cgi?id=46686.

It looks like if "mkdir" fails, FOP will use the temp directory.   However 
testing this by pointing -Duser.home to a directory to which I do not have 
write permissions on Windows XP, I don't see any font cache created.  Instead, 
it seems like fonts are completely reloaded each time with the  
feature under  turned on.

Reading the code, I see the following, which leads me to expect the temporary 
directory would be used.

  /**
 * Returns the default font cache file.
 * @param forWriting true if the user directory should be created
 * @return the default font cache file
 */
public static File getDefaultCacheFile(boolean forWriting) {
File userHome = getUserHome();
if (userHome != null) {
File fopUserDir = new File(userHome, FOP_USER_DIR);
if (forWriting) {
boolean writable = fopUserDir.canWrite();
if (!fopUserDir.exists()) {
writable = fopUserDir.mkdir();
}
if (!writable) {
userHome = getTempDirectory();
fopUserDir = new File(userHome, FOP_USER_DIR);
fopUserDir.mkdir();
}
}
return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
}
return new File(FOP_USER_DIR);
}


Best Regards,
Jonathan Levinson

From: adrian.cumis...@gmail.com [mailto:adrian.cumis...@gmail.com] On Behalf Of 
Adrian Cumiskey
Sent: Sunday, August 15, 2010 10:43 PM
To: Jonathan Levinson
Cc: fop-users@xmlgraphics.apache.org; adr...@cumiskey.com
Subject: Re: RE: Problem with creation of font cache on Windows 7 64 bit


Hi Jonathan,

Well spotted, yes that should work well also.  Although its a bit of a sneaky 
"back door" way of achieving it : -).

Cheers, Adrian.
On 2010-08-16 1:23 AM, "Jonathan Levinson" 
mailto:jonathan.levin...@intersystems.com>> 
wrote:
Thank you Adrian!

Also I've noticed you can redirect the font-cache with the Java system property 
-Duser.home, so one can direct it to a different place by editing the JAVAOPTS 
set in fop.bat.

Best Regards,
Jonathan Levinson

From: Adrian Cumiskey 
[mailto:adrian.cumis...@gmail.com<mailto:adrian.cumis...@gmail.com>]
Sent: Sunday, August 15, 2010 12:28 PM
To: fop-users@xmlgraphics.apache.org<mailto:fop-users@xmlgraphics.apache.org>
Subject: Re: Problem with creation of font cache on Windows 7 64 bit




Hi Jonathan,



I have just committed a fix to the missing "cache-file" configuration option 
(...


RE: RE: Problem with creation of font cache on Windows 7 64 bit

2010-08-16 Thread Jonathan Levinson
Hi,

Turning on tracing the problem is that while the font cache is being written to 
the temporary directory:

 [TRACE] FontCache - Writing font cache to C:\Documents and 
Settings\levinson\Local Settings\Temp\.fop\fop-fonts.cache

The font cache is never read from the temporary directory.  It is always read 
from the place user.home points to.   For the code to be able to use the 
temporary directory, it would have to check to see if there is no .fop 
directory in directory given by System property user.home and if there is no 
.fop directory look under the temporary directory for .fop.  I don't know if 
this would be an acceptable change.

Best Regards,
Jonathan Levinson

From: Jonathan Levinson [mailto:jonathan.levin...@intersystems.com]
Sent: Monday, August 16, 2010 1:58 PM
To: Adrian Cumiskey
Cc: fop-users@xmlgraphics.apache.org
Subject: RE: RE: Problem with creation of font cache on Windows 7 64 bit

Hi Adrian,

Thanks for your help!  I'm noticing behavior I did not expect after reading 
your code and reading https://issues.apache.org/bugzilla/show_bug.cgi?id=46686.

It looks like if "mkdir" fails, FOP will use the temp directory.   However 
testing this by pointing -Duser.home to a directory to which I do not have 
write permissions on Windows XP, I don't see any font cache created.  Instead, 
it seems like fonts are completely reloaded each time with the  
feature under  turned on.

Reading the code, I see the following, which leads me to expect the temporary 
directory would be used.

  /**
 * Returns the default font cache file.
 * @param forWriting true if the user directory should be created
 * @return the default font cache file
 */
public static File getDefaultCacheFile(boolean forWriting) {
File userHome = getUserHome();
if (userHome != null) {
File fopUserDir = new File(userHome, FOP_USER_DIR);
if (forWriting) {
boolean writable = fopUserDir.canWrite();
if (!fopUserDir.exists()) {
writable = fopUserDir.mkdir();
}
if (!writable) {
userHome = getTempDirectory();
fopUserDir = new File(userHome, FOP_USER_DIR);
fopUserDir.mkdir();
}
}
return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
}
return new File(FOP_USER_DIR);
}


Best Regards,
Jonathan Levinson

From: adrian.cumis...@gmail.com [mailto:adrian.cumis...@gmail.com] On Behalf Of 
Adrian Cumiskey
Sent: Sunday, August 15, 2010 10:43 PM
To: Jonathan Levinson
Cc: fop-users@xmlgraphics.apache.org; adr...@cumiskey.com
Subject: Re: RE: Problem with creation of font cache on Windows 7 64 bit


Hi Jonathan,

Well spotted, yes that should work well also.  Although its a bit of a sneaky 
"back door" way of achieving it : -).

Cheers, Adrian.
On 2010-08-16 1:23 AM, "Jonathan Levinson" 
mailto:jonathan.levin...@intersystems.com>> 
wrote:
Thank you Adrian!

Also I've noticed you can redirect the font-cache with the Java system property 
-Duser.home, so one can direct it to a different place by editing the JAVAOPTS 
set in fop.bat.

Best Regards,
Jonathan Levinson

From: Adrian Cumiskey 
[mailto:adrian.cumis...@gmail.com<mailto:adrian.cumis...@gmail.com>]
Sent: Sunday, August 15, 2010 12:28 PM
To: fop-users@xmlgraphics.apache.org<mailto:fop-users@xmlgraphics.apache.org>
Subject: Re: Problem with creation of font cache on Windows 7 64 bit




Hi Jonathan,



I have just committed a fix to the missing "cache-file" configuration option 
(...