Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:25 10 May 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 : Micro-font

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 08:58am 21 Feb 2019
Copy link to clipboard 
Print this post



with thanks to the originator

' tinyfont.bas
' Font type : Full (96 characters)
' Font size : 4x6 pixels
' Memory usage : 292 bytes

DefineFont #8
60200604 44000000 00A04040 A0AEAE00 82406C6C EACC2048 00004460 84204424
E4A48044 00E404A0 00800400 040000E0 00480240 44E0AAEA E8E24044 E062E2E0
E820E2AA EAE8E0E2 2022E2E0 EAE0EAEA 0404E0E2 80040400 0E208424 2484000E
4040E280 4A60E84A CACAA0EA 608868C0 E8C0AACA E8E8E0E8 60EA6880 E4A0EAAA
2A22E044 A0CAAA40 AEE08888 EEAEA0EA 40AA4AA0 4A80C8CA ECCA60AE C04268A0
AA4044E4 A4AA60AA A0EEAA40 AAA04AAA 48E24044 E088E8E0 E2004208 004AE022
F0000000 0C000084 AA8CE06A 608806C0 0660AA26 E42460AC 24AE0640 04A0CA88
02024004 A0CC8AA4 00E044C4 CA00A0EE 40AA04A0 06C8AA0C 880662AA C0C60680
0A60444E AE0A60AA E0AE0A40 0AA0440A 6C0E24A6 608464E0 C4400444 006CC024
E0EEEE00
End DefineFont
Edited by matherp 2019-02-22
 
viscomjim
Guru

Joined: 08/01/2014
Location: United States
Posts: 925
Posted: 10:01am 21 Feb 2019
Copy link to clipboard 
Print this post

Holy cow that's small, however, strangely readable like a dot matrix printer font. Nice...
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 10:33am 21 Feb 2019
Copy link to clipboard 
Print this post

Minor fixes to "ijmn". I input the font by hand using TassyJim's excellent FontTweak

' tinyfont.bas
' Font type : Full (96 characters)
' Font size : 4x6 pixels
' Memory usage : 292 bytes

DefineFont #8
60200604 44000000 00A04040 A0AEAE00 82406C6C EACC2048 00004460 84204424
E4A48044 00E404A0 00800400 040000E0 00480240 4CE0AAEA 48C24044 C062C2E0
E820E2AA EA68E0E2 8048E2E0 EAE0EAEA 0404C0E2 80040400 0E208424 2484000E
4040E280 4A60E84A CACAA0EA 608868C0 E8C0AACA E8E8E0E8 60EA6880 E4A0EAAA
2A22E044 A0CAAA40 AEE08888 EEAEA0EA 40AA4AA0 4A80C8CA ECCA60AE C04268A0
AA4044E4 A4AA60AA A0EEAA40 AAA04AAA 48E24044 E088E8E0 E2004208 004AE022
F0000000 0C000084 AA8CE06A 608806C0 0660AA26 E42460AC 24AE0640 40A0CA88
22204044 A0CC8AA4 0EE044C4 AA0CA0EE 40AA04A0 06C8AA0C 880662AA C0C60680
0A60444E AE0A60AA E0AE0A40 0AA0440A 6C0E24A6 608464E0 C4400444 006CC024
E0EEEE00
End DefineFont
Edited by matherp 2019-02-23
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 02:08am 22 Feb 2019
Copy link to clipboard 
Print this post

Just because I had a 2.4" ILI9341 handy on an h7-144 backpack, here is this font on that display:



and with the Sinclair_S 8x8 font (from http://rinkydinkelectronics.com):



Compared:



The Sinclair_S font:
[code]
' Sinclair_S.bas
' Font type : Full (95 characters)
' Font size : 8x8 pixels
' Memory usage : 764 bytes
DefineFont #8
5F200808 00000000 00000000 08080808 00080008 00001414 00000000 247E2400
00247E24 7C507C10 00107C14 08646200 00462610 10281000 003A442A 00100800
00000000 10100800 00081010 08081000 00100808 10280000 0028107C 10100000
0010107C 00000000 10080800 00000000 0000007C 00000000 00181800 08040000
00402010 948C7800 0078C4A4 20A06000 00F82020 04847800 00FC8078 18847800
00788404 50301000 0010FC90 F880FC00 00788404 F8807800 00788484 0804FC00
00202010 78847800 00788484 84847800 0078047C 10000000 00100000 00100000
20101000 10080000 00081020 7C000000 00007C00 10200000 00201008 04423C00
00080008 564A3C00 003C405E 84847800 008484FC F884F800 00F88484 80847800
00788480 8488F000 00F08884 F880FC00 00FC8080 F880FC00 00808080 80847800
0078849C FC848400 00848484 10107C00 007C1010 04040400 00788484 E0908800
00848890 80808000 00FC8080 B4CC8400 00848484 A4C48400 00848C94 84847800
00788484 8484F800 008080F8 84847800 007894A4 8484F800 008488F8 78807800
00788404 1010FE00 00101010 84848400 00788484 84848400 00304884 84848400
0048B484 30488400 00844830 28448200 00101010 1008FC00 00FC4020 20203800
00382020 20400000 00040810 08083800 00380808 54381000 00101010 00000000
FE000000 A199423C 3C4299A1 04380000 003C443C 78404000 00784444 201C0000
001C2020 3C040400 003C4444 44380000 003C4078 18100C00 00101010 423E0000
3C023E42 78404000 00444444 18000800 001C0808 04000400 18240404 60504000
00485060 10101000 000C1010 54680000 00545454 44780000 00444444 44380000
00384444 44780000 40407844 443C0000 06043C44 201C0000 00202020 40380000
00780438 10381000 000C1010 44440000 00384444 44440000 00102828 54440000
00285454 28440000 00442810 44440000 38043C44 087C0000 007C2010 60101C00
001C1010 10101000 00101010 0C107000 00701010 00281400 00000000
End DefineFont
[/code]
The display layout was designed for the Sinclair_S font--this layout is just used for comparison because it was handy.
Edited by lizby 2019-02-23
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3269
Posted: 05:55am 22 Feb 2019
Copy link to clipboard 
Print this post

You would need VERY small fingers to use that screen.
Geoff Graham - http://geoffg.net
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 08:47am 22 Feb 2019
Copy link to clipboard 
Print this post

  Quote  The display layout was designed for the Sinclair_S font--this layout is just used for comparison because it was handy.


Try FONT 7 on the H7 or the loadable font below (same thing). 6x8 and much nicer than the square font. The rinkydinkelectronics fonts are all limited by being n*8 wide but Geoff's code in the Micromite only limits them such that h*w is divisible by 8

DefineFont #8
5C200806
00000000 82200000 00800008 00004551 4F510000 0045F994 2B1CEA21 690000C2
B04C2090 AA104A62 84608046 00000000 40108410 81400081 00841004 A89C8A00
82000080 0080203E 30000000 00000042 0000003E 01000000 21000086 00004208
CAAA2972 82210027 00872008 21842072 42F8800F 00270A04 F824C510 0FFA0041
00270A02 8A3C0831 21F80027 00044108 8A9C2872 28720027 0027089E 61008601
86010080 00846000 40208410 0F000081 0000F880 10028140 20720084 00022084
BA9A2072 28720027 8028FAA2 8ABC28F2 2872002F 00278220 8AA248E2 08FA004E
800F823C 823C08FA 28720008 80278A2E 8ABE288A 82708028 00872008 12044138
4A8A0046 8048A230 82200882 6A8B800F 80288AAA 9AAA2C8A 28728028 00278AA2
82BC28F2 28720008 8046AAA2 A2BC28F2 087A8048 002F081C 200882F8 288A0082
00278AA2 89A2288A 288A0042 00A5AAAA 5208258A 288A8028 00822094 420821F8
0471800F 00074110 A9944AA9 4170804A 00471004 00804821 00000000 800F0000
00008140 07000000 80277A02 8A320B82 0700002F 00278220 8AA62608 07008027
0007FA22 41382431 E8010004 002778A2 8A320B82 06208028 00872008 12040310
09820046 0089C228 20088260 0D000087 8028AA2A 8A320B00 07008028 00278A22
F2220F00 06000008 802078A6 82320B00 07000008 002F7020 41100E41 08000023
80668AA2 89A20800 08000042 00A5AAA2 21940800 08008048 002778A2 21840F00
0400800F 0EE24028
End DefineFont
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 04:11pm 22 Feb 2019
Copy link to clipboard 
Print this post

  matherp said  Try FONT 7 on the H7 or the loadable font below

Thanks. That's a nice-looking font:



  Geoffg said  You would need VERY small fingers to use that screen.

Stylus only, shown above screen (though nothing actually interactive on this screen). No fingers need be applied.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 04:39pm 22 Feb 2019
Copy link to clipboard 
Print this post

Is there any font which contains the PC line graphic characters, Code Page 437 shown here: https://en.wikipedia.org/wiki/Code_page_437

This is characters 0xB3 throubh 0xDA.

Or, if not, how would one go about building such a font? For my purposes, the characters could occupy the lower-case slots, 0x60-0x7f.

I guess these are also known as VT100 "box drawing" characters.Edited by lizby 2019-02-24
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6219
Posted: 07:53pm 22 Feb 2019
Copy link to clipboard 
Print this post

  lizby said  
Or, if not, how would one go about building such a font?


2019-02-23_055237_FontTweak.zip
3 years old but still works.
I probably should re-visit it sometime.

Jim
VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 09:44pm 22 Feb 2019
Copy link to clipboard 
Print this post

'Thanks, Jim. I had found and have read that thread. Now I'm looking for a pixel representation of those characters to give me a start.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6219
Posted: 02:41am 23 Feb 2019
Copy link to clipboard 
Print this post

There should be a copy somewhere on the net but the best I can offer is a PDF and TIFF taken from a Brother printer manual.
2019-02-23_124050_scanner.zip

Jim

VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 02:59am 23 Feb 2019
Copy link to clipboard 
Print this post

Thanks, Jim. Could be useful as the basis for a 6x12 font, but they aren't the same as the PC line graphics code page 437 characters.

I've done a fair amount of searching and have not yet found a pixel representation.

I have a question about the coding of the first 8 hex values of the font definition. For instance, with "5C200806" it's clear that the last 4 say that it's a 8x6 font, but what does "5C20" stand for?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6219
Posted: 06:12am 23 Feb 2019
Copy link to clipboard 
Print this post


The first hex number is
Number of characters
ASCII value of the first character
Font height
Font width

So
5C = 92 characters
20 = starting with 'space'
08 = 8 pixels high
06 = 6 pixels wide


VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6219
Posted: 07:02am 23 Feb 2019
Copy link to clipboard 
Print this post

OK
I found this website
https://int10h.org/oldschool-pc-fonts/
which has a lot of various version of the IBM font.
This website
http://hukka.ncn.fi/?fony
Has a nice looking font program that can read the FON files and export them as binary files.
Given time, I can extract the data from the binary files.

There are a number of IBM font sizes.
What size are you interested in?

Jim

VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 02:22pm 23 Feb 2019
Copy link to clipboard 
Print this post

  TassyJim said  
The first hex number is
Number of characters
ASCII value of the first character
Font height
Font width

I figured that out in the middle of the night, after awakening and wondering what 5C was in decimal. Then it was clear what 20 would be. Funny, that--it's been that way with me since high school--I'd go to sleep mulling over a problem and sometime before I got up the answer came to me.

Thanks for those links--I'll check them out. But I may end up just making my own. I also realized overnight that for 8x8 fonts, horizontal lines (doubled pixel rows in the center), would just be [STRIKE]000000ff ff000000[/STRIKE] ff000000 000000ff, and vertical would be 18181818 1818181818, and corners and up/down/right/left tics would be pretty simple variations. 8x8 could then be scaled, either to define a new font or with the text command scaling parameter. (This may seem silly when real graphics are available, but I have a particular use.)

Sorry for hijacking this thread. I can only hope that it's helpful from time to time for relative newcomers to be able to see examples of the work which has been done in the past on mmbasic.
Edited by lizby 2019-02-25
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 03:49pm 23 Feb 2019
Copy link to clipboard 
Print this post

  lizby said  
Sorry for hijacking this thread. I can only hope that it's helpful from time to time for relative newcomers to be able to see examples of the work which has been done in the past on mmbasic.


I'd like to see what you come up with if you are willing to share.
Micromites and Maximites! - Beginning Maximite
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 06:24pm 24 Mar 2019
Copy link to clipboard 
Print this post

Here is a Nokia 5110 lcd with the tiny font (font 3 in the L4 distro for the N5110):



The screen shot in the original post of this thread has the letters inverted. How do you do this with the TEXT command with a monochrome font?

[code]
' option LCDPanel N5110,L,11,10,9,&HC0 ' L432
option default integer
dim string A

nRows=8 ' 12 for ILI9341
j=mm.vres/nRows ' row height for 8|12 rows
jj=mm.hres/12 ' horizontal divisions
fnt=3
cls
font fnt
A=mid$(date$,4,2)+"-"+mid$(date$,1,2)+" "+mid$(time$,1,5)
text 0,0,A+" AUTO UTIL"

for i=1 to 7 : text 0,i*j,"rly"+str$(i) : next i
for i=1 to 7 : text 5*mm.fontwidth,i*j,"tmp"+str$(i)+" "+str$(58+i) : next i

for i=1 to 2 : text 14*mm.fontwidth,i*j,"tmp"+str$(i+7)+" "+str$(67-i) : next i
for i=3 to 5 : text 14*mm.fontwidth,i*j,"tp"+str$(i+7)+" "+str$(67-i) : next i
for i=1 to 2 : text 14*mm.fontwidth,(i+5)*j,"flo"+str$(i)+" 68": next i
[/code]
Edited by lizby 2019-03-26
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10066
Posted: 07:37pm 24 Mar 2019
Copy link to clipboard 
Print this post

  Quote  The screen shot in the original post of this thread has the letters inverted. How do you do this with the TEXT command with a monochrome font?


New section from the manual:

  Quote  Monochrome displays
Monochrome displays can have two "colours" zero and not-zero. All displays default such that zero is the natural colour of the display. In the case an OLED this is not-lit. (i.e. black) and non-zero will be the lit colour (normally white, blue, or yellow for OLEDs). In the case of a Nokia 5110 display, zero is the backlight colour and non-zero is black.
All monochrome displays can be used inverted by clearing the display to non-zero e.g. "CLS 1" and then setting 0 as the foreground colour in any graphics commands. The only issue with this is that displays typically have non-functional borders which will remain the native "zero" colour so graphics or text that touches the outside of the active area will merge into the border.
All monochrome displays have a memory based frame-buffer which is created when the display is initialised. This will have a small impact on the amount of available RAM for program use (RAM used is width-in-pixels * height-in-pixels / 8 + 256 bytes). Using a frame-buffer gives two significant advantages:

1. Monochrome displays can be powered down to save power and then when power is returned the command “GUI RESET LCDPANEL” will not only re-initialise the display hardware but also restore the display contents
2. Updates to the display can be suspended by issuing the command “OPTION AUTOREFRESH OFF”. In this mode drawing and text commands update the framebuffer but not the display. Issuing the command “REFRESH” will write the contents of the framebuffer to the display. This allows complex updates to be made without obvious screen writes being visible. The area written is the smallest rectangle containing all the changes since the last “REFRESH” command”.
Edited by matherp 2019-03-26
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3309
Posted: 08:28pm 24 Mar 2019
Copy link to clipboard 
Print this post

Thanks. That might seem to imply that 0,1 as foreground and background in the TEXT command would inverse the monochrome text, and indeed it does:

This produces the inverted text in the first column:

for i=1 to 7 : text 0,i*j,"rly"+str$(i),,,,0,1 : next i

Leaving out ",,,,0,1" results in normal black on white.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
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