Community
Participate
Working Groups
SWT provides a loadFont-method in Display, but as far as I can see no code in Eclipse calls it. Platform should provide some extension point from which custom fonts could be added to be distributed with Eclipse based products. These fonts would then be available for use in editors, styling from CSS and so on.
As a proof of concept, I added a property to product definition which looks like this: <property name="fontList" value="SourceCodePro-Black.ttf,SourceCodePro-Bold.ttf,SourceCodePro-ExtraLight.ttf,SourceCodePro-Light.ttf,SourceCodePro-Medium.ttf,SourceCodePro-Regular.ttf,SourceCodePro-Semibold.ttf"/> And then I added this code to o.e.ui.internal.Workbench before the code that runs the legacy workbench: // add custom fonts before running workbench String fontList = Platform.getProduct().getProperty("fontList"); if(fontList != null) { String[] fonts = fontList.split(","); Bundle bundle = Platform.getProduct().getDefiningBundle(); if(bundle != null) { String location = bundle.getLocation().replace("reference:file:", ""); for(String font : fonts) { String file = Paths.get(location, font).toAbsolutePath().toString(); display.loadFont(file); } } } And this works for me on Windows 8. I figure the custom fonts need to be loaded pretty early in the startup process before the splash screen gets displayed so an extension point may not be suitable.