[OpenJDK 2D-Dev] Accepts TrueType fonts with Apple Platform ID names
Johnson Lau
johnsonlaucn at gmail.com
Wed Jan 12 11:21:16 UTC 2011
Hi,
OpenJDK currently treats TrueType fonts with Apple Platform ID names
as invalid format because it only supports MS Platform ID(=3).
Any font without valid MS Platform ID names is unusable on OpenJDK.
Here is a patch for both OpenJDK 6 & 7 to solve the problem.
I reached the body size limit so I only attached JDK 7's patch here.
a. Platform specified encoding ID (charset) and LANG ID (locale)
detection for Apple Mac Platform (=1), Apple Unicode (or UTF-16, =0),
ISO (deprecated, =2) is added.
Fonts shipping with Mac like STHeiti can be loaded properly after
patching this.
b. Mainly a new class for mapping between Apple's LANG ID and Java
Locales is introduced.
Some Apple LANG IDs like Azerbaijan have script variants (Arabic,
Latin script) and don't seem to be mapped into valid Java Locale.
c. MS LCID Mappings are moved to a single class for better code
organization. (Existed in FontManager.java of JDK6 or
TrueTypeFont.java of JDK7)
Don't know if Apple's planing to port its implementation to OpenJDK.
This patch will help us solving the problem until they release their works.
I's hoping someone to decide whether to accept it or not.
Thanks
-Johnson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk7-apple-platform-ttf.patch
Type: text/x-patch
Size: 45188 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20110112/73ee2b3d/jdk7-apple-platform-ttf.patch>
More information about the 2d-dev
mailing list