| Summary: | inconsistent Display#getFontList with Display#loadFont | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | andzsinszan |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill |
| Version: | 3.7.1 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
The download link in your snippet is dead, also Ubuntu 11.04 is quite old and no longer supported. Please reopen this ticket with a working font link if the issue is reproducible on a supported target environment. |
(1) Display#getFontList doesn't show changes after Display#loadFont successfully loads fonts. (2) Display#loadFont always returns true. Even for non-existing files. Ubuntu 11.04. swt-3.7.1-gtk-linux-x86.jar [code] import java.io.File; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Display; public class FontBug { public static void main(String[] args) { Display display = new Display(); // TTF Font from : http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=DoulosSIL_download File fontFile = new File("/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); } System.out.println(display.loadFont("this will return true too")); } } [/code] The problem may be around: 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