DO NOT REPLY [Bug 46686] New: FontCache.getDefaultCacheFile() method returns a non-existant file handle

2009-02-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46686

   Summary: FontCache.getDefaultCacheFile() method returns a non-
existant file handle
   Product: Fop
   Version: all
  Platform: PC
OS/Version: Linux
Status: NEW
  Keywords: PatchAvailable
  Severity: normal
  Priority: P2
 Component: fonts
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: a...@jivesoftware.com
CC: a...@jivesoftware.com


Created an attachment (id=23243)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23243)
Patch to FontCache to use a fallback if the user directory is not writable

Method getDefaultCacheFile() returns an invalid file handle because it doesn't
check to see if the directory is writable.
{code}

private static File getUserHome() {
String s = System.getProperty("user.home");
if (s != null) {
File userDir = new File(s);
if (userDir.exists()) {
return userDir;
}
}
return null;
}


/**
 * 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) {
fopUserDir.mkdir();
}
return new File(fopUserDir, DEFAULT_CACHE_FILENAME);
}
return new File(FOP_USER_DIR);

}
{code}
The method getUserHome() can return a directory that is not a writable
directory. In most cases, the user who is running the webserver has access to
user.home, but some in some environments, it is possible that user.home is not
writable. Anyway, a simple way to fix it would be to fall back to a the
java.io.tmpdir if the userHome is not writable. See attached patch that has
that fix


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 45342] [PATCH] AFP Renderer does not properly handle AFP fonts with relative metric

2009-02-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45342


Jeremias Maerki  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Comment #2 from Jeremias Maerki   2009-02-09 07:37:03 
PST ---
Emil, thanks a lot for your patch. Apologies for not processing it earlier.
I've only noticed it recently. I've applied it with modifications:
http://svn.apache.org/viewvc?rev=742564&view=rev

The values your patch produced were too big by factors of more than 1000. I've
had to change some of that code. I've tested now with various fonts (with fixed
and relative metrics) and I'm happy with the results. Please verify also on
your side. Maybe you have different fonts that behave differently. If that is
so, we may have to take a closer look. Let me know if there are any remaining
problems.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 45342] [PATCH] AFP Renderer does not properly handle AFP fonts with relative metric

2009-02-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45342


Jeremias Maerki  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Keywords||PatchAvailable
Summary|AFP Renderer does not   |[PATCH] AFP Renderer does
   |properly handle AFP fonts   |not properly handle AFP
   |with relative metric|fonts with relative metric




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.