# Inky wHAT and python, fix fonts

**URL:** <https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005>\
**Category:** Support\
**Created:** [January 26, 2021, 6:21am UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005 "2021-01-26T06:21:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hypernova](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@hypernova](https://forums.pimoroni.com/u/hypernova)\
**Post date:** [January 26, 2021, 6:21am UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/1 "2021-01-26T06:21:53Z")

</div>

I just got an inky wHAT at MicroCenter two days ago.  
My first eink display. I’m also new at python. Actually, I know nothing about python.

So, I clicked on the github link to the inky page. I tried out the examples. They all worked as is. Although I did have to guess such as installing fonts based or error messages.

I took the quotes-what.py example and stripped it down to where it only displays some black text and some red text.

I’m having trouble here with fixed fonts. Again, I have no python background. I do not have a computer science background either. I am not a programmer.

Right now I got it to print some lines of text. Keeping it simple.

How do I get that quotes-what.py to print in fixed fonts? Any fixed font. I just want it where ‘iiii’ takes up the same space as ‘MMMM’.  
Thanks.

---

<div class="post-metadata">

**Author:** ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)\
**Post date:** [January 26, 2021, 9:00am UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/2 "2021-01-26T09:00:10Z")

</div>

Probably the easiest way to do that is to use a monospace font, they’re generally designed so that each letter is the same width.

Somewhere in your script there is likely to be a line which says something like `quote_font = ImageFont.truetype(SourceSansProSemibold, font_size)`. Try changing `SourceSansProSemibold` to `Liberation Mono`, `DejaVu Sans Mono` or `FreeMono`.

If that doesn’t work right away I’d have to dig my WHAT out and remind myself how fonts work on it.

---

<div class="post-metadata">

**Author:** ![hypernova](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@hypernova](https://forums.pimoroni.com/u/hypernova)\
**Post date:** [January 26, 2021, 1:45pm UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/3 "2021-01-26T13:45:18Z")

</div>

How? I do not know where to begin.  
There is a line like that, but FreeMono does not work.

---

<div class="post-metadata">

**Author:** ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)\
**Post date:** [January 26, 2021, 2:08pm UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/4 "2021-01-26T14:08:29Z")

</div>

> There is a line like that, but FreeMono does not work.

So when things fail in Python it should give an error message, and it’s really helpful to know what these are when trying to find out the issue. Could you copy and paste it here?

It _should_ have been as simple as replacing the text `SourceSansProSemibold` with `FreeMono`. If I get time later this evening I’ll double check a few things.

---

<div class="post-metadata">

**Author:** ![hypernova](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@hypernova](https://forums.pimoroni.com/u/hypernova)\
**Post date:** [January 26, 2021, 2:19pm UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/5 "2021-01-26T14:19:21Z")

</div>

Here is the output. And yes, I did try to install it with pip/3. And yes, I did try to google how to install fonts.

pi ./text.py Traceback (most recent call last): File "./text.py", line 18, in \<module\> import FreeMono ModuleNotFoundError: No module named 'FreeMono' pi ./text.py  
Traceback (most recent call last):  
File “./text.py”, line 18, in   
import DejaVuSansMono  
ModuleNotFoundError: No module named ‘DejaVuSansMono’

---

<div class="post-metadata">

**Author:** ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)\
**Post date:** [January 26, 2021, 8:11pm UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/6 "2021-01-26T20:11:12Z")

</div>

Ah, sorry, I missed something obvious. You need to wrap the font name in quotes, so `"FreeMono"`, not `FreeMono`.

I’ve taken a quick skim through Pi OS fonts, and the monos which you should be able to use are:

DejaVuSansMono.  
LiberationMono-Bold  
VeraMoBI  
NotoSansMono-Regular  
FreeMonoBoldOblique  
LiberationMono-BoldItalic  
LiberationMono-Bold  
LiberationMono-Italic  
VeraMoBd  
LiberationMono-Regular  
LiberationMono-BoldItalic  
DejaVuSansMono-Oblique  
DejaVuSansMono-BoldOblique  
LiberationMono-Regular  
DejaVuSansMono-Bold  
DejaVuSansMono-BoldOblique  
FreeMonoObliqueDejaVuSansMono-Oblique  
DejaVuSansMono-Bold  
LiberationMono-Italic  
VeraMono  
VeraMoIte  
NotoSansMono-Bold  
NotoMono-Regular  
FreeMono  
DejaVuSansMono  
FreeMonoBold

Use any of these in the same way, just wrap it in quotation marks.

---

<div class="post-metadata">

**Author:** ![hypernova](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@hypernova](https://forums.pimoroni.com/u/hypernova)\
**Post date:** [January 26, 2021, 10:18pm UTC](https://forums.pimoroni.com/t/inky-what-and-python-fix-fonts/16005/7 "2021-01-26T22:18:51Z")

</div>

Thank you. that works.
