Typography: added light and semibold font/style

This commit is contained in:
Karl Tauber
2021-10-25 13:27:40 +02:00
parent 7c594ba7a9
commit e6e4e53a73
8 changed files with 105 additions and 9 deletions

View File

@@ -45,6 +45,20 @@ mini.font = -3
# default font
#defaultFont = ...
# font weights
# Windows
[win]light.font = "Segoe UI Light"
[win]semibold.font = "Segoe UI Semibold"
# macOS
[mac]light.font = "HelveticaNeue-Light"
[mac]semibold.font = "HelveticaNeue-Medium"
# Linux
[linux]light.font = "Lato Light", "Ubuntu Light", "Cantarell Light"
[linux]semibold.font = "Lato Semibold", "Ubuntu Medium"
# fallback for unknown platform
light.font = +0
semibold.font = +0
# monospaced
[win]monospaced.font = Consolas, "Courier New", Monospaced
[mac]monospaced.font = Menlo, Monospaced
@@ -62,6 +76,8 @@ monospaced.font = Monospaced
[style].medium = font: $medium.font
[style].small = font: $small.font
[style].mini = font: $mini.font
[style].light = font: $light.font
[style].semibold = font: $semibold.font
[style].monospaced = font: $monospaced.font

View File

@@ -100,6 +100,12 @@
+ large.font [active] Helvetica Neue plain 15 javax.swing.plaf.FontUIResource [UI]
#---- light ----
- light.font [active] Segoe UI Light plain 12 javax.swing.plaf.FontUIResource [UI]
+ light.font [active] HelveticaNeue-Light plain 13 javax.swing.plaf.FontUIResource [UI]
#---- medium ----
- medium.font [active] Segoe UI plain 11 javax.swing.plaf.FontUIResource [UI]
@@ -118,6 +124,12 @@
+ monospaced.font [active] Menlo plain 13 javax.swing.plaf.FontUIResource [UI]
#---- semibold ----
- semibold.font [active] Segoe UI Semibold plain 12 javax.swing.plaf.FontUIResource [UI]
+ semibold.font [active] HelveticaNeue-Medium plain 13 javax.swing.plaf.FontUIResource [UI]
#---- small ----
- small.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]

View File

@@ -1390,9 +1390,11 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
[style].h3 font: $h3.font
[style].h4 font: $h4.font
[style].large font: $large.font
[style].light font: $light.font
[style].medium font: $medium.font
[style].mini font: $mini.font
[style].monospaced font: $monospaced.font
[style].semibold font: $semibold.font
[style].small font: $small.font
@@ -1467,6 +1469,11 @@ laf.scaleFactor [active] 1.0
large.font [active] Segoe UI plain 14 javax.swing.plaf.FontUIResource [UI]
#---- light ----
light.font [active] Segoe UI Light plain 12 javax.swing.plaf.FontUIResource [UI]
#---- medium ----
medium.font [active] Segoe UI plain 11 javax.swing.plaf.FontUIResource [UI]
@@ -1493,6 +1500,11 @@ monospaced.font [active] Consolas plain 12 javax.swing.plaf.Fo
scrollbar #3e4244 HSL 200 5 25 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%)
#---- semibold ----
semibold.font [active] Segoe UI Semibold plain 12 javax.swing.plaf.FontUIResource [UI]
#---- small ----
small.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]

View File

@@ -100,6 +100,12 @@
+ large.font [active] Helvetica Neue plain 15 javax.swing.plaf.FontUIResource [UI]
#---- light ----
- light.font [active] Segoe UI Light plain 12 javax.swing.plaf.FontUIResource [UI]
+ light.font [active] HelveticaNeue-Light plain 13 javax.swing.plaf.FontUIResource [UI]
#---- medium ----
- medium.font [active] Segoe UI plain 11 javax.swing.plaf.FontUIResource [UI]
@@ -118,6 +124,12 @@
+ monospaced.font [active] Menlo plain 13 javax.swing.plaf.FontUIResource [UI]
#---- semibold ----
- semibold.font [active] Segoe UI Semibold plain 12 javax.swing.plaf.FontUIResource [UI]
+ semibold.font [active] HelveticaNeue-Medium plain 13 javax.swing.plaf.FontUIResource [UI]
#---- small ----
- small.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]

View File

@@ -1395,9 +1395,11 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
[style].h3 font: $h3.font
[style].h4 font: $h4.font
[style].large font: $large.font
[style].light font: $light.font
[style].medium font: $medium.font
[style].mini font: $mini.font
[style].monospaced font: $monospaced.font
[style].semibold font: $semibold.font
[style].small font: $small.font
@@ -1472,6 +1474,11 @@ laf.scaleFactor [active] 1.0
large.font [active] Segoe UI plain 14 javax.swing.plaf.FontUIResource [UI]
#---- light ----
light.font [active] Segoe UI Light plain 12 javax.swing.plaf.FontUIResource [UI]
#---- medium ----
medium.font [active] Segoe UI plain 11 javax.swing.plaf.FontUIResource [UI]
@@ -1498,6 +1505,11 @@ monospaced.font [active] Consolas plain 12 javax.swing.plaf.Fo
scrollbar #f5f5f5 HSL 0 0 96 com.formdev.flatlaf.util.DerivedColor [UI] lighten(1%)
#---- semibold ----
semibold.font [active] Segoe UI Semibold plain 12 javax.swing.plaf.FontUIResource [UI]
#---- small ----
small.font [active] Segoe UI plain 10 javax.swing.plaf.FontUIResource [UI]

View File

@@ -53,6 +53,8 @@ public class FlatThemePreviewFonts
FlatThemePreviewFonts.FontPreview mediumPreview = new FlatThemePreviewFonts.FontPreview();
FlatThemePreviewFonts.FontPreview smallPreview = new FlatThemePreviewFonts.FontPreview();
FlatThemePreviewFonts.FontPreview miniPreview = new FlatThemePreviewFonts.FontPreview();
FlatThemePreviewFonts.FontPreview lightPreview = new FlatThemePreviewFonts.FontPreview();
FlatThemePreviewFonts.FontPreview semiboldPreview = new FlatThemePreviewFonts.FontPreview();
FlatThemePreviewFonts.FontPreview monospacedPreview = new FlatThemePreviewFonts.FontPreview();
JLabel scaleLabel = new JLabel();
scaleValueLabel = new JLabel();
@@ -76,6 +78,8 @@ public class FlatThemePreviewFonts
"[bottom]" +
"[bottom]" +
"[bottom]para" +
"[]" +
"[]para" +
"[]para" +
"[]"));
@@ -143,19 +147,29 @@ public class FlatThemePreviewFonts
miniPreview.setFontStyle("mini");
add(miniPreview, "cell 0 12,gapx 12");
//---- lightPreview ----
lightPreview.setFontType("Light");
lightPreview.setFontStyle("light");
add(lightPreview, "cell 0 13,gapx 12");
//---- semiboldPreview ----
semiboldPreview.setFontType("Semibold");
semiboldPreview.setFontStyle("semibold");
add(semiboldPreview, "cell 0 14,gapx 12");
//---- monospacedPreview ----
monospacedPreview.setFontType("Monospaced");
monospacedPreview.setFontStyle("monospaced");
add(monospacedPreview, "cell 0 13,gapx 12");
add(monospacedPreview, "cell 0 15,gapx 12");
//---- scaleLabel ----
scaleLabel.setText("Fonts are scaled by:");
add(scaleLabel, "cell 0 14,gapx 12");
add(scaleLabel, "cell 0 16,gapx 12");
//---- scaleValueLabel ----
scaleValueLabel.setText("1x");
scaleValueLabel.putClientProperty("FlatLaf.styleClass", "h2");
add(scaleValueLabel, "cell 0 14");
add(scaleValueLabel, "cell 0 16");
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
"$columnConstraints": "[left]unrel"
"$rowConstraints": "[][bottom][bottom][bottom][bottom][bottom][bottom]para[][bottom][bottom][bottom][bottom][bottom]para[]para[]"
"$rowConstraints": "[][bottom][bottom][bottom][bottom][bottom][bottom]para[][bottom][bottom][bottom][bottom][bottom]para[][]para[]para[]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
@@ -105,18 +105,32 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 12,gapx 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewFonts$FontPreview" ) {
name: "lightPreview"
"fontType": "Light"
"fontStyle": "light"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 13,gapx 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewFonts$FontPreview" ) {
name: "semiboldPreview"
"fontType": "Semibold"
"fontStyle": "semibold"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 14,gapx 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewFonts$FontPreview" ) {
name: "monospacedPreview"
"fontType": "Monospaced"
"fontStyle": "monospaced"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 13,gapx 12"
"value": "cell 0 15,gapx 12"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "scaleLabel"
"text": "Fonts are scaled by:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 14,gapx 12"
"value": "cell 0 16,gapx 12"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "scaleValueLabel"
@@ -126,11 +140,11 @@ new FormModel {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 14"
"value": "cell 0 16"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 5, 0 )
"size": new java.awt.Dimension( 335, 405 )
"size": new java.awt.Dimension( 335, 495 )
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 0,hidemode 3"
@@ -162,7 +176,7 @@ new FormModel {
"value": "cell 1 0"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 5, 435 )
"location": new java.awt.Point( 5, 545 )
"size": new java.awt.Dimension( 235, 65 )
} )
}

View File

@@ -1071,9 +1071,11 @@ ViewportUI
[style].h3
[style].h4
[style].large
[style].light
[style].medium
[style].mini
[style].monospaced
[style].semibold
[style].small
activeCaption
activeCaptionBorder
@@ -1102,12 +1104,14 @@ infoText
laf.dark
laf.scaleFactor
large.font
light.font
medium.font
menu
menuText
mini.font
monospaced.font
scrollbar
semibold.font
small.font
swingx/TaskPaneUI
text