Bug #4611
Implement a font enumeration Java API directly callable from legacy code
0%
Related issues
History
#1 Updated by Hynek Cihlar almost 4 years ago
The motivation here is to provide a way to allow to enumerate available font faces in legacy code. That is FWD/4GL code getting all available font faces (and their metadata).
Create a Java class as part of FWD that would provide methods for font family enumeration. The created class will be callable taking advantage of Direct_Java_Access. Font enumeration support will have to be added to the GUI drivers, which the created class will use.
Also see #3876-22 where this idea originated.
#2 Updated by Hynek Cihlar almost 4 years ago
- Related to Feature #3876: add support for "direct font control" at the widget level added
#3 Updated by Hynek Cihlar almost 4 years ago
For Swing GUI, the fonts can be enumerated with:
using java.awt.* from java. using java.lang.* from java.def var gEnv as GraphicsEnvironment. def var availableFonts as String extent. gEnv = GraphicsEnvironment:getLocalGraphicsEnvironment(). availableFonts = gEnv:getAvailableFontFamilyNames().
For Web GUI, this will be a different story. There doesn't seem to be a straightforward way to enumerate the supported fonts, browsers don't provide JavaScript API for this. The only solutions I found was either Adobe Flash, an ActiveX approach or a third party JavaScript library which works by probing a predefined list of fonts. Flash and ActiveX is obviously out of question.