Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:45 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PiCromite load font

Author Message
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 03:20am 18 Feb 2019
Copy link to clipboard 
Print this post

It's for fun!
you know that in PiCromite we can't load fonts. but I found a solution using the "SPRITE" functions

here it is an exemple of use


Option explicit
Const fntx=36
Const fnty=64
Dim txlcd As string
Dim valuelcd As integer

Dim i As integer
Dim i1 As integer

Dim j1 As integer
Dim j2 As integer
Dim j As integer
Dim txt As string
Dim txt1$ As string
Dim txt2$ As string
Dim a$ As string
Dim b$ As string
Dim nbcar As integer
Dim posx As integer
Dim posy As integer

CLS

For i=0 To 12
txt2$="fnt"+Str$(i,2,0,"0")
SPRITE load i+1,txt2$
Next i

Do 'test with time
txt1$=Time$
prld(txt1$,10,100)
Pause(100)
Loop

Sub prld(t1$ As string,x1 As integer, y1 As integer)
j=Len(t1$)
posx=x1
posy=y1
For i=1 To j
a$=Mid$(t1$,i,1)
j1=12 'espace
If a$=":" Then j1=10
If a$="." Then j1=11
If (a$=>"0" And a$<="9") Then j1=Asc(a$)-Asc("0")
j2=j1+1
SPRITE write j2,posx,posy ',1,0
posx=posx+fntx+4
Next i
End Sub



zip file with font
2019-02-18_132031_test_fntlcd.zip
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025