Compare commits

...

4 Commits

Author SHA1 Message Date
leper 514c12cb66 Add ark pixel font's latin feature branch font. 7 days ago
Ondřej Hruška 3713c859ad Make media buttons control use double click so it is less prone to accidental track skips 1 week ago
Ondřej Hruška 972eb280d0 Enable scroll wrap-around 1 week ago
Ondřej Hruška 2ab4e9d8a6 Changed volume to go in 5pct steps 1 week ago
  1. 6
      REUSE.toml
  2. BIN
      lua/fonts/fusion10
  3. BIN
      lua/fonts/fusion12
  4. 3
      lua/licenses.lua
  5. 13
      src/tangara/audio/bt_audio_output.cpp
  6. 19
      src/tangara/audio/i2s_audio_output.cpp
  7. 4
      src/tangara/input/input_media_buttons.cpp
  8. 2
      src/tangara/ui/screen.cpp
  9. 94
      tools/fonts/ark/ark-pixel-10px-proportional/OFL.txt
  10. BIN
      tools/fonts/ark/ark-pixel-10px-proportional/ark-pixel-10px-proportional-latin.ttf
  11. 94
      tools/fonts/ark/ark-pixel-12px-proportional/OFL.txt
  12. BIN
      tools/fonts/ark/ark-pixel-12px-proportional/ark-pixel-12px-proportional-latin.ttf
  13. 8
      tools/fonts/mkfonts.sh

@ -199,6 +199,12 @@ precedence = "aggregate"
SPDX-FileCopyrightText = "1996-2018 Free Software Foundation, Inc." SPDX-FileCopyrightText = "1996-2018 Free Software Foundation, Inc."
SPDX-License-Identifier = "LGPL-2.1-or-later" SPDX-License-Identifier = "LGPL-2.1-or-later"
[[annotations]]
path = "tools/fonts/ark/**"
precedence = "aggregate"
SPDX-FileCopyrightText = "2021 TakWolf"
SPDX-License-Identifier = "OFL-1.1-RFN"
[[annotations]] [[annotations]]
path = "tools/fonts/fusion/**" path = "tools/fonts/fusion/**"
precedence = "aggregate" precedence = "aggregate"

Binary file not shown.

Binary file not shown.

@ -179,6 +179,9 @@ return function(self)
button:onClicked(show_fn) button:onClicked(show_fn)
end end
library("Ark Pixel font", "OFL", function()
ofl("Copyright (C) 2021 TakWolf")
end)
library("catch2", "BSL", function() library("catch2", "BSL", function()
bsl("2022 Two Blue Cubes Ltd.") bsl("2022 Two Blue Cubes Ltd.")
end) end)

@ -32,6 +32,7 @@
namespace audio { namespace audio {
static constexpr uint16_t kVolumeRange = 60; static constexpr uint16_t kVolumeRange = 60;
static constexpr uint16_t kVolumeStep = 5; // CUSTOM - added
using ConnectionState = drivers::Bluetooth::ConnectionState; using ConnectionState = drivers::Bluetooth::ConnectionState;
@ -101,7 +102,11 @@ auto BluetoothAudioOutput::AdjustVolumeUp() -> bool {
if (volume_ == 100) { if (volume_ == 100) {
return false; return false;
} }
volume_++; if (volume_ > 100 - kVolumeStep) {
volume_ = 100;
} else {
volume_ += kVolumeStep;
}
SetVolume(volume_); SetVolume(volume_);
return true; return true;
} }
@ -110,7 +115,11 @@ auto BluetoothAudioOutput::AdjustVolumeDown() -> bool {
if (volume_ == 0) { if (volume_ == 0) {
return false; return false;
} }
volume_--; if (volume_ < kVolumeStep) {
volume_ = 0;
} else {
volume_ -= kVolumeStep;
}
SetVolume(volume_); SetVolume(volume_);
return true; return true;
} }

@ -40,6 +40,7 @@ static constexpr uint16_t kMinVolume = 0b0;
static constexpr uint16_t kMaxVolumeBeforeClipping = 0x185; static constexpr uint16_t kMaxVolumeBeforeClipping = 0x185;
static constexpr uint16_t kLineLevelVolume = 0x13d; static constexpr uint16_t kLineLevelVolume = 0x13d;
static constexpr uint16_t kDefaultVolume = 0x100; static constexpr uint16_t kDefaultVolume = 0x100;
static constexpr uint16_t kVolumeStep = 5; // CUSTOM - added
I2SAudioOutput::I2SAudioOutput(drivers::IGpios& expander, I2SAudioOutput::I2SAudioOutput(drivers::IGpios& expander,
drivers::OutputBuffers& buffers) drivers::OutputBuffers& buffers)
@ -140,21 +141,29 @@ auto I2SAudioOutput::SetVolumeDb(int_fast16_t val) -> bool {
} }
auto I2SAudioOutput::AdjustVolumeUp() -> bool { auto I2SAudioOutput::AdjustVolumeUp() -> bool {
if (GetVolume() >= max_volume_) { uint16_t vol = GetVolume();
if (vol >= max_volume_) {
return false; return false;
} }
SetVolume(GetVolume() + 1);
if (vol > max_volume_ - kVolumeStep) {
SetVolume(max_volume_);
} else {
SetVolume(vol + kVolumeStep);
}
return true; return true;
} }
auto I2SAudioOutput::AdjustVolumeDown() -> bool { auto I2SAudioOutput::AdjustVolumeDown() -> bool {
if (GetVolume() == kMinVolume) { uint16_t vol = GetVolume();
if (vol == kMinVolume) {
return false; return false;
} }
if (GetVolume() <= kMinVolume + 1) { if (vol <= kMinVolume + kVolumeStep) {
SetVolume(0); SetVolume(0);
} else { } else {
SetVolume(GetVolume() - 1); SetVolume(vol - kVolumeStep);
} }
return true; return true;
} }

@ -13,8 +13,8 @@ namespace input {
MediaButtons::MediaButtons(drivers::IGpios& gpios, audio::TrackQueue& queue) MediaButtons::MediaButtons(drivers::IGpios& gpios, audio::TrackQueue& queue)
: gpios_(gpios), : gpios_(gpios),
up_("upper", actions::nextTrack(queue), {}, {}, actions::volumeUp()), up_("upper", {}, actions::nextTrack(queue), {}, actions::volumeUp()),
down_("lower", actions::prevTrack(queue), {}, {}, actions::volumeDown()), down_("lower", {}, actions::prevTrack(queue), {}, actions::volumeDown()),
locked_(), locked_(),
both_buttons_pressed_(false) {} both_buttons_pressed_(false) {}

@ -34,7 +34,7 @@ Screen::Screen()
// Disable wrapping by default, since it's confusing and generally makes it // Disable wrapping by default, since it's confusing and generally makes it
// harder to navigate quickly. // harder to navigate quickly.
lv_group_set_wrap(group_, false); lv_group_set_wrap(group_, true); // CUSTOMIZE: enabled - https://codeberg.org/cool-tech-zone/tangara-fw/issues/222
} }
Screen::~Screen() { Screen::~Screen() {

@ -0,0 +1,94 @@
Copyright (c) 2021, TakWolf (https://takwolf.com),
with Reserved Font Name 'Ark Pixel'.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These 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.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
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.

@ -0,0 +1,94 @@
Copyright (c) 2021, TakWolf (https://takwolf.com),
with Reserved Font Name 'Ark Pixel'.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These 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.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or 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 the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
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.

@ -15,6 +15,10 @@ fusion_12() {
-r 0x180-0x24F \ -r 0x180-0x24F \
-r 0x370-0x3FF \ -r 0x370-0x3FF \
-r 0x400-0x4FF \ -r 0x400-0x4FF \
--font ark/ark-pixel-12px-proportional/ark-pixel-12px-proportional-latin.ttf \
-r 0x100-0x17F \
-r 0x180-0x24F \
-r 0x370-0x3FF \
--font fusion/fusion-pixel-12px-proportional/fusion-pixel-12px-proportional-ja.ttf \ --font fusion/fusion-pixel-12px-proportional/fusion-pixel-12px-proportional-ja.ttf \
-r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \ -r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \
-r 0xFF00-0xFFEF,0x4E00-0x9FAF \ -r 0xFF00-0xFFEF,0x4E00-0x9FAF \
@ -34,6 +38,10 @@ fusion_10() {
-r 0x180-0x24F \ -r 0x180-0x24F \
-r 0x370-0x3FF \ -r 0x370-0x3FF \
-r 0x400-0x4FF \ -r 0x400-0x4FF \
--font ark/ark-pixel-10px-proportional/ark-pixel-10px-proportional-latin.ttf \
-r 0x100-0x17F \
-r 0x180-0x24F \
-r 0x370-0x3FF \
--font fusion/fusion-pixel-10px-proportional/fusion-pixel-10px-proportional-ja.ttf \ --font fusion/fusion-pixel-10px-proportional/fusion-pixel-10px-proportional-ja.ttf \
-r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \ -r 0x3000-0x303f,0x3040-0x309F,0x30A0-0x30FF \
-r 0xFF00-0xFFEF,0x4E00-0x9FAF \ -r 0xFF00-0xFFEF,0x4E00-0x9FAF \

Loading…
Cancel
Save