Permalink
Browse files

GUI - use Hack font as default on all platforms

  • Loading branch information...
1 parent 7d5ada3 commit a5b5b3cdf1e1db74d940362194a8a321a21354f9 @samaaron committed Dec 14, 2016
View
@@ -29,6 +29,9 @@ THE SOFTWARE.
As the Sonic Pi GUI links with GPLv3-licensed software distributors of
Sonic Pi GUI binaries must comply with the terms of the GPL
+## Font
+The font used in the GUI is [Hack](http://sourcefoundry.org/hack/) released under the [Hack Open Font License v2.0](https://github.com/chrissimpkins/Hack/blob/master/LICENSE.md)
+
## Docs, Tutorial and Examples
(contents of [etc/doc/](https://github.com/samaaron/sonic-pi/tree/master/etc/doc) and [etc/examples](https://github.com/samaaron/sonic-pi/tree/master/etc/examples) directories)
@@ -73,6 +73,9 @@
<file>lang/sonic-pi_fr.qm</file>
<file>lang/sonic-pi_es.qm</file>
<file>lang/sonic-pi_hu.qm</file>
+
+ <file>fonts/Hack-Regular.ttf</file>
+ <file>fonts/Hack-Italic.ttf</file>
<!--
<file>lang/sonic-pi_zh-Hans.qm</file>
<file>lang/sonic-pi_zh-Hant.qm</file>
Binary file not shown.
@@ -0,0 +1,64 @@
+## License
+
+Hack Copyright 2015, Christopher Simpkins with Reserved Font Name "Hack".
+
+Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
+
+DejaVu modifications of the original Bitstream Vera Sans Mono typeface have been committed to the public domain.
+
+
+
+This Font Software is licensed under the Hack Open Font License v2.0 and the Bitstream Vera License.
+
+These licenses are copied below.
+
+
+### Hack Open Font License v2.0
+
+(Version 1.0 - 06 September 2015)
+
+(Version 2.0 - 27 September 2015)
+
+Copyright 2015 by Christopher Simpkins. All Rights Reserved.
+
+DEFINITIONS
+
+"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
+
+PERMISSION AND CONDITIONS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated source code, documentation, and binary files (the "Font Software"), to reproduce and distribute the modifications to the Bitstream Vera Font Software, including without limitation the rights to use, study, copy, merge, embed, modify, redistribute, and/or sell modified or unmodified copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
+
+(1) The above copyright notice and this permission notice shall be included in all modified and unmodified copies of the Font Software typefaces. These notices can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
+
+(2) The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "Hack".
+
+(3) Neither the Font Software nor any of its individual components, in original or modified versions, may be sold by itself.
+
+TERMINATION
+
+This license becomes null and void if any of the above conditions are not met.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Christopher Simpkins and the Author(s) of the Font Software shall not be used to promote, endorse or advertise any modified version, except to acknowledge the contribution(s) of Christopher Simpkins and the Author(s) or with their explicit written permission. For further information, contact: chris at sourcefoundry dot org.
+
+
+
+### BITSTREAM VERA LICENSE
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
+
+The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
Binary file not shown.
View
@@ -28,6 +28,10 @@ int main(int argc, char *argv[])
#endif
QApplication app(argc, argv);
+
+ QFontDatabase::addApplicationFont(":/fonts/Hack-Regular.ttf");
+ QFontDatabase::addApplicationFont(":/fonts/Hack-Italic.ttf");
+
qRegisterMetaType<SonicPiLog::MultiMessage>("SonicPiLog::MultiMessage");
QString systemLocale = QLocale::system().name();
@@ -543,18 +543,11 @@ void MainWindow::setupWindowStructure() {
outputPane->setReadOnly(true);
errorPane->setReadOnly(true);
outputPane->setLineWrapMode(QPlainTextEdit::NoWrap);
-#if defined(Q_OS_WIN)
- outputPane->setFontFamily("Courier New");
-#elif defined(Q_OS_MAC)
- outputPane->setFontFamily("Menlo");
-#else
- outputPane->setFontFamily("Bitstream Vera Sans Mono");
-#endif
+ outputPane->setFontFamily("Hack");
if(!theme->font("LogFace").isEmpty()){
outputPane->setFontFamily(theme->font("LogFace"));
}
-
outputPane->document()->setMaximumBlockCount(1000);
errorPane->document()->setMaximumBlockCount(1000);
@@ -2021,13 +2014,7 @@ void MainWindow::updateDarkMode(){
QString appStyling = readFile(qt_app_theme_path);
-#if defined(Q_OS_WIN)
- appStyling.replace("fixedWidthFont", "\"Courier New\"");
-#elif defined(Q_OS_MAC)
- appStyling.replace("fixedWidthFont", "\"Menlo\"");
-#else
- appStyling.replace("fixedWidthFont", "\"Bitstream Vera Sans Mono\"");
-#endif
+ appStyling.replace("fixedWidthFont", "\"Hack\"");
appStyling
.replace("windowColor", windowColor)
@@ -23,14 +23,7 @@ SonicPiLexer::SonicPiLexer(SonicPiTheme *theme) : QsciLexerRuby() {
this->setDefaultPaper(theme->color("Background"));
}
-#if defined(Q_OS_WIN)
-static char default_font[] = "Courier New";
-#elif defined(Q_OS_MAC)
-static char default_font[] = "Menlo";
-#else
-static char default_font[] = "Bitstream Vera Sans Mono";
-#endif
-
+static char default_font[] = "Hack";
// triggers autocompletion for the next word
QStringList SonicPiLexer::autoCompletionWordSeparators() const {
@@ -62,11 +62,11 @@ em {
pre {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
code {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Courier New","Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
color: deeppink;
}
@@ -122,7 +122,7 @@ h2 {
}
body.info {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
body.info a {
@@ -142,7 +142,7 @@ body.manual .introduced {
body.manual table.arguments td {
font-size: medium;
padding: 2px;
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
body.manual table.arguments td.odd,
@@ -162,7 +162,7 @@ body.manual table.details td {
}
body.manual table.details td.key {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
font-size: large;
}
@@ -57,11 +57,11 @@ em {
}
pre {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
code {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
color: deeppink;
}
@@ -116,7 +116,7 @@ h2 {
}
body.info {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
body.info a {
@@ -136,7 +136,7 @@ body.manual .introduced {
body.manual table.arguments td {
font-size: medium;
padding: 2px;
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
}
body.manual table.arguments td.odd,
@@ -156,7 +156,7 @@ body.manual table.details td {
}
body.manual table.details td.key {
- font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
+ font-family: "Hack", "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Liberation Mono", "DroidSansMono", "Lucida Console", Consolas, Terminal, Monaco, "Courier New", monospace;
font-size: large;
}

0 comments on commit a5b5b3c

Please sign in to comment.