summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 15:08:58 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-10-11 15:08:58 +0300
commit52cb8a8d24408e21101dfe9465cf28eaaf287c13 (patch)
treee4478056836ec4b90163949f91150d58f863a2a6
parent883bb6aa9931eca1a2f22e691ed49f2ef9ccb8cb (diff)
Added two serif fonts; minor color tweaks
Added the EB Garamond and Literata fonts as serif font choices.
-rw-r--r--CMakeLists.txt8
-rw-r--r--Embed.cmake1
-rw-r--r--res/about/license.gmi2
-rw-r--r--res/fonts/EBGaramond-Bold.ttfbin0 -> 601316 bytes
-rw-r--r--res/fonts/EBGaramond-Italic.ttfbin0 -> 564280 bytes
-rw-r--r--res/fonts/EBGaramond-Medium.ttfbin0 -> 601412 bytes
-rw-r--r--res/fonts/EBGaramond-Regular.ttfbin0 -> 599076 bytes
-rw-r--r--res/fonts/LICENSE_EBGaramond.txt93
-rw-r--r--res/fonts/LICENSE_Literata.txt93
-rw-r--r--res/fonts/Literata-Bold-opsz=36.ttfbin0 -> 241016 bytes
-rw-r--r--res/fonts/Literata-ExtraLight-opsz=18.ttfbin0 -> 240008 bytes
-rw-r--r--res/fonts/Literata-LightItalic-opsz=14.ttfbin0 -> 231988 bytes
-rw-r--r--res/fonts/Literata-Regular-opsz=14.ttfbin0 -> 240196 bytes
-rw-r--r--src/gmdocument.c6
-rw-r--r--src/ui/color.c2
-rw-r--r--src/ui/text.c14
-rw-r--r--src/ui/text.h2
-rw-r--r--src/ui/util.c2
18 files changed, 218 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59701fad..4d0e087b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,12 +56,20 @@ set (EMBED_RESOURCES
56 res/about/lagrange.gmi 56 res/about/lagrange.gmi
57 res/about/license.gmi 57 res/about/license.gmi
58 res/about/version.gmi 58 res/about/version.gmi
59 res/fonts/EBGaramond-Regular.ttf
60 res/fonts/EBGaramond-Medium.ttf
61 res/fonts/EBGaramond-Italic.ttf
62 res/fonts/EBGaramond-Bold.ttf
59 res/fonts/FiraMono-Regular.ttf 63 res/fonts/FiraMono-Regular.ttf
60 res/fonts/FiraSans-Bold.ttf 64 res/fonts/FiraSans-Bold.ttf
61 res/fonts/FiraSans-Italic.ttf 65 res/fonts/FiraSans-Italic.ttf
62 res/fonts/FiraSans-Light.ttf 66 res/fonts/FiraSans-Light.ttf
63 res/fonts/FiraSans-Regular.ttf 67 res/fonts/FiraSans-Regular.ttf
64 res/fonts/KosugiMaru-Regular.ttf 68 res/fonts/KosugiMaru-Regular.ttf
69 res/fonts/Literata-Regular-opsz=14.ttf
70 res/fonts/Literata-Bold-opsz=36.ttf
71 res/fonts/Literata-ExtraLight-opsz=18.ttf
72 res/fonts/Literata-LightItalic-opsz=14.ttf
65 res/fonts/NotoEmoji-Regular.ttf 73 res/fonts/NotoEmoji-Regular.ttf
66 res/fonts/Nunito-ExtraBold.ttf 74 res/fonts/Nunito-ExtraBold.ttf
67 res/fonts/Nunito-ExtraLight.ttf 75 res/fonts/Nunito-ExtraLight.ttf
diff --git a/Embed.cmake b/Embed.cmake
index 2322e32c..75f3e06f 100644
--- a/Embed.cmake
+++ b/Embed.cmake
@@ -9,6 +9,7 @@ option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)
9function (embed_getname output fn) 9function (embed_getname output fn)
10 get_filename_component (name ${fn} NAME_WE) 10 get_filename_component (name ${fn} NAME_WE)
11 string (REPLACE "-" "" name ${name}) 11 string (REPLACE "-" "" name ${name})
12 string (REPLACE "=" "" name ${name})
12 string (SUBSTRING ${name} 0 1 first) 13 string (SUBSTRING ${name} 0 1 first)
13 string (TOUPPER ${first} first) 14 string (TOUPPER ${first} first)
14 string (SUBSTRING ${name} 1 -1 remainder) 15 string (SUBSTRING ${name} 1 -1 remainder)
diff --git a/res/about/license.gmi b/res/about/license.gmi
index 4f654540..25fb7f05 100644
--- a/res/about/license.gmi
+++ b/res/about/license.gmi
@@ -94,7 +94,9 @@ The libunistring library is covered by the GNU Lesser General Public License (LG
94 94
95This application uses fonts licensed under the Open Font License. 95This application uses fonts licensed under the Open Font License.
96 96
97=> https://fonts.google.com/specimen/EB+Garamond#license EB Garamond
97=> https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono 98=> https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono
99=> https://github.com/googlefonts/literata/blob/master/OFL.txt Literata
98=> https://github.com/googlefonts/nunito/blob/master/OFL.txt Nunito 100=> https://github.com/googlefonts/nunito/blob/master/OFL.txt Nunito
99=> https://github.com/adobe-fonts/source-sans-pro/blob/release/LICENSE.md Source Sans Pro 101=> https://github.com/adobe-fonts/source-sans-pro/blob/release/LICENSE.md Source Sans Pro
100 102
diff --git a/res/fonts/EBGaramond-Bold.ttf b/res/fonts/EBGaramond-Bold.ttf
new file mode 100644
index 00000000..f380a1c3
--- /dev/null
+++ b/res/fonts/EBGaramond-Bold.ttf
Binary files differ
diff --git a/res/fonts/EBGaramond-Italic.ttf b/res/fonts/EBGaramond-Italic.ttf
new file mode 100644
index 00000000..a7201b00
--- /dev/null
+++ b/res/fonts/EBGaramond-Italic.ttf
Binary files differ
diff --git a/res/fonts/EBGaramond-Medium.ttf b/res/fonts/EBGaramond-Medium.ttf
new file mode 100644
index 00000000..b9d6964d
--- /dev/null
+++ b/res/fonts/EBGaramond-Medium.ttf
Binary files differ
diff --git a/res/fonts/EBGaramond-Regular.ttf b/res/fonts/EBGaramond-Regular.ttf
new file mode 100644
index 00000000..f57146c9
--- /dev/null
+++ b/res/fonts/EBGaramond-Regular.ttf
Binary files differ
diff --git a/res/fonts/LICENSE_EBGaramond.txt b/res/fonts/LICENSE_EBGaramond.txt
new file mode 100644
index 00000000..1fb3e844
--- /dev/null
+++ b/res/fonts/LICENSE_EBGaramond.txt
@@ -0,0 +1,93 @@
1Copyright 2017 The EB Garamond Project Authors (https://github.com/octaviopardo/EBGaramond12)
2
3This Font Software is licensed under the SIL Open Font License, Version 1.1.
4This license is copied below, and is also available with a FAQ at:
5http://scripts.sil.org/OFL
6
7
8-----------------------------------------------------------
9SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10-----------------------------------------------------------
11
12PREAMBLE
13The goals of the Open Font License (OFL) are to stimulate worldwide
14development of collaborative font projects, to support the font creation
15efforts of academic and linguistic communities, and to provide a free and
16open framework in which fonts may be shared and improved in partnership
17with others.
18
19The OFL allows the licensed fonts to be used, studied, modified and
20redistributed freely as long as they are not sold by themselves. The
21fonts, including any derivative works, can be bundled, embedded,
22redistributed and/or sold with any software provided that any reserved
23names are not used by derivative works. The fonts and derivatives,
24however, cannot be released under any other type of license. The
25requirement for fonts to remain under this license does not apply
26to any document created using the fonts or their derivatives.
27
28DEFINITIONS
29"Font Software" refers to the set of files released by the Copyright
30Holder(s) under this license and clearly marked as such. This may
31include source files, build scripts and documentation.
32
33"Reserved Font Name" refers to any names specified as such after the
34copyright statement(s).
35
36"Original Version" refers to the collection of Font Software components as
37distributed by the Copyright Holder(s).
38
39"Modified Version" refers to any derivative made by adding to, deleting,
40or substituting -- in part or in whole -- any of the components of the
41Original Version, by changing formats or by porting the Font Software to a
42new environment.
43
44"Author" refers to any designer, engineer, programmer, technical
45writer or other person who contributed to the Font Software.
46
47PERMISSION & CONDITIONS
48Permission is hereby granted, free of charge, to any person obtaining
49a copy of the Font Software, to use, study, copy, merge, embed, modify,
50redistribute, and sell modified and unmodified copies of the Font
51Software, subject to the following conditions:
52
531) Neither the Font Software nor any of its individual components,
54in Original or Modified Versions, may be sold by itself.
55
562) Original or Modified Versions of the Font Software may be bundled,
57redistributed and/or sold with any software, provided that each copy
58contains the above copyright notice and this license. These can be
59included either as stand-alone text files, human-readable headers or
60in the appropriate machine-readable metadata fields within text or
61binary files as long as those fields can be easily viewed by the user.
62
633) No Modified Version of the Font Software may use the Reserved Font
64Name(s) unless explicit written permission is granted by the corresponding
65Copyright Holder. This restriction only applies to the primary font name as
66presented to the users.
67
684) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69Software shall not be used to promote, endorse or advertise any
70Modified Version, except to acknowledge the contribution(s) of the
71Copyright Holder(s) and the Author(s) or with their explicit written
72permission.
73
745) The Font Software, modified or unmodified, in part or in whole,
75must be distributed entirely under this license, and must not be
76distributed under any other license. The requirement for fonts to
77remain under this license does not apply to any document created
78using the Font Software.
79
80TERMINATION
81This license becomes null and void if any of the above conditions are
82not met.
83
84DISCLAIMER
85THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/res/fonts/LICENSE_Literata.txt b/res/fonts/LICENSE_Literata.txt
new file mode 100644
index 00000000..8bf7b94f
--- /dev/null
+++ b/res/fonts/LICENSE_Literata.txt
@@ -0,0 +1,93 @@
1Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata)
2
3This Font Software is licensed under the SIL Open Font License, Version 1.1.
4This license is copied below, and is also available with a FAQ at:
5http://scripts.sil.org/OFL
6
7
8-----------------------------------------------------------
9SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10-----------------------------------------------------------
11
12PREAMBLE
13The goals of the Open Font License (OFL) are to stimulate worldwide
14development of collaborative font projects, to support the font creation
15efforts of academic and linguistic communities, and to provide a free and
16open framework in which fonts may be shared and improved in partnership
17with others.
18
19The OFL allows the licensed fonts to be used, studied, modified and
20redistributed freely as long as they are not sold by themselves. The
21fonts, including any derivative works, can be bundled, embedded,
22redistributed and/or sold with any software provided that any reserved
23names are not used by derivative works. The fonts and derivatives,
24however, cannot be released under any other type of license. The
25requirement for fonts to remain under this license does not apply
26to any document created using the fonts or their derivatives.
27
28DEFINITIONS
29"Font Software" refers to the set of files released by the Copyright
30Holder(s) under this license and clearly marked as such. This may
31include source files, build scripts and documentation.
32
33"Reserved Font Name" refers to any names specified as such after the
34copyright statement(s).
35
36"Original Version" refers to the collection of Font Software components as
37distributed by the Copyright Holder(s).
38
39"Modified Version" refers to any derivative made by adding to, deleting,
40or substituting -- in part or in whole -- any of the components of the
41Original Version, by changing formats or by porting the Font Software to a
42new environment.
43
44"Author" refers to any designer, engineer, programmer, technical
45writer or other person who contributed to the Font Software.
46
47PERMISSION & CONDITIONS
48Permission is hereby granted, free of charge, to any person obtaining
49a copy of the Font Software, to use, study, copy, merge, embed, modify,
50redistribute, and sell modified and unmodified copies of the Font
51Software, subject to the following conditions:
52
531) Neither the Font Software nor any of its individual components,
54in Original or Modified Versions, may be sold by itself.
55
562) Original or Modified Versions of the Font Software may be bundled,
57redistributed and/or sold with any software, provided that each copy
58contains the above copyright notice and this license. These can be
59included either as stand-alone text files, human-readable headers or
60in the appropriate machine-readable metadata fields within text or
61binary files as long as those fields can be easily viewed by the user.
62
633) No Modified Version of the Font Software may use the Reserved Font
64Name(s) unless explicit written permission is granted by the corresponding
65Copyright Holder. This restriction only applies to the primary font name as
66presented to the users.
67
684) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69Software shall not be used to promote, endorse or advertise any
70Modified Version, except to acknowledge the contribution(s) of the
71Copyright Holder(s) and the Author(s) or with their explicit written
72permission.
73
745) The Font Software, modified or unmodified, in part or in whole,
75must be distributed entirely under this license, and must not be
76distributed under any other license. The requirement for fonts to
77remain under this license does not apply to any document created
78using the Font Software.
79
80TERMINATION
81This license becomes null and void if any of the above conditions are
82not met.
83
84DISCLAIMER
85THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/res/fonts/Literata-Bold-opsz=36.ttf b/res/fonts/Literata-Bold-opsz=36.ttf
new file mode 100644
index 00000000..0b36bcc5
--- /dev/null
+++ b/res/fonts/Literata-Bold-opsz=36.ttf
Binary files differ
diff --git a/res/fonts/Literata-ExtraLight-opsz=18.ttf b/res/fonts/Literata-ExtraLight-opsz=18.ttf
new file mode 100644
index 00000000..adf2269c
--- /dev/null
+++ b/res/fonts/Literata-ExtraLight-opsz=18.ttf
Binary files differ
diff --git a/res/fonts/Literata-LightItalic-opsz=14.ttf b/res/fonts/Literata-LightItalic-opsz=14.ttf
new file mode 100644
index 00000000..4549f26e
--- /dev/null
+++ b/res/fonts/Literata-LightItalic-opsz=14.ttf
Binary files differ
diff --git a/res/fonts/Literata-Regular-opsz=14.ttf b/res/fonts/Literata-Regular-opsz=14.ttf
new file mode 100644
index 00000000..e523b1ce
--- /dev/null
+++ b/res/fonts/Literata-Regular-opsz=14.ttf
Binary files differ
diff --git a/src/gmdocument.c b/src/gmdocument.c
index e2696085..f800f6ed 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -799,9 +799,9 @@ void setThemeSeed_GmDocument(iGmDocument *d, const iBlock *seed) {
799 799
800 if (delta_Color(get_Color(tmHeading3_ColorId), get_Color(tmParagraph_ColorId)) <= 80) { 800 if (delta_Color(get_Color(tmHeading3_ColorId), get_Color(tmParagraph_ColorId)) <= 80) {
801 /* Smallest headings may be too close to body text color. */ 801 /* Smallest headings may be too close to body text color. */
802 iHSLColor clr = get_HSLColor(tmParagraph_ColorId); 802// iHSLColor clr = get_HSLColor(tmParagraph_ColorId);
803 clr.lum = iMax(0.5f, clr.lum - 0.15f); 803// clr.lum = iMax(0.5f, clr.lum - 0.15f);
804 setHsl_Color(tmParagraph_ColorId, clr); 804 //setHsl_Color(tmParagraph_ColorId, clr);
805 setHsl_Color(tmHeading3_ColorId, 805 setHsl_Color(tmHeading3_ColorId,
806 addSatLum_HSLColor(get_HSLColor(tmHeading3_ColorId), 0, 0.15f)); 806 addSatLum_HSLColor(get_HSLColor(tmHeading3_ColorId), 0, 0.15f));
807 } 807 }
diff --git a/src/ui/color.c b/src/ui/color.c
index 9d2c4132..2cf7ebbd 100644
--- a/src/ui/color.c
+++ b/src/ui/color.c
@@ -199,7 +199,7 @@ void setThemePalette_Color(enum iColorTheme theme) {
199 copy_(uiAnnotation_ColorId, gray50_ColorId); 199 copy_(uiAnnotation_ColorId, gray50_ColorId);
200 copy_(uiIcon_ColorId, brown_ColorId); 200 copy_(uiIcon_ColorId, brown_ColorId);
201 copy_(uiIconHover_ColorId, brown_ColorId); 201 copy_(uiIconHover_ColorId, brown_ColorId);
202 copy_(uiSeparator_ColorId, gray75_ColorId); 202 copy_(uiSeparator_ColorId, gray50_ColorId);
203 copy_(uiMarked_ColorId, cyan_ColorId); 203 copy_(uiMarked_ColorId, cyan_ColorId);
204 copy_(uiMatching_ColorId, orange_ColorId); 204 copy_(uiMatching_ColorId, orange_ColorId);
205 break; 205 break;
diff --git a/src/ui/text.c b/src/ui/text.c
index eb6c66e8..8d8aa19c 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -166,7 +166,7 @@ static void initFonts_Text_(iText *d) {
166 const iBlock *italicFont = &fontNunitoLightItalic_Embedded; 166 const iBlock *italicFont = &fontNunitoLightItalic_Embedded;
167 const iBlock *boldFont = &fontNunitoExtraBold_Embedded; 167 const iBlock *boldFont = &fontNunitoExtraBold_Embedded;
168 const iBlock *lightFont = &fontNunitoExtraLight_Embedded; 168 const iBlock *lightFont = &fontNunitoExtraLight_Embedded;
169 float scaling = 1.0f; /* additional glyph scaling (<=1), to increase line spacing */ 169 float scaling = 1.0f; /* glyph scaling (<=1.0), for increasing line spacing */
170 if (d->contentFont == firaSans_TextFont) { 170 if (d->contentFont == firaSans_TextFont) {
171 regularFont = &fontFiraSansRegular_Embedded; 171 regularFont = &fontFiraSansRegular_Embedded;
172 italicFont = &fontFiraSansItalic_Embedded; 172 italicFont = &fontFiraSansItalic_Embedded;
@@ -174,6 +174,18 @@ static void initFonts_Text_(iText *d) {
174 lightFont = &fontFiraSansLight_Embedded; 174 lightFont = &fontFiraSansLight_Embedded;
175 scaling = 0.85f; 175 scaling = 0.85f;
176 } 176 }
177 else if (d->contentFont == ebGaramond_TextFont) {
178 regularFont = &fontEBGaramondRegular_Embedded;
179 italicFont = &fontEBGaramondItalic_Embedded;
180 boldFont = &fontEBGaramondBold_Embedded;
181 lightFont = &fontLiterataExtraLightopsz18_Embedded;
182 }
183 else if (d->contentFont == literata_TextFont) {
184 regularFont = &fontLiterataRegularopsz14_Embedded;
185 italicFont = &fontLiterataLightItalicopsz14_Embedded;
186 boldFont = &fontLiterataBoldopsz36_Embedded;
187 lightFont = &fontLiterataExtraLightopsz18_Embedded;
188 }
177 const struct { 189 const struct {
178 const iBlock *ttf; 190 const iBlock *ttf;
179 int size; 191 int size;
diff --git a/src/ui/text.h b/src/ui/text.h
index fa7b9402..fe4ddef1 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -108,6 +108,8 @@ iLocalDef iBool isVariationSelector_Char(iChar ch) {
108enum iTextFont { 108enum iTextFont {
109 nunito_TextFont, 109 nunito_TextFont,
110 firaSans_TextFont, 110 firaSans_TextFont,
111 literata_TextFont,
112 ebGaramond_TextFont,
111}; 113};
112 114
113extern int gap_Text; /* affected by content font size */ 115extern int gap_Text; /* affected by content font size */
diff --git a/src/ui/util.c b/src/ui/util.c
index 89f71da2..c061231d 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -925,6 +925,8 @@ iWidget *makePreferences_Widget(void) {
925 /* Fonts. */ { 925 /* Fonts. */ {
926 addRadioButton_(fonts, "prefs.font.0", "Nunito", "font.set arg:0"); 926 addRadioButton_(fonts, "prefs.font.0", "Nunito", "font.set arg:0");
927 addRadioButton_(fonts, "prefs.font.1", "Fira Sans", "font.set arg:1"); 927 addRadioButton_(fonts, "prefs.font.1", "Fira Sans", "font.set arg:1");
928 addRadioButton_(fonts, "prefs.font.2", "Literata", "font.set arg:2");
929 addRadioButton_(fonts, "prefs.font.3", "EB Garamond", "font.set arg:3");
928 } 930 }
929 addChildFlags_Widget(values, iClob(fonts), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); 931 addChildFlags_Widget(values, iClob(fonts), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
930 addChild_Widget(headings, iClob(makeHeading_Widget("Line width:"))); 932 addChild_Widget(headings, iClob(makeHeading_Widget("Line width:")));