Skip to content

Commit 742884e

Browse files
committed
additional edits to clean up #3025
1 parent 88b9e12 commit 742884e

8 files changed

Lines changed: 24 additions & 104 deletions

File tree

app/src/processing/app/Language.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static private String loadLanguage() {
131131
if (prefFile.exists()) {
132132
String language = PApplet.loadStrings(prefFile)[0];
133133
language = language.trim().toLowerCase();
134-
if (!language.equals("")) {
134+
if (language.trim().length() != 0) {
135135
return language;
136136
}
137137
}
@@ -207,7 +207,10 @@ static public Map<String, String> getLanguages() {
207207
}
208208

209209

210-
/** Get current language */
210+
/**
211+
* Get the current language.
212+
* @return two digit ISO code (lowercase)
213+
*/
211214
static public String getLanguage() {
212215
return init().language;
213216
}

app/src/processing/app/Toolkit.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,14 @@ static public Font getMonoFont(int size, int style) {
722722
monoFont = createFont("SourceCodePro-Regular.ttf", size);
723723
//monoBoldFont = createFont("SourceCodePro-Semibold.ttf", size);
724724
monoBoldFont = createFont("SourceCodePro-Bold.ttf", size);
725-
if (!monoFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
726-
!monoFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
727-
monoFont = createFont("Anonymous Pro.ttf", size);
728-
monoBoldFont = createFont("Anonymous Pro B.ttf", size);
725+
726+
// additional language constraints
727+
if ("el".equals(Language.getLanguage())) {
728+
if (!monoFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
729+
!monoFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
730+
monoFont = createFont("AnonymousPro-Regular.ttf", size);
731+
monoBoldFont = createFont("AnonymousPro-Bold.ttf", size);
732+
}
729733
}
730734
} catch (Exception e) {
731735
Base.loge("Could not load mono font", e);
@@ -754,12 +758,15 @@ static public Font getSansFont(int size, int style) {
754758
try {
755759
sansFont = createFont("SourceSansPro-Regular.ttf", size);
756760
sansBoldFont = createFont("SourceSansPro-Semibold.ttf", size);
757-
if (!sansFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
758-
!sansFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
759-
sansFont = createFont("Carlito-Regular.ttf", size);
760-
sansBoldFont = createFont("Carlito-Bold.ttf", size);
761+
762+
// additional language constraints
763+
if ("el".equals(Language.getLanguage())) {
764+
if (!sansFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
765+
!sansFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
766+
sansFont = createFont("Carlito-Regular.ttf", size);
767+
sansBoldFont = createFont("Carlito-Bold.ttf", size);
768+
}
761769
}
762-
763770
} catch (Exception e) {
764771
Base.loge("Could not load sans font", e);
765772
sansFont = new Font("SansSerif", Font.PLAIN, size);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

build/shared/lib/fonts/LICENSE.txt

Lines changed: 0 additions & 93 deletions
This file was deleted.

todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ _ don't return here, allow contrib types to fail:
1616
_ https://github.com/processing/processing/blob/master/app/src/processing/app/contrib/ContributionListing.java#L509
1717
_ trying to add a second tab with the same name causes an error
1818

19+
_ Opening and closing preferences window prompts user to save unmodified sketch
20+
_ https://github.com/processing/processing/issues/3074
21+
1922
_ implement line numbers in the editor
2023
_ 5px between line number (right-aligned) and the right edge of the gutter
2124
_ ie textAlign(RIGHT) / text(lineNum, LEFT_GUTTER - 5, y)

0 commit comments

Comments
 (0)