Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HEX or BIN to make FONTS etc

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
I'm about to make some fonts for LCD programs.
In the code I'm following, HEX is used in the program to draw the pixels in each letter square matrix, to make up the letter.
For me I would need to look at each line to see which bits are used, then use a look up chart to convert to HEX. I would prefer to use 1s and 0s in a BIN number i.e. %10101010 to draw.
Is there a reason for using HEX over BIN?
Camerart.
 

Attachments

  • HEX or BIN.jpg
    HEX or BIN.jpg
    29.7 KB · Views: 401
hi C,
If you find Bin easier to convert than Hex, I would use it.
You could use Paint Shop to type the text with the Grid lines enabled, the rotate the image by 90 deg for the Bin pattern

E
A001.gif
 
As Eric says, it makes no difference which you use, if binary is easier for you, then use that.

However, have you tried using GLCD Font Creator from MikroElektronika? - makes it easy for you.
 
hi C,
If you find Bin easier to convert than Hex, I would use it.
You could use Paint Shop to type the text with the Grid lines enabled, the rotate the image by 90 deg for the Bin pattern

E
View attachment 109655
Hi E,
Just checking before I get into it, that there aren't any programing reasons, as there aren't I'll start.
Thanks.
C.
 
As Eric says, it makes no difference which you use, if binary is easier for you, then use that.

However, have you tried using GLCD Font Creator from MikroElektronika? - makes it easy for you.
Hi N,
Installed it (I hope it's safe:eek:)
Actually it looks a bit to good fun really, I may just keep playing.
Thanks,
C.
 
Hi,
As a matter of interest, for those who use HEX. Do you know the shape of each line off by heart, or do you use a look up charts, or what other method? This is in regard not just to fonts, but general programming.
C.
 
When I made some large fonts, I did it manually in graph paper. Wrote the results in binary and converted as I coded. I found doing it manually was was easier in binary. The conversion is a non-issue.

Before resorting to the graphical method, I tried some of the online tools and for whatever reason (that was circa 2013), I didn't like them. I guess it may depend on how many characters you intend to make. For some, I just needed the numbers, and a few characters like degree and slash.

As for your last post, conversion to hex becomes basically by inspection. I write my binary as either xxxx|xxxx or xxxx xxxx
 
There really is no need.... I have found 8x8 ~ 32x32 fonts on the web... Just look for the KS0108 fonts

https://code.google.com/archive/p/u8glib/downloads

On here there is a font convertor.. A tad difficult to use as its command line only.. But It works..

Also in ANY of the libraries you'll find U8G_font_data. C Yes I know its C but all the bitmaps are there..
 
Hi,
As a matter of interest, for those who use HEX. Do you know the shape of each line off by heart, or do you use a look up charts, or what other method? This is in regard not just to fonts, but general programming.
C.

I tend to know the patterns, I've been using HEX for a great many years, as it's 'more obvious' than binary - I just use binary when there's a specific advantage in doing so.
 
There really is no need.... I have found 8x8 ~ 32x32 fonts on the web... Just look for the KS0108 fonts

https://code.google.com/archive/p/u8glib/downloads

On here there is a font convertor.. A tad difficult to use as its command line only.. But It works..

Also in ANY of the libraries you'll find U8G_font_data. C Yes I know its C but all the bitmaps are there..
Hi I,
Just explored your suggestion, but it is a bit too ambitious for my skills, I'm afraid.
Thanks.
C.
 
I tend to know the patterns, I've been using HEX for a great many years, as it's 'more obvious' than binary - I just use binary when there's a specific advantage in doing so.
Hi N,
I guessed that some of you know the shape of a HEX file in BIN form. I have a look up sheet, and I can sometimes guess, but I'm not programming enough to remember stuff like that.
C.
 
Hi,
I've looked at the data sheet for the 5110 LCD, but it would take me a long time before I could understand how it works, although I can almost get it. One thing, is there are references to 8x8 and 5x8, which is baffling.
I've been puzzling over Eric's FONTs. Here is a sheet to illustrate the difference between how the Small and BIG FONTS are produced:

C
 

Attachments

  • E.jpg
    E.jpg
    186.4 KB · Views: 418
Last edited:
Because I had a specific reason to do so, I wrote a routine that splits the font across two 'lines' on the display, this gave a nice effect on the application I did it for.
 
Because I had a specific reason to do so, I wrote a routine that splits the font across two 'lines' on the display, this gave a nice effect on the application I did it for.
Hi N,
Too advanced for me.
I'm filling in graph squares at the moment, then I'll try to code them.
C
 
hi C,
Does this help with your query.? ref image.
My font table for characters bigger than 5*7 also uses two lines.

My character display procedure uses a 'row' value to select the required font section, 5110 LCD
for a 16 bit high character rows are selected as 0,1,2,3,4,5.
rows 0,2,4 are on the top line row
and rows 1,3,5 are the lower line row.

example:

big2lcd:
SPICSOn
lcd_mode = 1 'data

Select Case ascval
Case "0"
If row = 0 Or row = 2 Or row = 4 Then
SPISend 0xfe
SPISend 0xff
SPISend 0x83
SPISend 0xc3
SPISend 0x63
SPISend 0x33
SPISend 0xff
SPISend 0xfe
Endif

If row = 1 Or row = 3 Or row = 5 Then
SPISend 0x1f
SPISend 0x3f
SPISend 0x31
SPISend 0x30
SPISend 0x30
SPISend 0x30
SPISend 0x3f
SPISend 0x1f
Endif
 

Attachments

  • A001.png
    A001.png
    39.1 KB · Views: 347
Hi,
The sheet on #14 is incorrect and will be updated.

EDIT: I've clarified the sheet on #14

C.
 
Last edited:
Hi,
I've now added the missing BIG letters to the FONT1 on the 5110 thread.
Thanks for all the help.
C
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top