Here's what I want to do:
Display.getCurrent().loadFont("fonts/helveticaNeueBold_iOS7.ttf")
- Works in a tester (i.e. class with entry point).
- Doesn't work in an RCP app.
How do the loading mechanisms differ? Should I get the ttf
file, then extract the path to it?
Alexander's answer could also be helpful to some.
For me, the following snippet did the trick:
Although beware that
BundleUtility
has restricted access.Eclipse bundles have different paths (something like "bundleentry://bundle_number/path_to_your_file"). You might want to use
FileLocator
to load files properly. For example:Also, please check other methods, available within
FileLocator
.