Shop OBEX P1 Docs P2 Docs Learn Events
Using the internal character ROM for generating characters on an 5x7 dot matrix — Parallax Forums

Using the internal character ROM for generating characters on an 5x7 dot matrix

godzichgodzich Posts: 74
edited 2008-09-11 20:26 in Propeller 1
Hi all,

Still new with Propeller, and just planning what to do with it, so please be patient.

Could I use the internal character generator easily for generating the ascii· alphabet when driving an external display consisting of 8 pcs of 5x7 dot matrix displays? It means that the character need to be read and compressed somehow neatly, to produce legitime and good looking characters on the limited 5x7 matrix. Or should I bother trying this at all, and just write my own character table, wasting precious ram? I assume that a "compacting" assembly routine would not need many words of storage, if coded cleverly?!

Any comments? Has anyone done this before?

Christian

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The future does not exist - we must invent it!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-10 18:35
    Theoretically you could do it.· The internal font tables are for a 16 x 32 pixel character cell and look good at 16 x 16.· You could do some averaging approximately 3x horizontally and 4x vertically, but it probably won't look good.· You're much better off using a 5 x 7 font table.· There are all kinds of ways to store this depending on whether you need the rows or the columns and how fast you need them.· For normal ASCII text, you need 128 characters.· That would take·640 bytes to store as one byte per column·or 896 bytes with one byte per row.

    If you're clever, you may be able to use only 32 bits to store 35 pixels by finding adjacent pixels that are always the same or pixels that are always zero or always one.· That would be one long per character ... really easy to look up and only 512 bytes.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-10 18:38
    I'd start from scratch or look for a 5x7 font on the internet. Such a font won't take up much memory and will look a whole lot better. The problem with compressing a finer-resolution font is that there really isn't an algorithm that will yield something that looks good without some hand tweaking. And the eye is very sensitive to minor imperfections.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • lonesocklonesock Posts: 917
    edited 2008-09-10 19:27
    I just made my own font for 5x6 (that way I could fit each char into a long for easy access). I'm using it for a ST7565P display driver chip, so I encoded each glyph via vertical slices into a long, with the least significant 2 bits holding a number 0..3 which mapped to 2..5 vertical slices to be rendered in that glyph. You can play with it via the excellent Fony font editor. Public domain, hope it helps, etc. Let me know if you would like the C++ code to build up the glyphs into longs in PASM, and or the actual SPIN files. You can also truncate the range if you don't need lower-case letters, etc., to save RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
    470 x 6 - 1K
  • godzichgodzich Posts: 74
    edited 2008-09-10 20:44
    Wow,

    Such a nice forum, so many replies in no time [noparse]:)[/noparse]

    Thank's for the input. I still would like to have a look at using the internal font table.

    Is there somewhere a downloadable file that contains the exact shapes of the fonts, in hex or binary - or any format???

    I could easily simulate how a compressed would look like - only the font table is missing... [noparse]:([/noparse]

    Probably I could dump it from the propeller chip, but someone of you might have the file laying around [noparse]:)[/noparse]



    Cheers



    Christian

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The future does not exist - we must invent it!
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-09-10 21:57
    I have an object on the exchange for driving a ks0108 chip that has a 5x7 font you may want to look at. I tried about 20 different ways to crunch the built in rom and I gave up because for example the I and t and a number of the letters don't line up on the same line and so will be off center when crunched. I have one that crunches it to a 9 or 10x16 that looks ok.
  • VIRANDVIRAND Posts: 656
    edited 2008-09-11 20:26
    This is my favorite example of squeezing the Propeller font onto an LCD. Not 5x7 but maybe could be:
    CLEMENS SECRET HIDDEN FONTS

    Common old fashioned dot matrix 5x7 font can be squeezed into 5x5 (long) since (except in lowercase),
    pixel rows 2,3 and 5,6 are usually identical. For lowercase, I use the alphabet still compressed (5x5).
Sign In or Register to comment.