1. 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.
    Dismiss Notice

HEX or BIN to make FONTS etc

Discussion in 'Oshonsoft' started by camerart, Dec 14, 2017.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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.
     

    Attached Files:

  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    ONLINE
    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
     
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,619
    Likes:
    697
    Location:
    Derbyshire, UK
    ONLINE
    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.
     
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,280
    Likes:
    555
    Location:
    Cleveland, OH, USA
    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
     
    • Informative Informative x 1
  10. Ian Rogers

    Ian Rogers User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,802
    Likes:
    958
    Location:
    Rochdale UK
    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..
     
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,619
    Likes:
    697
    Location:
    Derbyshire, UK
    ONLINE
    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.
     
  12. joserafa83

    joserafa83 New Member

    Joined:
    Dec 14, 2017
    Messages:
    4
    Likes:
    0

    Attached Files:

    • Thanks Thanks x 1
  13. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi I,
    Just explored your suggestion, but it is a bit too ambitious for my skills, I'm afraid.
    Thanks.
    C.
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
  15. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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.
     
  16. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    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
     

    Attached Files:

    • E.jpg
      E.jpg
      File size:
      186.4 KB
      Views:
      14
    Last edited: Dec 17, 2017
  17. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,619
    Likes:
    697
    Location:
    Derbyshire, UK
    ONLINE
    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.
     
  18. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi N,
    Too advanced for me.
    I'm filling in graph squares at the moment, then I'll try to code them.
    C
     
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    ONLINE
    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
     

    Attached Files:

  20. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    It's all slightly baffling, but I'm slowly getting it.
    I just tried a double 8x8 large font 'B' It didn't come out a B, but I can see where I went wrong (I think:confused:)
    C.
     
  21. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    The sheet on #14 is incorrect and will be updated.

    EDIT: I've clarified the sheet on #14

    C.
     
    Last edited: Dec 18, 2017
  22. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I've now added the missing BIG letters to the FONT1 on the 5110 thread.
    Thanks for all the help.
    C
     
    Last edited: Dec 17, 2017

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice