Skip to content

Commit

Permalink
update to new Source Sans, adds cmd key and more char support
Browse files Browse the repository at this point in the history
  • Loading branch information
benfry committed Jul 24, 2022
1 parent ec613fd commit 4e30a4b
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 101 deletions.
2 changes: 1 addition & 1 deletion app/src/processing/app/laf/FlatLaf.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO sort out how to import this via the language properties
# (probably needs to be set programmatically instead)
defaultFont = 14 "Processing Sans Pro", "Open Sans", "Noto Sans", Roboto, Arial
defaultFont = 14 "Processing Sans", "Open Sans", "Noto Sans", Roboto, Arial


# The default is 8, which creates tiny nubby scroll bars
Expand Down
36 changes: 34 additions & 2 deletions app/src/processing/app/ui/Toolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,8 @@ static public String getMonoFontName() {
static public Font getMonoFont(int size, int style) {
if (monoFont == null) {
try {
// monoFont = createFont("SourceCodePro-Regular.ttf", Font.PLAIN, size);
// monoBoldFont = createFont("SourceCodePro-Bold.ttf", Font.BOLD, size);
monoFont = createFont("SourceCodePro-Regular.ttf", size);
monoBoldFont = createFont("SourceCodePro-Bold.ttf", size);

Expand Down Expand Up @@ -1262,8 +1264,33 @@ static public Font getBoldFont() {
static public Font getSansFont(int size, int style) {
if (sansFont == null) {
try {
sansFont = createFont("ProcessingSansPro-Regular.ttf", size);
sansBoldFont = createFont("ProcessingSansPro-Semibold.ttf", size);
sansFont = createFont("ProcessingSans-Regular.ttf", size);
sansBoldFont = createFont("ProcessingSans-Bold.ttf", size);

/*
// during beta 9, a bit of testing to make sure the right font is used
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fonts = ge.getAllFonts();
// even though these both come through as 'plain' the styles work
for (Font font : fonts) {
if (font.getName().contains("Processing")) {
System.out.println(font);
}
}
// there are no bold fonts
for (Font font : fonts) {
if (font.getStyle() == Font.BOLD) {
System.out.println("found bold: " + font);
}
}
// these pass, with the current code; even without doing
// deriveFont(Font.BOLD) before the registerFont() call.
Font f = new Font("Processing Sans", Font.BOLD, 12);
System.out.println("hopefully ProcessingSans-Bold: " + f.getPSName());
f = new Font("Processing Sans", Font.PLAIN, 12);
System.out.println("hopefully ProcessingSans-Regular: " + f.getPSName());
*/

// https://github.com/processing/processing/issues/2886
// https://github.com/processing/processing/issues/4944
Expand Down Expand Up @@ -1325,6 +1352,11 @@ static private Font createFont(String filename, int size) throws IOException, Fo
Font font = Font.createFont(Font.TRUETYPE_FONT, input);
input.close();

// make sure it's the correct weight (plain or bold) and specify a size
// System.out.println("about to derive " + font);
// font = font.deriveFont(style, size);
// System.out.println("derived to " + font);

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);

Expand Down
Binary file added build/shared/lib/fonts/ProcessingSans-Bold.ttf
Binary file not shown.
8 changes: 8 additions & 0 deletions build/shared/lib/fonts/ProcessingSans-LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is [Source Sans](https://github.com/adobe-fonts/source-sans) from Adobe, but renamed to
prevent conflicts on Windows with other versions of Source Sans. See [issue 4747](https://github.com/processing/processing/issues/4747) in the old Processing repository for details.

The license for this font can be found [here](https://github.com/adobe-fonts/source-sans/blob/release/LICENSE.md).

We're using [version 3.046 from 14 July 2021](https://github.com/adobe-fonts/source-sans/releases/tag/3.046R).

After downloading the TTF, it was opened with [FontForge](https://fontforge.org/). The font and family names were changed using Element → Font Info, followed by File → Generate to create the new `.ttf` files.
Binary file not shown.
98 changes: 0 additions & 98 deletions build/shared/lib/fonts/ProcessingSansPro-LICENSE.txt

This file was deleted.

Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ X remove editor.laf preference because it conflicts with FlatLaf
X menu crustiness, console background color not getting set, others?
X need to check on an actual Linux device, not a VM
X this was caused by Nimbus interactions with FlatLaf
X command key symbol missing in pop up menus

design/selector
X updated 4x4 for themes, foundation svg icon tweaks
Expand Down Expand Up @@ -195,6 +196,10 @@ X https://github.com/processing/processing4/pull/483


fixes/changes before beta 9
_ update available icon looks broken (bad winding rule?)
_ fix column widths in 'updates' tab of contrib manager
_ also make them resizable
_ section headings look bad (not capitalized, not plural, no bg color change)
_ visual fixes for tab sizes, etc (with Paul)
_ weirdness with gaps in tabs (editor too big, manager too small)
_ contrib mgr: filter/dropdown vertical centering is too high
Expand Down

0 comments on commit 4e30a4b

Please sign in to comment.