Menu

SSD1306 ASCII character symbols

Haroen
2022-12-07
2023-01-18
1 2 3 4 > >> (Page 1 of 4)
  • Haroen

    Haroen - 2022-12-07

    Hi,
    I wanted to try out some gcb codes to drive some types of displays.
    I started with the ssd1306 and soon discovered that it doesn't contain a lot of symbols I use frequently.
    Some of them are ...

    Math: µ ° ±√ ≈ ≠ π • ∅ Ω ∆ ≤ ≥ ⁿ ‰ % ∞
    Superscript: ¹²³⁴⁵⁶⁷⁸⁹⁰
    Arrows: ←↑↓→
    Fractions: ½⅓¼⅕⅙⅐⅛⅑⅒⅖⅔⅗¾⅜⅘⅝⅚⅞

    Is there any way to add or change the existing set of symbols by a user in gcb and even eliminate unused to save memory?

     
  • Anobium

    Anobium - 2022-12-07

    I wanted to try out some gcb codes to drive some types of displays.
    I started with the ssd1306 and soon discovered that it doesn't contain a lot of symbols I use frequently.
    Some of them are ...

    Math: µ ° ±√ ≈ ≠ π • ∅ Ω ∆ ≤ ≥ ⁿ ‰ % ∞
    Superscript: ¹²³⁴⁵⁶⁷⁸⁹⁰
    Arrows: ←↑↓→
    Fractions: ½⅓¼⅕⅙⅐⅛⅑⅒⅖⅔⅗¾⅜⅘⅝⅚⅞

    Does the Extended Character set have these characters ?

    Is there any way to add or change the existing set of symbols by a user in gcb and even eliminate unused to save memory?

    Yes, there is. There are demos to show how to redefine a character within a character set.

    Regarding memory. This is specific to the GCLD. The SSD1306 can be really optimised down to a very small character buffer. Have you use GCLD Transactions?

    Not all GLCDs use RAM so optmisation is specific to the GLCD.


    You could replace the whole of the GLCD routines that draw fonts. It is really down to how much effort you want to put in.

     
  • Haroen

    Haroen - 2022-12-07

    Thanks Anobium,
    So fonts are defined in gcb and not on the on-board chip of the ssd1306.

    Does the Extended Character set have these characters ?
    Most of the Math symbols are in the Extended Character set !(https://www.webopedia.com/wp-content/uploads/2020/10/extended-ascii_5f85365bb4f84-2.gif)

    There are demos to show how to redefine a character within a character set.
    Like the "Demo_custom_character.gcb"?

    he SSD1306 can be really optimised down to a very small character buffer.
    Does gcb optimize the code automatic or should I do it manually?

    Have you use GCLD Transactions?
    Not used but tried with several codes in the example directory.
    It works nice .

     
  • Anobium

    Anobium - 2022-12-09

    Fonts are generally specified within the GCB fonts tables. There are some GLCD ICs that have fontsets and the library will use them. SSD1306 is GCB fonts tables.

    Yes, re the Transactions. I wrote them. I had the idea when I was on a campsite in France! I took the concept from Microsoft Groove Replication Architecture (I was responsible for the development of Microsoft Groove Solutions for a few years). And, the Transactions do slow down the screen refresh ( overall time ) but you can optimize this will Transaction Page Control. It just takes a bit of mental exercise to implement a GLCD solution.

    Re the fonts. You can redefine them all by replacing the Table but I would recommend replacing the Extented Font Table leaving the standard fonts in place.

    I have thought the font generation could be rewritten to leverage the C style font definition - it can be down. It now just needs someone to be motivated to do it.

     
  • Haroen

    Haroen - 2022-12-13

    Those GLCD ICs are I2C?
    And is there a specific one that has GCB support?

    France does have that affect on people to relaxe and come up with great ideas.
    It certainly struck me with how much knowledge and expertise the GCB videos, manuals and GCB software have been put together. My respect for that. The forum obviously is the place for refinement. I must confess that I often need time to research and understand what is being answered. Normally that means I'm getting older I guess :)

    And, the Transactions do slow down the screen refresh ( overall time )

    I display all the static text first and only some dynamic text characters are frequently updated. This speeds up the display response.

    You can redefine them all by replacing the Table but I would recommend replacing the Extented Font Table leaving the standard fonts in place.

    I can't seem to display the ° degree sign, tried...

    GLCDPrint (0, 0, chr(248))
    GLCDPrint (0, 0, "°")
    

    This code I used to display all GCB chars:

    For Teller=0 To 255
        GLCDPrint (0, 16, Teller)
        GLCDPrint (35, 16, chr(Teller))
        GLCDdrawCHAR (50, 16, Teller)
        Pause 100
    Next
    

    There seems to be nothing in 0-33 and 130-255, empty places!
    The Extented Font Table 128-255 have lots of not commonly used chars.
    Couldn't we compile our own GCB "Standard Font Table" with chars all users really need in projects?

    I have thought the font generation could be rewritten to leverage the C style font definition - it can be down.

    What does that mean in plain english?

    I'm now strugling with this "Create your own OLED characters on your GLCD".

     

    Last edit: Haroen 2022-12-14
  • Anobium

    Anobium - 2022-12-14

    Those GLCD ICs are I2C?
    And is there a specific one that has GCB support?

    Which GLCD? As I do not know the type of GLCD model - I recommend you look at the help. The Help as a list of all the GLCD and the communication protocol.

    If a GLCD does not support I2C is can be added with ease.


    France does have that affect on people to relaxe and come up with great ideas.

    Agree. I take my vacation near Uzes, France ever year. 5 weeks in France regenerates the body of many months. This year I have been there of an extended period. :-)


    It certainly struck me with how much knowledge and expertise the GCB videos, manuals and GCB software have been put together. My respect for that. The forum obviously is the place for refinement. I must confess that I often need time to research and understand what is being answered. Normally that means I'm getting older I guess

    This is great insight. Thanks to all that help to keep GCB going.

    The age thing is getting to me also!


    And, the Transactions do slow down the screen refresh ( overall time )
    I display all the static text first and only some dynamic text characters are frequently updated. This speeds up the display response.

    Transactions answer the question you raised with respect to using less memory. Transaction use a 128 byte buffer to manage and update a 1024 byte GLCD. Think of Transactions as a 'page' or piece of the GLCD incrementally moving across the GLCD. It is the additional 'page' management that make the GLCD updates a little slower.


    ** can't seem to display the ° degree sign, tried...

    GLCDPrint (0, 0, chr(248))
    GLCDPrint (0, 0, "°")
    This code I used to display all GCB chars:

    For Teller=0 To 255
    GLCDPrint (0, 16, Teller)
    GLCDPrint (35, 16, chr(Teller))
    GLCDdrawCHAR (50, 16, Teller)
    Pause 100
    Next
    There seems to be nothing in 0-33 and 130-255, empty places!
    The Extented Font Table 128-255 have lots of not commonly used chars.
    **

    Your testing shows the character set. The GLCD font set IS characters 32 to 129 as this is the standard ASCII set.

    And, there is NO character definition for characters beyond that range. Which means if you tried to extend the GLCD font set then things would fall over in a heap. And, therefore character replacement within this range is an option. Hance, the demo on how to change a character in the GLCD character set.


    Couldn't we compile our own GCB "Standard Font Table" with chars all users really need in projects?

    Yes. You could replace the TABLEs. This is really the same as replacing one character but replacing the whole table.


    I have thought the font generation could be rewritten to leverage the C style font definition - it can be down.
    What does that mean in plain english?

    This is a development idea of mine. The current GCB methd uses a set of tables and these tables are specific to Great Cow BASIC.

    C style definition would leverage all the Open Source Character sets on the internet.

    But, this is rewrite of the GLCD code for font generation. This is doable but this would take someone months to compete. (It took me years to do what is there today but I was building on what was there and to add C style defintions for characters is a totall rewrite).


    I'm now strugling with this "Create your own OLED characters on your GLCD".

    What is the issue?


    You can redefine them all by replacing the Table but I would recommend replacing the Extented Font Table leaving the standard fonts in place.

    Yes, there is an Extended Font Table. I was hoping someone else would help answer the question to change this Extended Font Table. I will have to answer in a subsequent post.


     

    Last edit: Anobium 2022-12-14
  • Anobium

    Anobium - 2022-12-14

    With respect to the C Style definitions. This site shows how to generate C Style font tables.

    https://oleddisplay.squix.ch/#/home

    This generates a set of code that is used in other compilers.

    FACT: I used one set of tables to create the OLED fonts for GCB but I had to convert these tables.

    The vision would be to use these tables directly. It is possible. It just takes time.

     
    • Anobium

      Anobium - 2022-12-14

      Please try this.

      #DEFINE GLCD_OLED_FONT
      #DEFINE OLEDFont2 OLEDExtendedFont2 
      GLCDfntDefaultSize = 2
      
      Dim Teller as Byte
      For Teller=32 To 255
          GLCDPrint (0, 16, Teller)
          GLCDPrint (35, 16, chr(Teller))
          GLCDdrawCHAR (50, 16, Teller)
          Pause 100
      Next
      

      This will show you all the fonts in the OLED font set from 32 to 255. This is a larger character set but it shows some of the chars you are looking for!

       
      • Anobium

        Anobium - 2022-12-14

        The try this.

        #DEFINE GLCD_EXTENDEDFONTSET1
        
        Dim Teller as Byte
        For Teller=32 To 255
            GLCDPrint (0, 16, Teller)
            GLCDPrint (35, 16, chr(Teller))
            GLCDdrawCHAR (50, 16, Teller)
            Pause 100
        Next
        

        This will show that there are characters define from 32 to 255 but characters 128 to 192 are not defined.

        So, you can take the tables that are used with GLCD_EXTENDEDFONTSET1 and add 50 characters you need into the table space.


        Characters are define in matrix of 5 columns by 8 rows. Each column of the character is defined in one of the five tables. They are called GLCDCharCol3Extended1 to GLCDCharCol7Extended1 (why Col3... ask Hugh).

        So, ir should now be possible to change these unused characters to meet you need.

         
  • Haroen

    Haroen - 2022-12-16

    Oh, vous vouliez dire les circuits intégrés GLCD intégrés et non les puces I2C séparées externes :)

    Transactions as a 'page' or piece of the GLCD incrementally moving across the GLCD.

    I've seen examples and video's about it that I will definitely try.
    I found several other GCB video's for all kind of display use that I will have to try too.

    If I understand correctly there are 3 font-tables:
    Standard, #define GLCD_OLED_FONT
    Extended, #DEFINE GLCD_EXTENDEDFONTSET1
    GLCD-IC, #DEFINE OLEDFont2 OLEDExtendedFont2

    Where can I find a table.jpg with these GCB Standard Font Table and the GCB Extended Font table?
    I'm now playing around with the SSD1306 (32, 64), is there a SSD1306 font-table.jpg?
    All these overview info which chars are now available in GCB will determine if it is usefull to compile our own GCB "Standard Font Table" with chars all users really need in projects.

    For a helping hand(s):
    Maybe you could do a Font-table video serie how you did it to compile the current GCB font-set as basis to the next video what should be done, what you intended, for the C style definition.
    An automated process, if possible, would reduce the time.

     
    • Anobium

      Anobium - 2022-12-16

      Oh, vous vouliez dire les circuits intégrés GLCD intégrés et non les puces I2C séparées externes :)

      oui.


      GCB Font sets - got this info by looking at the libraries.

      1. Standard GCB - this is font set created by Hugh. It is a fixed width font. Data is held in tables GLCDCharCol3..7
      2. OLED Fonts - small font set - this is font set created by Evan (me). It is variable width font. Data is in tables OLEDFont1Index and Table OLEDFont1Data. Controlled by GLCDfntDefaultSize = 1
      3. OLED Fonts - large font set - this is font set created by Evan (me). It is fixed width font. Data is in tables OLEDFont2. Controlled by GLCDfntDefaultSize = 2
      4. Extended Fonts - this an extension of Stardard GCB. Uses GLCDCharCol3..7Extended1
      5. Large Characters - this is specific large character set held in table BigFontxx_xx

      This information is what I have to hand. Ask more questions and I will complete by digging deeper.


      Help Hand. I have already created for you a Excel spreadsheet. It shows how the data relates to the characters. I will video.

       
  • Haroen

    Haroen - 2022-12-16

    Oh, 1 to 5...
    I have collected only code for 3 of them now.
    Maybe for a quick learning curve for other users we could summarise these 5 methods and integrate it into the GCB demos, eventually a intro video.
    Here is what I have, please correct me if I'm wrong:

    'DECLARATION
    #chip mega328p, 16
    #option explicit
    #include <glcd.h>
    
    ; ----- Define GLCD Hardware settings
    #define GLCD_TYPE GLCD_TYPE_SSD1306_32
    #define GLCD_I2C_Address 0x78
    #define GLCD_PROTECTOVERRUN
    
    ; ----- Define Hardware settings
    #define hi2c_BAUD_RATE 400
    #define hi2c_DATA
    HI2CMode Master
    
    GLCDfntDefaultSize = 2
    GLCDFontWidth = 5
    
    'Variables
    Dim Teller as Integer
    Dim OLDDSDATA, EIGHTBYTES, CLOCKS as Byte
    
    
    'MAIN
    Do Forever
      GLCDCLS
      Gosub Standard
      Wait 3 s
      Gosub Extended
      Wait 3 s
      Gosub OLED
      Wait 7 s
    Loop
    
    Sub Standard
      #define GLCD_OLED_FONT
      For Teller=34 To 129
        GLCDPrint (0, 16, Teller)
        GLCDPrint (45, 16, chr(Teller))
        GLCDdrawCHAR (60, 16, Teller)
        GLCDPrint (107, 16, "S")
        Pause 500
      Next
      GLCDCLS
    End Sub
    
    Sub Extended
      #DEFINE GLCD_EXTENDEDFONTSET1
      For Teller=32 To 255
          GLCDPrint (0, 16, Teller)
          GLCDPrint (35, 16, chr(Teller))
          GLCDdrawCHAR (50, 16, Teller)
          GLCDPrint (107, 16, "E")
          Pause 500
      Next
    End Sub
    
    Sub OLED
      #DEFINE OLEDFont2 OLEDExtendedFont2
      For Teller=32 To 255
          GLCDPrint (0, 16, Teller)
          GLCDPrint (35, 16, chr(Teller))
          GLCDdrawCHAR (50, 16, Teller)
          GLCDPrint (107, 16, "O")
          Pause 500
      Next
    End Sub
    
     
  • Anobium

    Anobium - 2022-12-19

    @Haroen I like the idea of a set of examples.

    BASELINE USAGE

    I have taken your program. And, created some examples with documentation. Something that (as you say is needed!).

    This is the baseline demo. https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/GLCD_Solutions/GLCD_Methods/glcd_methods_baseline.gcb

    This may not be complete. Please revise.

    Evan


    There are NO control constants in this demo - therefore no OLED, no OLED character extension or use of extended fonts.

    This is mutually exclusive to the GLCD_OLED fonts.

    Range of characters is 15 t0 129
    GLCDfntDefaultSize = 1 to n with multiple the character size to make a larger character
    Characters are a basic mono sized font
    This is the original font set of Great Cow BASIC

    GLCDFontWidth = 5 is the default value - this DOES control the intercharacter spacing.

    You can use the method GLCDPrintLargeFont as in
    GLCDPrintLargeFont 0,0, "HELLO"

    Also, GLCDPrintWithSize operated as expected
    GLCDPrintWithSize 0,0, "H",2
    GLCDPrintWithSize 20,0, "ello",1

    Constants available are:

    GLCD_TYPE                                   GLCD_TYPE_SSD1306                   
    GLCD_PROTECTOVERRUN                                                             
    LANDSCAPE                                   1                                   
    PORTRAIT_REV                                2                                   
    LANDSCAPE_REV                               3                                   
    PORTRAIT                                    4                                   
    GLCDINIT                                    INITGLCD                            
    GLCDBOX                                     BOX                                 
    GCLDFILLEDBOX                               FILLEDBOX                           
    GCLDCIRCLE                                  CIRCLE                              
    GLCDFILLEDCIRCLE                            FILLEDCIRCLE                        
    GLCDLINE                                    LINE                                
    SSD1306_VCCSTATE                            0                                   
    SSD1306_SETCONTRAST                         129                                 
    SSD1306_DISPLAYALLON_RESUME                 164                                 
    SSD1306_DISPLAYALLON                        165                                 
    SSD1306_NORMALDISPLAY                       166                                 
    SSD1306_INVERTDISPLAY                       167                                 
    SSD1306_DISPLAYOFF                          174                                 
    SSD1306_DISPLAYON                           175                                 
    SSD1306_SETDISPLAYOFFSET                    211                                 
    SSD1306_SETCOMPINS                          218                                 
    SSD1306_SETVCOMDETECT                       219                                 
    SSD1306_SETDISPLAYCLOCKDIV                  213                                 
    SSD1306_SETPRECHARGE                        217                                 
    SSD1306_SETMULTIPLEX                        168                                 
    SSD1306_SETLOWCOLUMN                        0                                   
    SSD1306_SETHIGHCOLUMN                       16                                  
    SSD1306_SETSTARTLINE                        64                                  
    SSD1306_MEMORYMODE                          32                                  
    SSD1306_COLUMNADDR                          33                                  
    SSD1306_PAGEADDR                            34                                  
    SSD1306_COMSCANINC                          192                                 
    SSD1306_COMSCANDEC                          200                                 
    SSD1306_SEGREMAP                            160                                 
    SSD1306_CHARGEPUMP                          141                                 
    SSD1306_EXTERNALVCC                         1                                   
    SSD1306_SWITCHCAPVCC                        2                                   
    SSD1306_ACTIVATE_SCROLL                     47                                  
    SSD1306_DEACTIVATE_SCROLL                   46                                  
    SSD1306_SET_VERTICAL_SCROLL_AREA            163                                 
    SSD1306_RIGHT_HORIZONTAL_SCROLL             38                                  
    SSD1306_LEFT_HORIZONTAL_SCROLL              39                                  
    SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SC    41                                  
    SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCR    42                                  
    GLCDLINEWIDTH                                     1                                         
    GLCD_WIDTH                                        128                                       
    GLCD_HEIGHT                                       64                                        
    GLCDVERSION                                       8                                         
    INITGLCD                                          INITGLCD_SSD1306                          
    GLCDCLS                                           GLCDCLS_SSD1306                           
    GLCDDRAWCHAR                                      GLCDDRAWCHAR_SSD1306                      
    FILLEDBOX                                         FILLEDBOX_SSD1306                         
    PSET                                              PSET_SSD1306                              
    GLCD_OPEN_PAGETRANSACTION                         GLCD_OPEN_PAGETRANSACTION_SSD1306         
    GLCD_CLOSE_PAGETRANSACTION                        GLCD_CLOSE_PAGETRANSACTION_SSD1306        
    GLCDSETCONTRAST                                   SETCONTRAST_SSD1306                       
    GLCD_TYPE_STRING                                  SSD1306                                   
    GLCD_WIDTH                                        128                                       
    GLCD_HEIGHT                                       64                                        
    SSD1306_GLCD_HEIGHT                               GLCDDEVICEHEIGHT                          
    SSD1306_GLCD_WIDTH                                GLCDDEVICEWIDTH                           
    IGNORE_SPECIFIED_GLCD_TYPE_SSD1306_CHARACTER_MODE_ONLY          0                           
    GLCD_TYPE_SSD1306_CHARACTER_MODE_ONLY = TRUE|FALSE
    GLCD_TYPE_SSD1306_LOWMEMORY_GLCD_MODE = TRUE|FALSE
    

    ~~~

    I think will find bugs as we create these demos! Be prepared

    Next, and OLED version.

     

    Last edit: Anobium 2022-12-20
  • Anobium

    Anobium - 2022-12-19

    @Haroen Continuing the idea of a set of examples.

    OLED FONTS USAGE - BASIC USE

    This is the baseline OLED demo. https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/GLCD_Solutions/GLCD_Methods/glcd_methods_oledfonts.gcb

    Note the range is different and the font select (OLED fonts do not scale).

    This demo still may not be complete. Please revise.

    Evan


    There is the GLCD_OLED_FONT constants in this demo - therefore no BASELINE fonts, no OLED character extension or use of extended fonts.
    This is mutually exclusive to the GLCD_STANDARD fonts.

    Range of characters is 32 to 127
    GLCDfntDefaultSize = 1 or 2 only with different fonts being used to show the characters
    GLCDfntDefaultSize = 1: Are variable width characters by 8 pixels high characters. ! is one pixel width , and " is two pixels etc.
    GLCDfntDefaultSize = 2: Are 10 width by 16 pixels high characters. Therefore, a fixed font.

    GLCDFontWidth = 5 is the default value.

    You can use the method GLCDPrintLargeFont as in with the values of 1 or 2
    GLCDPrintLargeFont 0,0, "HELLO"

    Also, GLCDPrintWithSize operated as expected
    GLCDPrintWithSize 0,0, "H",2
    GLCDPrintWithSize 20,0, "ello",1

    Constants available are:

    GLCD_TYPE                                   GLCD_TYPE_SSD1306
    GLCD_OLED_FONT                  
    GLCD_PROTECTOVERRUN                                                             
    LANDSCAPE                                   1                                   
    PORTRAIT_REV                                2                                   
    LANDSCAPE_REV                               3                                   
    PORTRAIT                                    4                                   
    same as previous....
    

    ~~~

    I think will find bugs as we create these demos! Be prepared

    Next, and OLED EXTENDED version.

     

    Last edit: Anobium 2022-12-20
  • Anobium

    Anobium - 2022-12-19

    @Haroen Continuing the idea of a set of examples.

    OLED FONTS USAGE - EXTENDED CHARACTERS

    This is the baseline OLED EXTENDED CHARACTERS demo.

    https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/GLCD_Solutions/GLCD_Methods/glcd_methods_extendedfontset1.gcb

    Note the range is different from the BASIC OLED fonts.

    Evan

    The main diffence is the constant `#DEFINE OLEDFONT2 OLEDEXTENDEDFONT2`.
    
    
    // character range constants
    #DEFINE LOWESTCHAR  32
    #DEFINE HIGHESTCHAR 255
    
    #DEFINE GLCD_OLED_FONT
    #DEFINE OLEDFONT2 OLEDEXTENDEDFONT2
      There is the GLCD_OLED_FONT and OLEDFONT2 ( which redirects to OLEDEXTENDEDFONT2 ) constants in this demo - therefore no BASELINE fonts 
      This is mutually exclusive to the GLCD_STANDARD fonts.
    
      This is essentially changes the character lookup from one table of data to another table of data - the table OLEDEXTENDEDFONT2 has all the characters in the range of 32 to 255
    
      Range of characters is 32 to 255
      OLEDEXTENDEDFONT2 fonts are ONLY GLCDfntDefaultSize = 2
      GLCDfntDefaultSize = 2: Are 10 width by 16 pixels high characters. Therefore, a fixed font.
    
      GLCDFontWidth = 5 is the default value - how the character does control the width.  A ! is one pixel, and " is two pixels etc.
    
      You can use the method GLCDPrintLargeFont as in with the values of 1 or 2
        GLCDPrintLargeFont 0,0, "HELLO"
    
      Also, GLCDPrintWithSize operated as expected
        GLCDPrintWithSize 0,0, "H",2
        GLCDPrintWithSize 20,0, "ello",1
    
      Constants available are:
    
        GLCD_TYPE                                   GLCD_TYPE_SSD1306
        GLCD_OLED_FONT                  
        GLCD_PROTECTOVERRUN                                                     OLEDFONT2                                     OLEDEXTENDEDFONT2   
        LANDSCAPE                                   1                                   
        PORTRAIT_REV                                2                                   
        LANDSCAPE_REV                               3                                   
        PORTRAIT                                    4                                   
       same as previous.....
    

    I think will find bugs as we create these demos! Be prepared

    Next, and OLED with NO GLCDfntDefaultSize=2 version - this reduces the size of the memory used.

     

    Last edit: Anobium 2022-12-20
  • stan cartwright

    stan cartwright - 2022-12-19

    Does any of this let one use the xor function by anobium ... which can be useful for b/w display. ie not erase background?

     
    • Anobium

      Anobium - 2022-12-19

      Yes, you could always use the XOR functions.

      At this point we are documenting what is the fontset and characters set are.

      Evan

       
  • Anobium

    Anobium - 2022-12-20

    @Haroen Continuing the idea of a set of examples.

    OLED FONTS USAGE - NO OLEDFONT2

    This is a demo without access to the OLED FONT Set 2. This saves near 2kb of program memory.

    https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/GLCD_Solutions/GLCD_Methods/glcd_methods_oledfonts_noFontSet2.gcb

    Note the memory usage.

    Evan

    The controlling constant is  `#DEFINE GLCD_DISABLE_OLED_FONT2`.
    
    
      This is a GLCD_OLED_FONT demo with no FONT SET 2 - therefore no BASELINE fonts, no OLED character extension or use of extended fonts. 
      But, most importantly not OLED_FONT2 - by using the constant GLCD_DISABLE_OLED_FONT2.  This save memory.
      OLED fonts are mutually exclusive to the GLCD_STANDARD fonts.
    
      Without OLED_FONT2 support - saves 1008 words!
        Program Memory: 2721/16384 words (16.61%)
    
      With OLED_FONT2 support
      Program Memory: 3729/16384 words (22.76%)
    
    
      Range of characters is 32 to 127
      GLCDfntDefaultSize = 1 or 2 only with different fonts being used to show the characters
        GLCDfntDefaultSize = 1: Are variable width characters by 8 pixels high characters.  ! is one pixel width , and " is two pixels etc.
        GLCDfntDefaultSize = 2: Are 10 width by 16 pixels high characters. Therefore, a fixed font.
    
      GLCDFontWidth = 5 is the default value.
    
      You can use the method GLCDPrintLargeFont as in with the values of 1 or 2
        GLCDPrintLargeFont 0,0, "HELLO"
    
      Also, GLCDPrintWithSize operated as expected
        GLCDPrintWithSize 0,0, "H",2
        GLCDPrintWithSize 20,0, "ello",1
    
      Constants available are:
    
        GLCD_TYPE                                   GLCD_TYPE_SSD1306
        GLCD_OLED_FONT
        GLCD_DISABLE_OLED_FONT2                 
        GLCD_PROTECTOVERRUN                                                             
        LANDSCAPE                                   1                                   
        PORTRAIT_REV                                2                                   
        LANDSCAPE_REV                               3                                   
        PORTRAIT                                    4                                                           
       same as previous.....
    

    I think will find bugs as we create these demos! Be prepared

    Next, and BASELINE fonts with GLCD_EXTENDEDFONTSET1 version - this extends the baseline fonts.

     
  • Haroen

    Haroen - 2022-12-20

    hi Stan en Evan,

    • I tried the "#define PSet_SSD1306 xorPSet_SSD1306" in the demo "GLCD simple oscilloscope".
      But how to switch back to "normal" so "NOT xor" display?

    • For the idea of these set of examples I have run several codes to observe the displayed characters and found it easy to program with ASCII tables to quickly find a character number as I mentioned earlier..

      Where can I find a table.jpg with these GCB Standard Font Table and the GCB Extended Font table?
      I'm now playing around with the SSD1306 (32, 64), is there a SSD1306 font-table.jpg?

    Therefore I've made these two table jpg's. I've yet to do the others.
    OLED Standard ASCII characters.jpg
    OLED Extended ASCII characters.jpg

    Is there any way to implement these tables into GCB software and in these examples?

    • Where in the forum can I ask questions related to GCB software use and remarks as first time user?

    Nice work Evan!

     

    Last edit: Haroen 2022-12-20
  • Anobium

    Anobium - 2022-12-20

    @Haroen Continuing the idea of a set of examples.

    BASELINE FONTS USAGE - EXTENDED CHARACTERS

    This is the base font set with extended chars demo.

    https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/GLCD_Solutions/GLCD_Methods/glcd_methods_extendedfontset1.gcb

    Note the range of characters is different from the baseline fontset.

    Evan


        This shows the use of extended fontset.
       Using extended fontset is a 315 word increase in program size.
    
        Program Memory: 2971/16384 words (18.13%) - extended fontset
        Program Memory: 2656/16384 words (16.21%) - no extended fontset
    
      There is a control constant in this demo but therefore no OLED, no OLED character extension.
      This is mutually exclusive to the GLCD_OLED fonts.
    
      Range of characters is 15 to 255
      GLCDfntDefaultSize = 1 to n with multiple the character size to make a larger character
      Characters are a basic mono sized font
      This is the original font set of Great Cow BASIC plus a set of Greek character.
      Characters between 128 and 247 are NOT defined therefore blanks will be displayed.
    
      GLCDFontWidth = 5 is the default value - this DOES control the intercharacter spacing.
    
      You can use the method GLCDPrintLargeFont as in 
        GLCDPrintLargeFont 0,0, "HELLO"
    
      Also, GLCDPrintWithSize operated as expected
        GLCDPrintWithSize 0,0, "H",2
        GLCDPrintWithSize 20,0, "ello",1
    
      Constants available are:
    
        GLCD_TYPE                                   GLCD_TYPE_SSD1306                   
        GLCD_PROTECTOVERRUN
        GLCD_EXTENDEDFONTSET1                                                           
        LANDSCAPE                                   1                                   
        PORTRAIT_REV                                2                                   
        LANDSCAPE_REV                               3                                   
        PORTRAIT                                    4                                                       
        same as previous....
    

    These are the demos for fontset management.

     

    Last edit: Anobium 2022-12-20
  • Anobium

    Anobium - 2022-12-20

    @Haroen

    I tried the "#define PSet_SSD1306 xorPSet_SSD1306" in the demo "GLCD simple oscilloscope".
    But how to switch back to "normal" so "NOT xor" display?

    Stan can answer.

    For the idea of these set of examples I have run several codes to observe the displayed characters and found it easy to program with ASCII tables to quickly find a character number as I mentioned earlier..

    Good news!

    Where can I find a table.jpg with these GCB Standard Font Table and the GCB Extended Font table?

    I dont believe this is JPG of the fonts. If you create we can add to the Help.

    I'm now playing around with the SSD1306 (32, 64), is there a SSD1306 font-table.jpg?

    So, same fonts as any GLCD. So, there is no SSD1306 font-table.jpg. Same as above - create and we can add the Help.

    Therefore I've made these two table jpg's. I've yet to do the others.
    OLED Standard ASCII characters.jpg
    OLED Extended ASCII characters.jpg

    Wonderful. Great work!

    Is there any way to implement these tables into GCB software and in these examples?

    When you are ready. We can add to the Help.

    Where in the forum can I ask questions related to GCB software use and remarks as first time user?

    You have a few options.

    1) Update the Help - this is easy. Maybe update this? https://gcbasic.sourceforge.net/help/_pic_users_and_beginners_start_here.html

    We do not update the HTML. There is a real simple process to update any portion of the Help. The actual source for the page above is here: https://github.com/GreatCowBASIC/Help/blob/main/source/newtoGreatCowBASIC.adoc You can create a GitHub account and edit online.

    If you want to edit any other page, in the GLCD section for instance, the full list of pages is here: https://github.com/GreatCowBASIC/Help/blob/main/source/gcbasic.adoc The actual source files are in the order of Help creation.

    2) Create a post and someone else (me!) edits for you. This is far ideal but not everyone wants to write the Help pages.

    Nice work Evan!

    It is not just me. There is a growing band of folks involved! Thanks to them GCBASIC grows.

     

    Last edit: Anobium 2022-12-20
  • stan cartwright

    stan cartwright - 2022-12-20

    The glcd lib is interesting when I can follow it.
    The character print seems to be plotting the dots that make them.. not sure though.
    xor seems to be set at program start but not switchable in program afaik.
    xor seems to be the plot command so affects all ssd1306 graphics.. dunno.
    The idea is that the graphics erase the background and redrawing erases the graphics and restores the background.
    Anobium implemented the read pixel function, which can be a "blit" function for small screen areas to store and restore... maybe. ram?
    I tried to understand how the buffer worked so it could be read and a composite video signal could be generated.
    I will try defining graphics but prefer using ili9341 displays.
    Cheers for the work.

     
  • Haroen

    Haroen - 2022-12-21

    xor seems to be set at program start but not switchable in program

    Is there any workaround to add text to or before a graph oscilloscope?

    CODE TESTING RESULTS

    • Code: BASELINE USAGE

      • I made some changes in github
      • Hello starts in the middle?
        Should start left aligned according to...
        GLCDPrintWithSize 0,0, "H",2
    • Code: OLED FONTS USAGE - BASIC USE

      • Hello starts in the middle?
      • With "GLCDfntDefaultSize = 2" both small and large tittles "Standard set" are merged unreadable.
      • ASCII counter (Teller) is cut off on the left.
    • Code: OLED FONTS USAGE - EXTENDED CHARACTERS

      • Hello starts in the middle as above mentioned?
      • With "GLCDfntDefaultSize = 2" both small and large tittles "Standard set" are merged
    • Code: OLED FONTS USAGE - NO OLEDFONT2

      • Saving near 2kb of program memory is really nice with smaller chips or big program.
      • Hello starts in the middle as above mentioned?
      • Yes correct: the "H" from Hello and all text on the second line is a filled rectangle as you mentioned in the code: "Note this character fails as OLEDFONT2 is not there and a ZERO value is returned".
    • Code: BASELINE FONTS USAGE - EXTENDED CHARACTERS

      • Hello starts in the middle as above mentioned?
     
    • Anobium

      Anobium - 2022-12-21

      Please retest with BUILD 1208. I updated the GLCD.H

      This changed revised GLCDPrintLoc to correct Xpos value @ 1208 which was the miss positioning of the "Hello"

       

      Last edit: Anobium 2022-12-21
      • Anobium

        Anobium - 2022-12-21

        Also, I do not see any changes in GitHub. Did you commit back to the master Git?

         
1 2 3 4 > >> (Page 1 of 4)

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.