Merge branch 'readme' into 'master'
Fix terminal See merge request ynerant/dungeon-battle!11
This commit is contained in:
commit
810ca367c5
69
README.md
69
README.md
@ -3,7 +3,7 @@
|
||||
|
||||
# Dungeon Battle
|
||||
|
||||
M1 Software engineering project
|
||||
Projet de génie logiciel de M1
|
||||
|
||||
## Création d'un environnement de développement
|
||||
|
||||
@ -33,3 +33,70 @@ Il est toujours préférable de travailler dans un environnement Python isolé d
|
||||
(env)$ pip3 install -r requirements.txt
|
||||
(env)$ deactivate # sortir de l'environnement
|
||||
```
|
||||
|
||||
### Exécution des tests
|
||||
|
||||
Les tests sont gérés par `pytest` dans le module `dungeonbattle.tests`.
|
||||
|
||||
`tox` est un outil permettant de configurer l'exécution des tests. Ainsi, après
|
||||
installation de tox dans votre environnement virtuel via `pip install tox`,
|
||||
il vous suffit d'exécuter `tox -e py3` pour lancer les tests et `tox -e linters`
|
||||
pour vérifier la syntaxe du code.
|
||||
|
||||
|
||||
## Lancement du jeu
|
||||
|
||||
Il suffit d'exécuter `python3 main.py`.
|
||||
|
||||
## Gestion des émojis
|
||||
|
||||
Le jeu dispose de deux modes graphiques : en mode `ascii` et `squirrel`.
|
||||
Le mode `squirrel` affiche des émojis pour un meilleur affichage. Toutefois,
|
||||
il est possible que vous n'ayez pas les bonnes polices.
|
||||
|
||||
### Sous Windows
|
||||
|
||||
Sous Windows, vous devriez avoir les bonnes polices installées nativement.
|
||||
|
||||
### Sous Arch Linux
|
||||
|
||||
Il est recommandé d'utiliser le terminal `xfce4-terminal`. Il suffit d'installer
|
||||
le paquets de polices
|
||||
|
||||
```bash
|
||||
sudo pacman -Sy noto-fonts-emoji
|
||||
```
|
||||
|
||||
Le jeu doit ensuite se lancer normalement sans action supplémentaire.
|
||||
|
||||
### Sous Ubuntu/Debian
|
||||
|
||||
À nouveau, le terminal `xfce4-terminal` est recommandé. Le paquet
|
||||
`fonts-noto-color-emoji`. Toutefois, le rythme de mise à jour de Debian étant
|
||||
lent, le paquet le plus récent ne contient pas tous les émojis. Sur Debian,
|
||||
il faudra donc installer le paquet le plus récent, ce qui fonctionne sans
|
||||
dépendance supplémentaire :
|
||||
|
||||
```bash
|
||||
wget http://ftp.fr.debian.org/debian/pool/main/f/fonts-noto-color-emoji/fonts-noto-color-emoji_0~20200916-1_all.deb
|
||||
dpkg -i fonts-noto-color-emoji_0~20200916-1_all.deb
|
||||
rm fonts-noto-color-emoji_0~20200916-1_all.deb
|
||||
```
|
||||
|
||||
Il reste le problème de l'écureuil. Sous Ubuntu et Debian, le caractère écureuil
|
||||
existe déjà, mais ne s'affiche pas proprement. On peut appliquer un patch qui
|
||||
permet d'afficher les émojis correctement dans son terminal. Pour cela, il
|
||||
suffit de faire :
|
||||
|
||||
```bash
|
||||
ln -s $PWD/fix-squirrel-emojis.conf /etc/fonts/conf.avail/75-fix-squirrel-emojis.conf
|
||||
ln -s /etc/fonts/conf.avail/75-fix-squirrel-emojis.conf /etc/fonts/conf.d/75-fix-squirrel-emojis.conf
|
||||
```
|
||||
|
||||
Après redémarrage du terminal, l'écureuil devrait s'afficher correctement.
|
||||
|
||||
Pour supprimer le patch :
|
||||
|
||||
```bash
|
||||
rm /etc/fonts/conf.d/75-fix-squirrel-emojis.conf
|
||||
```
|
||||
|
118
fix-squirrel-emojis.conf
Normal file
118
fix-squirrel-emojis.conf
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
|
||||
|
||||
<!-- Add generic family -->
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
|
||||
<!-- Set as final fallback for default families -->
|
||||
|
||||
<match target="pattern">
|
||||
<test name="family"><string>sans</string></test>
|
||||
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test name="family"><string>serif</string></test>
|
||||
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test name="family"><string>sans-serif</string></test>
|
||||
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test name="family"><string>monospace</string></test>
|
||||
<edit name="family" mode="append"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
|
||||
<!-- Block Symbola from being a fallback -->
|
||||
|
||||
<selectfont>
|
||||
<rejectfont>
|
||||
<pattern>
|
||||
<patelt name="family">
|
||||
<string>Symbola</string>
|
||||
</patelt>
|
||||
</pattern>
|
||||
</rejectfont>
|
||||
</selectfont>
|
||||
|
||||
|
||||
<!-- Use this font when other popular ones are specifically requested -->
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Android Emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Apple Color Emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>EmojiSymbols</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Emoji Two</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>EmojiTwo</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Noto Color Emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Segoe UI Emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Segoe UI Symbol</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Symbola</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Twemoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Twemoji Mozilla</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>TwemojiMozilla</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>Twitter Color Emoji</string></test>
|
||||
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
|
||||
</fontconfig>
|
Loading…
Reference in New Issue
Block a user