Les différentes polices sont testées avec l'échantillon suivant :
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.:,;(){}[]<>|^/*!?`'"@#$%&_-+=~ àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ The quick brown fox jumps over the lazy dog == === != !== >= <= -> <=> => 0O 1l B8 <> [] {} 2N2N2N2N public function getElementValue(array $collection, string $index): ?int { /** Comment #1 */ if (empty($collection)) { return null; } // Comment #2 foreach ($collection as $key => $element) { if ($key < $index || $key > $index) { echo 'Index does not match key', PHP_EOL; continue; } return $element->value(); } }
Quand on travaille de nombreuses heures sur du code, il est important de mettre toutes les chances de son coté pour se faciliter la vie. Ça commence pas l'utilisation d'une police appropriée qui évitera les confusions et améliorera la lisibilité.
Avec une mauvaise police, il y a des risques de mauvaise lecture du code, par exemple en confondant :
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'“@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
public function getElementValue(array $collection, string $index): ?int { /** Comment #1 */ if (empty($collection)) { return null; } // Comment #2 foreach ($collection as $key => $element) { if ($key < $index || $key > $index) { echo 'Index does not match key', PHP_EOL; continue; } return $element->value(); } }
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'”@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
public function getElementValue(array $collection, string $index): ?int { /** Comment #1 */ if (empty($collection)) { return null; } // Comment #2 foreach ($collection as $key => $element) { if ($key < $index || $key > $index) { echo 'Index does not match key', PHP_EOL; continue; } return $element->value(); } }
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'“@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
public function getElementValue(array $collection, string $index): ?int { /** Comment #1 */ if (empty($collection)) { return null; } // Comment #2 foreach ($collection as $key => $element) { if ($key < $index || $key > $index) { echo 'Index does not match key', PHP_EOL; continue; } return $element->value(); } }
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'”@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
public function getElementValue(array $collection, string $index): ?int { /** Comment #1 */ if (empty($collection)) { return null; } // Comment #2 foreach ($collection as $key => $element) { if ($key < $index || $key > $index) { echo 'Index does not match key', PHP_EOL; continue; } return $element->value(); } }
Il existe des milliers de polices, mais celles-ci sont celles que j'utilise d'une manière où d'une autre.
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'“@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'”@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'“@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'”@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'“@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789.:,;(){}[]<>|^/*!?`'”@#$%&_-+=~
àÀâÂçÇéÉèÈêÊëËîÎïÏôÔùÙûÛüÜæÆœŒ
The quick brown fox jumps over the lazy dog
== === != !== >= <= -> <=> =>
0O 1l B8 <> [] {} 2N2N2N2N
Si les polices sont disponibles dans les dépôts, il est recommandé d'utiliser le gestionnaire de paquet pour les installer.
Sinon il faut copier les fichiers dans le répertoire ~/.local/share/fonts
et de regénérer les informations de cache des polices avec la commande suivante :
fc-cache --force --verbose
Pour visualiser les polices disponibles sur mon système, j'utilise gnome-font-viewer.
Il affichera l'ensemble des polices disponibles pour l'utilisateur.
Celles-ci sont situées soit dans /usr/share/fonts
soit dans ~/.local/share/fonts
.
Fira Code
,editor.fontLigatures
avec la valeur true
.Voir Dokuwiki.