Skip to content

Commit

Permalink
additional edits to clean up #3025
Browse files Browse the repository at this point in the history
  • Loading branch information
benfry committed Apr 1, 2015
1 parent 88b9e12 commit 742884e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 104 deletions.
7 changes: 5 additions & 2 deletions app/src/processing/app/Language.java
Expand Up @@ -131,7 +131,7 @@ static private String loadLanguage() {
if (prefFile.exists()) {
String language = PApplet.loadStrings(prefFile)[0];
language = language.trim().toLowerCase();
if (!language.equals("")) {
if (language.trim().length() != 0) {
return language;
}
}
Expand Down Expand Up @@ -207,7 +207,10 @@ static public Map<String, String> getLanguages() {
}


/** Get current language */
/**
* Get the current language.
* @return two digit ISO code (lowercase)
*/
static public String getLanguage() {
return init().language;
}
Expand Down
25 changes: 16 additions & 9 deletions app/src/processing/app/Toolkit.java
Expand Up @@ -722,10 +722,14 @@ static public Font getMonoFont(int size, int style) {
monoFont = createFont("SourceCodePro-Regular.ttf", size);
//monoBoldFont = createFont("SourceCodePro-Semibold.ttf", size);
monoBoldFont = createFont("SourceCodePro-Bold.ttf", size);
if (!monoFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
!monoFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
monoFont = createFont("Anonymous Pro.ttf", size);
monoBoldFont = createFont("Anonymous Pro B.ttf", size);

// additional language constraints
if ("el".equals(Language.getLanguage())) {
if (!monoFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
!monoFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
monoFont = createFont("AnonymousPro-Regular.ttf", size);
monoBoldFont = createFont("AnonymousPro-Bold.ttf", size);
}
}
} catch (Exception e) {
Base.loge("Could not load mono font", e);
Expand Down Expand Up @@ -754,12 +758,15 @@ static public Font getSansFont(int size, int style) {
try {
sansFont = createFont("SourceSansPro-Regular.ttf", size);
sansBoldFont = createFont("SourceSansPro-Semibold.ttf", size);
if (!sansFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
!sansFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
sansFont = createFont("Carlito-Regular.ttf", size);
sansBoldFont = createFont("Carlito-Bold.ttf", size);

// additional language constraints
if ("el".equals(Language.getLanguage())) {
if (!sansFont.canDisplay(GREEK_SMALL_LETTER_ALPHA) ||
!sansFont.canDisplay(GREEK_CAPITAL_LETTER_OMEGA)) {
sansFont = createFont("Carlito-Regular.ttf", size);
sansBoldFont = createFont("Carlito-Bold.ttf", size);
}
}

} catch (Exception e) {
Base.loge("Could not load sans font", e);
sansFont = new Font("SansSerif", Font.PLAIN, size);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
93 changes: 0 additions & 93 deletions build/shared/lib/fonts/LICENSE.txt

This file was deleted.

3 changes: 3 additions & 0 deletions todo.txt
Expand Up @@ -16,6 +16,9 @@ _ don't return here, allow contrib types to fail:
_ https://github.com/processing/processing/blob/master/app/src/processing/app/contrib/ContributionListing.java#L509
_ trying to add a second tab with the same name causes an error

_ Opening and closing preferences window prompts user to save unmodified sketch
_ https://github.com/processing/processing/issues/3074

_ implement line numbers in the editor
_ 5px between line number (right-aligned) and the right edge of the gutter
_ ie textAlign(RIGHT) / text(lineNum, LEFT_GUTTER - 5, y)
Expand Down

0 comments on commit 742884e

Please sign in to comment.