Displaying font, Array of Chars (help?)

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I have been searching for many hours looking for a font set, sizes 8x8,5x7, 7x7.

I know 5x7 is a standard for many small LCD displays.

I did find some but they are in this type of format,

0xFF,0x01,0x01,0x01,0x03 (This makes 'L')

Each byte corresponds to a vertical line of bits for the character. Each bit is a segment of a char.

The format am looking for is

0x80,
0x80,
0x80,
0x80,
0x80,
0x88,
0xF8, (this also makes 'L')

Where each byte corresponds to a horizontal line of bits for the character.

To be honest I would have used the first format as it does not waste screen space (3bits/3segments)(5/8 bits in byte is used for character)

However I do not know how to access this in a horizontal manner.

Only read the first line in this ----> direction.

Ideally I would have a string of characters and then based on the char, it would return the appropriate bit value.

If I wasn't clear please say so, Also any recommendation on font size?

Last Edited: Sun. Mar 31, 2013 - 09:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Write your own. It isn't that hard. Surely less than "many hours."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would if I could, I tried and failed to draw with any detail.

Also I have a fixed grid and therefore not sure where some characters are best placed.

Any input on how to access bytes of array in the fashion explained above?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
However I do not know how to access this in a horizontal manner.
The same way as you would access it in a vertical manner? This is my lookup table for L and M for my displays
;L M
.db	0x01,0x01,0x01,0x01,0x01,0x01,0x1F, 0x11,0x1B,0x15,0x15,0x11,0x11,0x11


; |012345|
;-|------|
;0|  *   |lsb
;1| **   |
;2|  *   |
;3|  *   |
;4|  *   |
;5|  *   |
;6| ***  |MSB
;-|------|-------|-------|----------------
;               0   1   2   3   4   5   6
;---------------------------------------------

You simply read 1 byte and send it out then the next byte when you are showing the next line down etc.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

linux fb

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
Quote:
However I do not know how to access this in a horizontal manner.
The same way as you would access it in a vertical manner? This is my lookup table for L and M for my displays
;L M
.db	0x01,0x01,0x01,0x01,0x01,0x01,0x1F, 0x11,0x1B,0x15,0x15,0x11,0x11,0x11


; |012345|
;-|------|
;0|  *   |lsb
;1| **   |
;2|  *   |
;3|  *   |
;4|  *   |
;5|  *   |
;6| ***  |MSB
;-|------|-------|-------|----------------
;               0   1   2   3   4   5   6
;---------------------------------------------

You simply read 1 byte and send it out then the next byte when you are showing the next line down etc.

You L is inverted.

Anyway what I want to do is read the first bit of every byte of the character.

So if my character is:
0xFF,0x01,0x01,0x01,0x03 (This makes 'L')

I want to read the first bit of each byte shown above and then continue to next char. When the first line is draw the second line will be done by reading the 2nd bit of each byte above.
That is how i Would access it.

But what if I had several characters in this format, how would I be able to output each bit based on string of characters.

stringofchars[character[byte[bit]]] I know it makes no sense.

That's why am asking for help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are making life hard for yourself.

Unless you want to do some fancy graphics with each letter then grab the whole byte.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am reading the byte from the array but use bit modulation to get the first MSB of the byte, this is then output to a LED.

The next byte also is read but bit modified to find the MSB bit, then out put to a LED.

This will occur 5 times if the width of the font is 5.

It will do this for all the chars in the string.
Once the first line is complete.

The next line will be started, first byte is read from array, The next significant bit will be shown.

[code]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
0b10000000,    //0x80,
0b10000000,    //0x80,
0b10000000,    //0x80,
0b10000000,    //0x80,
0b10000000,    //0x80,
0b10001000,    //0x88,
0b11111000,    //0xF8, (this also makes 'L')

You can convert any format font to your preferred style. Just write your own PC program. Or a commercial font editing program.

Look at CodeVision's LCD Vision evaluation program. It generates both raster and vertical tables.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hope you are using a supercomputer to do all the necessary ANDING, ORING and possibly bit shifting of bits for each bit you send out.

Seeing that you can only write 8 bits at a time this will be necessary.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly