Menu

Changing GLCD font size

MBB
2014-09-02
2021-04-14
  • MBB

    MBB - 2014-09-02

    I would like to increase or decrease the font size on a GLCD. Is this possible? What lines in glcd.h control font size?

     
  • MBB

    MBB - 2014-09-02

    Sorry, this should be in the HELP forumn

     
  • Anobium

    Anobium - 2014-09-02

    I can provide/define an alternative font. Currently, you can refined the current font set.
    Do you have a specific font and font spacing in mind?

     
  • MBB

    MBB - 2014-09-03

    Something smaller than what is available now, maybe 50% to 75% of the current font.

     
  • Anobium

    Anobium - 2014-09-04

    Have a look the video I posted recently, see https://www.youtube.com/watch?v=o8UtGoRI308. There is a little font shown, but, I do not display it! :-(

    I have a 5*5 Lucida font ready to go. This is stored in EEPROM but we could import this font to add or replace the GCB GLCD standard font - it depends what your solution is. Do you need the existing GCB font and this alternative? Do you have an eeprom attached via I2C (or could you do this?) And, it you wait a few weeks I can provide new core GCB functionality that will import fonts from external font sets.

    Let us know your view on how to proceed.

     
  • MBB

    MBB - 2014-09-04

    Great Video!

    I've built an oscilloscope using the GLCD. I want to print the time per division, trigger level, peak voltage, and other variables on the screen. Since there is so little room on the 128x64 display, I need a smaller font.

    It seems like I need the existing font and the ability to switch to a smaller font.

    What would you suggest?

     
  • Anobium

    Anobium - 2014-09-08

    I have created a method to replace the existing font. However, do you want to use more than one font?

     
  • MBB

    MBB - 2014-09-08

    Yes, I would like to be able to switch between fonts.

     
  • Anobium

    Anobium - 2014-09-09

    OK. That's tougher.

    We will need to adapt GLCDDrawChar with a drop-in replacement by redirect calls the GLCDDrawChar to an alternative method called

    myGLCDDrawChar. This can be done by adding

    #define GLCDDrawChar AltGLCDDrawChar
    

    to your code. Then, AltGLCDDrawChar we can address the second font as well as the existing font.

    So, the method. Attached . I do not want to delay you hence I am providing.

    Firstly, lets prove my approach. Here is a piece of code that enables additional fonts. However, I have not yet created the font. :-) So, this code supports use of two fonts but currently they are the same fonts.

    To address the fonts set the variable GLCDfntDefault to 0 is normal font, 1 will be the new font. This test code will redirect the current method to our new handler for multiple fonts.

    Let me know if this works - you should get the same fonts using this test but if you play with the tables (at the bottom of the code) you should be the impact. Then, we can simply define the font in GCB format.

     
  • Anobium

    Anobium - 2014-09-09

    Here goes. A working solution. I have tested and looks ok.

    My test example is below. Where GLCDfntDefault selects the font you want.

    GLCDfntDefault=1
    GLCDPrint(0,0,"Width  = ")
    GLCDPrint(48,0,objWidth)
    GLCDPrint(0,8,"Height = ")
    GLCDPrint(48,8,objHeight)
    wait 2 s
    GLCDCLS
    
    GLCDfntDefault=0
    GLCDPrint(0,0,"Width  = ")
    GLCDPrint(48,0,objWidth)
    GLCDPrint(0,8,"Height = ")
    GLCDPrint(48,8,objHeight)
    wait 1 s
    

    You need to use this new newfontsub.gcb as this contains the font definitions.

     
  • MBB

    MBB - 2014-09-10

    Thanks!

    I'll try it.

     
  • MBB

    MBB - 2014-09-10

    I tried it today. It worked GREAT! Thanks!

    Is it possible to make this part of glcd.h or a new include file?

     
  • Anobium

    Anobium - 2014-09-11

    Great. I am pleased.

    I will tidy up and get ready for inclusion in the next release.

     
  • Vecheslav

    Vecheslav - 2018-06-08

    What free font editor you can recommend ? I'm using GLCD Font Creator, but it does not work on Win 7 (64)

     

    Last edit: Vecheslav 2018-06-08
    • Anobium

      Anobium - 2018-06-08

      Depends.... what are you want to achieve?

      Remember, at the moment you have a number of fonts.
      1. Traditional Great Cow BASIC font. Scalable but gets pretty blocky at larger sizes.
      2. OLED fonts - two fonts sets.
      3. Big Fonts includling extendend font support.

      I have been discussing this site http://oleddisplay.squix.ch/#/home with the developer. The fonts here can be easily integrated into Great Cow BASIC. it will take a little development but then we have access to 100s of font styles. This could easily be achieved via a simple converter. Please do not get hung up the GLCD is a specific type on the site - this is not an issue for Great Cow BASIC.

       

      Last edit: Anobium 2018-06-08
      • Mohammed Shalash

        Hi
        What are the settings and fuctions to use BigFont on the SSD-1306 128X32 OLED?
        Thanks

         
        • Anobium

          Anobium - 2021-04-13

          Lookup in the Help

          GLCDPrintWithSize
          GLCDPrintLargeFont

           
  • Vecheslav

    Vecheslav - 2018-06-08

    Thanks, maybe my question has a simple solution!
    I'm creating a device with a screen on PCD8544, I need a 12 * 12 or 14 * 14 font, can I just do it by scaling to GCBasic?
    P.S. Sorry for bad English.

     
    • Anobium

      Anobium - 2018-06-08

      I think so. If you are have the latest build you have access to the OLED fonts on that display.

      Remember it is logically (1. Traditional Great Cow BASIC font. Scalable OR 2. OLED fonts - two fonts sets) AND 3. Big Fonts includling extendend font support.

       
  • stan cartwright

    stan cartwright - 2021-04-14

    For making a scope consider #chip LGT8F328P,32
    Very fast and 12bit sampling.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.