# \[Scroll pHat HD\] Is it possible to make a numbers only custom font?

**URL:** <https://forums.pimoroni.com/t/scroll-phat-hd-is-it-possible-to-make-a-numbers-only-custom-font/11238>\
**Category:** Support\
**Created:** [August 7, 2019, 2:31pm UTC](https://forums.pimoroni.com/t/scroll-phat-hd-is-it-possible-to-make-a-numbers-only-custom-font/11238 "2019-08-07T14:31:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon62494276](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@anon62494276](https://forums.pimoroni.com/u/anon62494276)\
**Post date:** [August 7, 2019, 2:31pm UTC](https://forums.pimoroni.com/t/scroll-phat-hd-is-it-possible-to-make-a-numbers-only-custom-font/11238/1 "2019-08-07T14:31:34Z")

</div>

I want to make a custom 3x11 font containing just numbers and a colon (for a clock). Is this possible, or do I need to make an entire character set? I’ve had a go with this png:

![3x11-font](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/2/2a8dec08d376493ffccc9daddd6d1b2a2b2dfdcd.png)

and this setup in _mkfont.py_:

```
FONT_FILE = "3x11-font.png"

SHEET_WIDTH = 11
SHEET_HEIGHT = 1

FONT_WIDTH = 3
FONT_HEIGHT = 11

CHAR_SPACING_X = 0
CHAR_SPACING_Y = 0
MARGIN_X = 0
MARGIN_Y = 0

CHAR_START = 0x30
CHAR_END = 0x3a

```

But all I get from _python mkfont.py \> 3x11-font.py_ is a zero-byte output file and this error:

```
Traceback (most recent call last):
  File "mkfont.py", line 110, in <module>
    font = kern_font(load_font(FONT_FILE))
  File "mkfont.py", line 73, in load_font
    font[char] = get_char_data(font_image, px, py)
  File "mkfont.py", line 57, in get_char_data
    palette_index = font_image.getpixel((o_x + x, o_y + y))
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1333, in getpixel
    return self.im.getpixel(xy)
IndexError: image index out of range

```

This is on Raspbian Buster Lite. Python Pillow is installed via pip. The mkfont.py and 3x11-font.png files are in the ~/Pimoroni/scrollphathd/tools folder. Any help appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![anon62494276](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@anon62494276](https://forums.pimoroni.com/u/anon62494276)\
**Post date:** [August 9, 2019, 9:58pm UTC](https://forums.pimoroni.com/t/scroll-phat-hd-is-it-possible-to-make-a-numbers-only-custom-font/11238/2 "2019-08-09T21:58:17Z")

</div>

Okay, so it turns out I’m a massive idiot. Somehow my brain started believing the depth of the display was 11 pixels when it was only seven pixels. I am attempting to remove my idiocy from the equation, which could very well simplify matters.
