Skip to content
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: Roboto #614

Merged
merged 1 commit into from Nov 21, 2022
Merged

Fonts: Roboto #614

merged 1 commit into from Nov 21, 2022

Conversation

DevCharly
Copy link
Collaborator

This PR packages the Roboto font (https://fonts.google.com/specimen/Roboto) into a JAR (will be released to Maven Central later) and provides an easy way to use it with FlatLaf.

The font need to be installed before it can be used. E.g.

FlatRobotoFont.install();

To use Roboto as default font in your application, use:

FlatLaf.setPreferredFontFamily( FlatRobotoFont.FAMILY );
FlatLaf.setPreferredLightFontFamily( FlatRobotoFont.FAMILY_LIGHT );
FlatLaf.setPreferredSemiboldFontFamily( FlatRobotoFont.FAMILY_SEMIBOLD );

FlatLightLaf.setup();

//TODO create UI

You can of course also create fonts. E.g.:

// basic styles
new Font( FlatRobotoFont.FAMILY, Font.PLAIN, 12 );
new Font( FlatRobotoFont.FAMILY, Font.ITALIC, 12 );
new Font( FlatRobotoFont.FAMILY, Font.BOLD, 12 );
new Font( FlatRobotoFont.FAMILY, Font.BOLD | Font.ITALIC, 12 );

// light
new Font( FlatRobotoFont.FAMILY_LIGHT, Font.PLAIN, 12 );
new Font( FlatRobotoFont.FAMILY_LIGHT, Font.ITALIC, 12 );

// semibold
new Font( FlatRobotoFont.FAMILY_SEMIBOLD, Font.PLAIN, 12 );
new Font( FlatRobotoFont.FAMILY_SEMIBOLD, Font.ITALIC, 12 );

@DevCharly DevCharly added this to the 3.0 milestone Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant