|
Forum Index : Microcontroller and PC projects : PiCromite load font
| Author | Message | ||||
goc30![]() Guru Joined: 12/04/2017 Location: FrancePosts: 435 |
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 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |