-
Notifications
You must be signed in to change notification settings - Fork 235
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fonts management improvements #331
Comments
+1 Better to reduce static imports since it will be a nightmare to use them in Netbeans IDE |
An important thing to be done upon implementing new fonts manager is to remove all default ways of component font setup which are currently used within swing. For example this is how tooltip font is set: LookAndFeel.installColorsAndFont ( c, "ToolTip.background", "ToolTip.foreground", "ToolTip.font" ); Usually calls like this one can be found within Starting with v1.3.0 all those calls should be removed and It should be possible to specify a fully new font or a reference to global fonts defined in the skin. I don't have specifics on how exactly that would look like in the style XML, but here are some possible options: Global skin fonts: <skin>
<!-- Global fonts -->
<fonts>
<Font id="control" name="Tahoma" size="12" />
<Font id="alert" name="Segoe UI" style="bold" size="13" />
...
</fonts>
...
</skin> And fonts usage within specific style contents (taken from current menu item style): <ButtonText constraints="text" fontId="control" color="black" /> <AcceleratorText constraints="accelerator" padding="2,4,2,4" color="90,90,90">
<Font name="Tahoma" style="italic" size="10" />
</AcceleratorText> |
Some parts of this enhancemet might be implemented a part of #460 |
@vp131 mentioned issue on Gitter chat:
|
I've pushed some related changes in 5bd2b12 commit. Shortly - To disable native fonts usage simply add this line of code: NativeFonts.setUseNativeFonts ( false ); And WebLaF fonts will function the same way they did before this change. Currently native fonts are only supported for Windows and Mac OS X operating systems (and the latter still needs some testing on different versions). Unfortunately there is no good solution available for other Unix systems yet. |
Right now WebLaF uses some hardcoded fonts from
WebFonts
class and the only way to change them is to provide custom fonts intoWebLookAndFeel
class static variables before L&F initialization.Some planned improvements:
Add better system language/locale -aware default fonts
Add some kind of
FontsManager
to handle fonts convenientlyAllow changing fonts in runtime for different parts of application
The text was updated successfully, but these errors were encountered: