Skip to content

Commit 6d04a05

Browse files
committed
Merge branch 'dev' into release
# Conflicts: # CMakeLists.txt # res/about/version.gmi
2 parents d03a739 + 6329646 commit 6d04a05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1149
-330
lines changed

CMakeLists.txt

+37-17
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
cmake_minimum_required (VERSION 3.9)
2020

2121
project (Lagrange
22-
VERSION 0.4.1
22+
VERSION 0.5.0
2323
DESCRIPTION "Beautiful Gemini Client"
2424
LANGUAGES C
2525
)
2626
set (COPYRIGHT_YEAR 2020)
2727

2828
# Build configuration.
29+
option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)
2930
option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF)
3031
option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON)
3132
option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)
@@ -47,6 +48,7 @@ else ()
4748
endif ()
4849
find_package (PkgConfig REQUIRED)
4950
pkg_check_modules (SDL2 REQUIRED sdl2)
51+
pkg_check_modules (MPG123 IMPORTED_TARGET libmpg123)
5052

5153
# Embedded resources are written to a generated source file.
5254
message (STATUS "Preparing embedded resources...")
@@ -56,23 +58,30 @@ set (EMBED_RESOURCES
5658
res/about/lagrange.gmi
5759
res/about/license.gmi
5860
res/about/version.gmi
59-
res/FiraMono-Regular.ttf
60-
res/FiraSans-Bold.ttf
61-
res/FiraSans-Italic.ttf
62-
res/FiraSans-Light.ttf
63-
res/FiraSans-Regular.ttf
64-
res/KosugiMaru-Regular.ttf
65-
res/NotoEmoji-Regular.ttf
66-
res/Nunito-ExtraBold.ttf
67-
res/Nunito-ExtraLight.ttf
68-
res/Nunito-LightItalic.ttf
69-
res/Nunito-Regular.ttf
70-
res/SourceSansPro-Regular.ttf
71-
res/Symbola.ttf
61+
res/fonts/EBGaramond-Regular.ttf
62+
res/fonts/EBGaramond-Italic.ttf
63+
res/fonts/EBGaramond-Bold.ttf
64+
res/fonts/FiraMono-Regular.ttf
65+
res/fonts/FiraSans-Bold.ttf
66+
res/fonts/FiraSans-Italic.ttf
67+
res/fonts/FiraSans-Light.ttf
68+
res/fonts/FiraSans-Regular.ttf
69+
res/fonts/KosugiMaru-Regular.ttf
70+
res/fonts/Literata-Regular-opsz=14.ttf
71+
res/fonts/Literata-Bold-opsz=36.ttf
72+
res/fonts/Literata-ExtraLight-opsz=18.ttf
73+
res/fonts/Literata-LightItalic-opsz=10.ttf
74+
res/fonts/NotoEmoji-Regular.ttf
75+
res/fonts/Nunito-ExtraBold.ttf
76+
res/fonts/Nunito-ExtraLight.ttf
77+
res/fonts/Nunito-LightItalic.ttf
78+
res/fonts/Nunito-Regular.ttf
79+
res/fonts/SourceSansPro-Regular.ttf
80+
res/fonts/Symbola.ttf
7281
)
73-
if (UNIX AND NOT APPLE)
74-
list (APPEND EMBED_RESOURCES res/lagrange-64.png)
75-
endif ()
82+
if (UNIX AND NOT APPLE)
83+
list (APPEND EMBED_RESOURCES res/lagrange-64.png)
84+
endif ()
7685
embed_make (${EMBED_RESOURCES})
7786

7887
set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.binary)
@@ -127,6 +136,8 @@ set (SOURCES
127136
src/ui/metrics.h
128137
src/ui/paint.c
129138
src/ui/paint.h
139+
src/ui/playerui.c
140+
src/ui/playerui.h
130141
src/ui/scrollwidget.c
131142
src/ui/scrollwidget.h
132143
src/ui/sidebarwidget.c
@@ -192,6 +203,10 @@ endif ()
192203
if (ENABLE_WINDOWPOS_FIX)
193204
target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_WINDOWPOS_FIX=1)
194205
endif ()
206+
if (ENABLE_MPG123 AND MPG123_FOUND)
207+
target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MPG123=1)
208+
target_link_libraries (app PUBLIC PkgConfig::MPG123)
209+
endif ()
195210
target_link_libraries (app PUBLIC the_Foundation::the_Foundation)
196211
target_link_libraries (app PUBLIC ${SDL2_LDFLAGS})
197212
if (APPLE)
@@ -229,6 +244,9 @@ endif ()
229244
# Deployment.
230245
if (MSYS)
231246
install (TARGETS app DESTINATION .)
247+
if (TARGET PkgConfig::MPG123)
248+
install (PROGRAMS ${MPG123_LIBDIR}/../bin/msys-mpg123-0.dll DESTINATION .)
249+
endif ()
232250
if (NOT ENABLE_RESOURCE_EMBED)
233251
install (FILES ${EMB_BIN} DESTINATION .)
234252
endif ()
@@ -262,6 +280,8 @@ MimeType=x-scheme-handler/gemini;
262280
RENAME fi.skyjake.lagrange.png
263281
)
264282
if (NOT ENABLE_RESOURCE_EMBED)
283+
target_compile_definitions (app PUBLIC
284+
LAGRANGE_EMB_BIN="${CMAKE_INSTALL_PREFIX}/share/lagrange/resources.binary")
265285
install (FILES ${EMB_BIN} DESTINATION share/lagrange)
266286
endif ()
267287
endif ()

Embed.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)
99
function (embed_getname output fn)
1010
get_filename_component (name ${fn} NAME_WE)
1111
string (REPLACE "-" "" name ${name})
12+
string (REPLACE "=" "" name ${name})
1213
string (SUBSTRING ${name} 0 1 first)
1314
string (TOUPPER ${first} first)
1415
string (SUBSTRING ${name} 1 -1 remainder)

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a
1414
* Sidebar for page outline, managing bookmarks and identities, and viewing history
1515
* Multiple tabs
1616
* Identity management — create and use TLS client certificates
17+
* Audio playback: MP3, Ogg Vorbis, WAV
1718
* And more! Open `about:help` in the app, or see [help.gmi](https://git.skyjake.fi/skyjake/lagrange/raw/branch/release/res/about/help.gmi)
1819

1920
## Downloads
@@ -25,11 +26,12 @@ Prebuilt binaries for Windows and macOS can be found in [Releases][rel].
2526
This is how to build Lagrange in a Unix-like environment. The required tools are a C11 compiler (e.g., Clang or GCC), CMake and `pkg-config`.
2627

2728
1. Download and extract a source tarball from [Releases][rel]. Alternatively, you may also clone the repository and its submodules: `git clone --recursive --branch release https://git.skyjake.fi/skyjake/lagrange`
28-
2. Check that you have the dependencies installed: CMake, SDL 2, OpenSSL 1.1.1, libpcre, zlib, libunistring. For example, on macOS this would do the trick (using Homebrew): ```brew install cmake sdl2 [email protected] pcre libunistring``` Or on Ubuntu: ```sudo apt install cmake libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev```
29-
3. Create a build directory.
30-
4. In your empty build directory, run CMake: ```cmake {path_of_lagrange_sources} -DCMAKE_BUILD_TYPE=Release```
31-
5. Build it: ```cmake --build .```
32-
6. Now you can run `lagrange`, `lagrange.exe`, or `Lagrange.app`.
29+
2. Check that you have the required dependencies installed: CMake, SDL 2, OpenSSL 1.1.1, libpcre, zlib, libunistring. For example, on macOS this would do the trick (using Homebrew): ```brew install cmake sdl2 [email protected] pcre libunistring``` Or on Ubuntu: ```sudo apt install cmake libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev```
30+
3. Optionally, install the mpg123 decoder library for MPEG audio support. For example, the macOS Homebrew package is `mpg123` and on Ubuntu it is `libmpg123-dev`.
31+
4. Create a build directory.
32+
5. In your empty build directory, run CMake: ```cmake {path_of_lagrange_sources} -DCMAKE_BUILD_TYPE=Release```
33+
6. Build it: ```cmake --build .```
34+
7. Now you can run `lagrange`, `lagrange.exe`, or `Lagrange.app`.
3335

3436
### Installing to a directory
3537

lagrange_about.png

135 KB
Loading

res/SymbolaSubset.ttf

-719 KB
Binary file not shown.

res/about/help.gmi

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a
2828
* Select and copy text with the mouse
2929
* Find text on the page
3030
* Open image links inline on the same page
31+
* Audio playback: MP3, Ogg Vorbis, WAV
3132
* Open links via keyboard shortcuts
3233
* Instant back/forward navigation
3334
* Smooth scrolling
@@ -118,7 +119,7 @@ The sidebar can be toggled via menus or by pressing ${SHIFT+}${CTRL+}L. It has f
118119
* Bookmarks: List of bookmarks that you've created. These appear first in search results for quick and easy access.
119120
* History: Chronological list of visited URLs. This is not a full history of all the URLs you've accessed over time — only unique URLs are shown at the latest access time.
120121
* Identities: TLS client certificates.
121-
* Outline: List of the headings in the currently open tab. Useful when reading longer documents.
122+
* Outline: List of the headings in the currently open tab. Useful when reading longer documents.
122123

123124
${CTRL+}1 through ${CTRL+}4 switch between the sidebar tabs, or hide the sidebar if the current tab's key is pressed.
124125

res/about/license.gmi

+9-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ SDL 2.0 and newer are available under the zlib license:
2929
>
3030
> 3. This notice may not be removed or altered from any source distribution.
3131

32+
## mpg123
33+
34+
mpg123 is a fast console MPEG audio player and decoder library. It is licensed under LGPL 2.1. Lagrange uses the libmpg123 decoder library when playing back MPEG audio.
35+
=> https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html GNU LGPL version 2.1
36+
=> https://mpg123.org/ mpg123
37+
3238
## the_Foundation
3339

3440
the_Foundation is an opinionated C11 library by Jaakko Keränen. It is under the BSD 2-clause license. Note that the rest of the libraries in this section are used by the_Foundation, and not directly by Lagrange.
@@ -88,13 +94,15 @@ SSLeay license:
8894
## GNU libunistring
8995

9096
The libunistring library is covered by the GNU Lesser General Public License (LGPL):
91-
=> https://www.gnu.org/software/libunistring/manual/libunistring.html#GNU-LGPL GNU LGPL License
97+
=> https://www.gnu.org/software/libunistring/manual/libunistring.html#GNU-LGPL GNU LGPL
9298

9399
## Fonts
94100

95101
This application uses fonts licensed under the Open Font License.
96102

103+
=> https://fonts.google.com/specimen/EB+Garamond#license EB Garamond
97104
=> https://github.com/mozilla/Fira/blob/master/LICENSE Fira Sans, Fira Mono
105+
=> https://github.com/googlefonts/literata/blob/master/OFL.txt Literata
98106
=> https://github.com/googlefonts/nunito/blob/master/OFL.txt Nunito
99107
=> https://github.com/adobe-fonts/source-sans-pro/blob/release/LICENSE.md Source Sans Pro
100108

res/about/version.gmi

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
```
77
# Release notes
88

9+
## 0.5
10+
* Added MP3 support in the audio player (using mpg123).
11+
=> https://mpg123.org/ mpg123: MPEG audio player and decoder library
12+
* Added volume control in the audio player.
13+
* Metadata in Vorbis and MP3 audio content (title, artist, etc.) is shown in the audio player menu.
14+
* Added new serif fonts: EB Garamond and Literata.
15+
* Allow configuring separate fonts for headings and body text for better visual distinction.
16+
* Preferences dialog remembers the previously open tab.
17+
* Paste from clipboard on middle mouse button click.
18+
* Open links in new tab with middle mouse button.
19+
* Fixed failure to find resources when launching via PATH.
20+
* Fixed color saturation setting not affecting the default color theme.
21+
922
## 0.4.1
1023
* Set keyboard focus to URL input field after opening a new tab.
1124
* Pause other audio players when a new one is started. One can still choose to have multiple audio players playing simultaneously by unpausing them again.

res/fonts/EBGaramond-Bold.ttf

587 KB
Binary file not shown.

res/fonts/EBGaramond-Italic.ttf

551 KB
Binary file not shown.

res/fonts/EBGaramond-Regular.ttf

585 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

res/fonts/LICENSE_EBGaramond.txt

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2017 The EB Garamond Project Authors (https://github.com/octaviopardo/EBGaramond12)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
File renamed without changes.

res/fonts/LICENSE_Literata.txt

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
File renamed without changes.
File renamed without changes.

res/fonts/Literata-Bold-opsz=36.ttf

235 KB
Binary file not shown.
234 KB
Binary file not shown.
227 KB
Binary file not shown.
235 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)