Skip to content

Commit

Permalink
Update to support text weight
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Craven committed Dec 13, 2024
1 parent 590274c commit 9c43b61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ terminal from inside the top level of the Arcade directory:
pip install -e '.[dev]'
```

If you are using the Windows command prompt, use double quotes:

```bash
pip install -e ".[dev]"
```

If you get an error like the one below, you probably need to update your pip version:

```
Expand Down
6 changes: 3 additions & 3 deletions arcade/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __init__(
color=Color.from_iterable(color),
width=width,
align=align, # type: ignore
bold=bold,
weight=pyglet.text.Weight.BOLD if bold else pyglet.text.Weight.NORMAL,
italic=italic,
multiline=multiline,
rotation=rotation, # type: ignore # pending https://github.com/pyglet/pyglet/issues/843
Expand Down Expand Up @@ -527,11 +527,11 @@ def bold(self) -> bool | str:
* ``"light"``
"""
return self._label.bold
return self._label.weight == pyglet.text.Weight.BOLD

@bold.setter
def bold(self, bold: bool | str):
self._label.bold = bold
self._label.weight = pyglet.text.Weight.BOLD if bold else pyglet.text.Weight.NORMAL

@property
def italic(self) -> bool | str:
Expand Down

0 comments on commit 9c43b61

Please sign in to comment.