pte.py

Created by squarepoint

Created on April 13, 2023

616 Bytes

Renders numbers using a 4x7 matrix. I’ll probably add more characters soon


#4x7 text engine
from kandinsky import fill_rect as rct
from math import floor

D=["0110100110011001100110010110","0010011000100010001000100010","0110100100010010010010001111","0110100100010110000110010110","0010011010101111001000100010","1111100010001110000100011110","0110100110001110100110010110","1111000100010010001001000100","0110100110010110100110010110","0110100110010111000110010110"]

def write(t,x,y,s,c):
  for i in range(len(t)):
    for j in range(len(D[int(t[i])])):
      if D[int(t[i])][j]=="1":
        rct(x+(j%4)*s,y+floor(j/4)*s,s,s,c)
    x+=5*s

write("0123456789",35,70,5,(0,0,0))

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.