Display#loadFont on gtk-linux [message #758550] |
Wed, 23 November 2011 16:10 |
andzsinszan Messages: 32 Registered: August 2011 |
Member |
|
|
Hi,
I'm using swt-3.7.1-gtk-linux-x86.jar on Ubuntu 11.04.
In my app I need to use phonetic characters (Doulos SIL, TTF), which had worked fine with Swing. My strategy with SWT was to
- pack the .ttf font file into the App's jar
- get TTF from jar as stream
- write it into a temporary file (in user's home)
- load font locally with Display#loadFont
This last step doesn't work.
#1 The loaded file is not in the Display#getFontList.
The code below prints the lists' sizes -- which are identical.
#2 Display#loadFont returns true for any (nonsense) strings.
// The temporary font file is "/home/me/DoulosSILR.ttf".
FontData[] fd1 = display.getFontList(null, true/*scalable*/);
System.out.println(fd1.length);
if(display.loadFont(fontFile.getAbsolutePath())){
FontData[] fd2 = display.getFontList(null, true/*scalable*/);
System.out.println(fd2.length);
}
I tried to debug the process. I got till the native method:
public static final native boolean _FcConfigAppFontAddFile(int /*long*/ config, byte[] file);
This method is preceded by a call to
ClassLoader#FindNative
with runtime argument:
Java_org_eclipse_swt_internal_gtk_OS__1FcConfigAppFontAddFile
Any ideas?
[Updated on: Wed, 23 November 2011 16:13] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06587 seconds