Skip to content

Commit 9b7fc23

Browse files
authored
Merge pull request #107 from FoamyGuy/change_font
adding font with license file
2 parents 8b8964a + d040857 commit 9b7fc23

33 files changed

+13150
-4362
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
*.mpy
26
.idea
37
__pycache__

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
[MASTER]
26

37
# A comma-separated list of package or module names from where C extensions may

.readthedocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
python:
26
version: 3
37
requirements_file: requirements.txt

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3+
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
17
# Adafruit Community Code of Conduct
28

39
## Our Pledge
@@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include:
4349

4450
The goal of the standards and moderation guidelines outlined here is to build
4551
and maintain a respectful community. We ask that you don’t just aim to be
46-
"technically unimpeachable", but rather try to be your best self.
52+
"technically unimpeachable", but rather try to be your best self.
4753

4854
We value many things beyond technical expertise, including collaboration and
4955
supporting others within our community. Providing a positive experience for
@@ -74,9 +80,9 @@ You may report in the following ways:
7480
In any situation, you may send an email to <[email protected]>.
7581

7682
On the Adafruit Discord, you may send an open message from any channel
77-
to all Community Moderators by tagging @community moderators. You may
78-
also send an open message from any channel, or a direct message to
79-
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
83+
to all Community Moderators by tagging @community moderators. You may
84+
also send an open message from any channel, or a direct message to
85+
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
8086
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
8187

8288
Email and direct message reports will be kept confidential.

LICENSES/CC-BY-4.0.txt

Lines changed: 324 additions & 0 deletions
Large diffs are not rendered by default.

LICENSES/MIT.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License Copyright (c) <year> <copyright holders>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/OFL-1.1.txt

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

LICENSES/Unlicense.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
4+
this software, either in source code form or as a compiled binary, for any
5+
purpose, commercial or non-commercial, and by any means.
6+
7+
In jurisdictions that recognize copyright laws, the author or authors of this
8+
software dedicate any and all copyright interest in the software to the public
9+
domain. We make this dedication for the benefit of the public at large and
10+
to the detriment of our heirs and successors. We intend this dedication to
11+
be an overt act of relinquishment in perpetuity of all present and future
12+
rights to this software under copyright law.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
19+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
20+
please refer to <https://unlicense.org/>

README.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
3+
SPDX-License-Identifier: MIT

adafruit_display_text/__init__.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
1+
# SPDX-FileCopyrightText: 2020 Tim C for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""
26
Display Text module helper functions
37
"""
48

59

6-
# The MIT License (MIT)
7-
#
8-
# Copyright (c) 2020 Tim C for Adafruit Industries LLC
9-
#
10-
# Permission is hereby granted, free of charge, to any person obtaining a copy
11-
# of this software and associated documentation files (the "Software"), to deal
12-
# in the Software without restriction, including without limitation the rights
13-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
# copies of the Software, and to permit persons to whom the Software is
15-
# furnished to do so, subject to the following conditions:
16-
#
17-
# The above copyright notice and this permission notice shall be included in
18-
# all copies or substantial portions of the Software.
19-
#
20-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26-
# THE SOFTWARE.
27-
28-
2910
def wrap_text_to_lines(string, max_chars):
3011
"""wrap_text_to_lines function
3112
A helper that will return a list of lines with word-break wrapping

adafruit_display_text/bitmap_label.py

Lines changed: 51 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
# The MIT License (MIT)
1+
# SPDX-FileCopyrightText: 2020 Kevin Matocha
22
#
3-
# Copyright (c) 2020 Kevin Matocha
4-
#
5-
# Permission is hereby granted, free of charge, to any person obtaining a copy
6-
# of this software and associated documentation files (the "Software"), to deal
7-
# in the Software without restriction, including without limitation the rights
8-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
# copies of the Software, and to permit persons to whom the Software is
10-
# furnished to do so, subject to the following conditions:
11-
#
12-
# The above copyright notice and this permission notice shall be included in
13-
# all copies or substantial portions of the Software.
14-
#
15-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
# THE SOFTWARE.
3+
# SPDX-License-Identifier: MIT
4+
225
"""
236
`bitmap_label`
247
================================================================================
@@ -48,43 +31,43 @@
4831

4932
class Label(displayio.Group):
5033
"""A label displaying a string of text that is stored in a bitmap.
51-
Note: This ``bitmap_label.py`` library utilizes a bitmap to display the text.
52-
This method is memory-conserving relative to ``label.py``.
53-
The ``max_glyphs`` parameter is ignored and is present
54-
only for direct compatability with label.py.
55-
56-
For further reduction in memory usage, set ``save_text=False`` (text string will not
57-
be stored and ``line_spacing`` and ``font`` are immutable with ``save_text``
58-
set to ``False``).
59-
60-
The origin point set by ``x`` and ``y``
61-
properties will be the left edge of the bounding box, and in the center of a M
62-
glyph (if its one line), or the (number of lines * linespacing + M)/2. That is,
63-
it will try to have it be center-left as close as possible.
64-
65-
:param Font font: A font class that has ``get_bounding_box`` and ``get_glyph``.
66-
Must include a capital M for measuring character size.
67-
:param str text: Text to display
68-
:param int max_glyphs: Unnecessary parameter (provided only for direct compability
69-
with label.py)
70-
:param int color: Color of all text in RGB hex
71-
:param int background_color: Color of the background, use `None` for transparent
72-
:param double line_spacing: Line spacing of text to display
73-
:param boolean background_tight: Set `True` only if you want background box to tightly
74-
surround text
75-
:param int padding_top: Additional pixels added to background bounding box at top
76-
:param int padding_bottom: Additional pixels added to background bounding box at bottom
77-
:param int padding_left: Additional pixels added to background bounding box at left
78-
:param int padding_right: Additional pixels added to background bounding box at right
79-
:param (double,double) anchor_point: Point that anchored_position moves relative to.
80-
Tuple with decimal percentage of width and height.
81-
(E.g. (0,0) is top left, (1.0, 0.5): is middle right.)
82-
:param (int,int) anchored_position: Position relative to the anchor_point. Tuple
83-
containing x,y pixel coordinates.
84-
:param int scale: Integer value of the pixel scaling
85-
:param bool save_text: Set True to save the text string as a constant in the
86-
label structure. Set False to reduce memory use.
87-
"""
34+
Note: This ``bitmap_label.py`` library utilizes a bitmap to display the text.
35+
This method is memory-conserving relative to ``label.py``.
36+
The ``max_glyphs`` parameter is ignored and is present
37+
only for direct compatability with label.py.
38+
39+
For further reduction in memory usage, set ``save_text=False`` (text string will not
40+
be stored and ``line_spacing`` and ``font`` are immutable with ``save_text``
41+
set to ``False``).
42+
43+
The origin point set by ``x`` and ``y``
44+
properties will be the left edge of the bounding box, and in the center of a M
45+
glyph (if its one line), or the (number of lines * linespacing + M)/2. That is,
46+
it will try to have it be center-left as close as possible.
47+
48+
:param Font font: A font class that has ``get_bounding_box`` and ``get_glyph``.
49+
Must include a capital M for measuring character size.
50+
:param str text: Text to display
51+
:param int max_glyphs: Unnecessary parameter (provided only for direct compability
52+
with label.py)
53+
:param int color: Color of all text in RGB hex
54+
:param int background_color: Color of the background, use `None` for transparent
55+
:param double line_spacing: Line spacing of text to display
56+
:param boolean background_tight: Set `True` only if you want background box to tightly
57+
surround text
58+
:param int padding_top: Additional pixels added to background bounding box at top
59+
:param int padding_bottom: Additional pixels added to background bounding box at bottom
60+
:param int padding_left: Additional pixels added to background bounding box at left
61+
:param int padding_right: Additional pixels added to background bounding box at right
62+
:param (double,double) anchor_point: Point that anchored_position moves relative to.
63+
Tuple with decimal percentage of width and height.
64+
(E.g. (0,0) is top left, (1.0, 0.5): is middle right.)
65+
:param (int,int) anchored_position: Position relative to the anchor_point. Tuple
66+
containing x,y pixel coordinates.
67+
:param int scale: Integer value of the pixel scaling
68+
:param bool save_text: Set True to save the text string as a constant in the
69+
label structure. Set False to reduce memory use.
70+
"""
8871

8972
# pylint: disable=unused-argument, too-many-instance-attributes, too-many-locals, too-many-arguments
9073
# pylint: disable=too-many-branches, no-self-use, too-many-statements
@@ -118,7 +101,11 @@ def __init__(
118101
# self Group will contain a single local_group which contains a Group (self.local_group)
119102
# which contains a TileGrid (self.tilegrid) which contains the text bitmap (self.bitmap)
120103
super().__init__(
121-
max_size=1, x=x, y=y, scale=1, **kwargs,
104+
max_size=1,
105+
x=x,
106+
y=y,
107+
scale=1,
108+
**kwargs,
122109
)
123110
# the self group scale should always remain at 1, the self.local_group will
124111
# be used to set the scale
@@ -248,7 +235,9 @@ def _reset_text(
248235
loose_box_y,
249236
loose_y_offset,
250237
) = self._text_bounding_box(
251-
text, self._font, self._line_spacing,
238+
text,
239+
self._font,
240+
self._line_spacing,
252241
) # calculate the box size for a tight and loose backgrounds
253242

254243
if self._background_tight:
@@ -645,8 +634,8 @@ def font(self, new_font):
645634
@property
646635
def anchor_point(self):
647636
"""Point that anchored_position moves relative to.
648-
Tuple with decimal percentage of width and height.
649-
(E.g. (0,0) is top left, (1.0, 0.5): is middle right.)"""
637+
Tuple with decimal percentage of width and height.
638+
(E.g. (0,0) is top left, (1.0, 0.5): is middle right.)"""
650639
return self._anchor_point
651640

652641
@anchor_point.setter
@@ -659,7 +648,7 @@ def anchor_point(self, new_anchor_point):
659648
@property
660649
def anchored_position(self):
661650
"""Position relative to the anchor_point. Tuple containing x,y
662-
pixel coordinates."""
651+
pixel coordinates."""
663652
return self._anchored_position
664653

665654
@anchored_position.setter

0 commit comments

Comments
 (0)