Support of GLCD Font Creator 1.1.0 - mikroElektronika Editio

Post your requests and ideas on the future development of Visual GLCD Software.
Post Reply
Author
Message
Massimo
Posts: 126
Joined: 23 Jul 2008 22:49

Support of GLCD Font Creator 1.1.0 - mikroElektronika Editio

#1 Post by Massimo » 05 Oct 2010 22:01

Hi everyone

I think your softwar is very interesting but I saw that I can use only the fonts definded by your tool- I wonder if it is possible to use the GLCD Font Creator 1.1.0 - mikroElektronika Edition in your environment as well . In particular I saw that your fonts are defined in __Lib_GlcdFonts.mcl that is a closed file that I can't manage to add other fonts.

How can I add another font?

User avatar
marko.ziv
mikroElektronika team
Posts: 530
Joined: 06 Dec 2007 10:11
Contact:

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#2 Post by marko.ziv » 06 Oct 2010 08:45

Hello,

First of all thank you for the kind words about our tool.
Yes, it is possible to utilize GLCD Font Creator - mikroElektronika Edition with Visual GLCD.

There are some precautions you need to take, when you export your font.
Font height (in pixels) should not be greater then 8, uncheck all blank row generation
and when exporting mind to select mikroE GLCD lib.

Copy and paste the code in the __Lib_GlcdFonts, compile it and copy mcl file to Visual GLCD instalation (make backups of course).

If you have any other questions or suggestions feel free to let us know.

Best Regards

Massimo
Posts: 126
Joined: 23 Jul 2008 22:49

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#3 Post by Massimo » 06 Oct 2010 09:49

Copy and paste the code in the __Lib_GlcdFonts, compile it and copy mcl file to Visual GLCD instalation (make backups of course)
How can I compile __Lib_GlcdFonts (I don't know)
There are some precautions you need to take, when you export your font.
Font height (in pixels) should not be greater then 8, uncheck all blank row generation
and when exporting mind to select mikroE GLCD lib.
for fonts greater than 8 pixel, intrsad?

User avatar
marko.ziv
mikroElektronika team
Posts: 530
Joined: 06 Dec 2007 10:11
Contact:

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#4 Post by marko.ziv » 07 Oct 2010 07:25

Massimo wrote:
Copy and paste the code in the __Lib_GlcdFonts, compile it and copy mcl file to Visual GLCD instalation (make backups of course)
How can I compile __Lib_GlcdFonts (I don't know)
Ok, lets take mikroC PRO for PIC for example. In the compilers installation folder you will find file suitably named "__Lib_GlcdFonts.c".
It contains definition for fonts used by our GLCD library and this is where you need to paste code generated by GLCD Font Creator.
After successful compilation you can utilize your new font with Glcd_Set_Font and Glcd_Write_Text
Massimo wrote:
There are some precautions you need to take, when you export your font.
Font height (in pixels) should not be greater then 8, uncheck all blank row generation
and when exporting mind to select mikroE GLCD lib.
for fonts greater than 8 pixel, intrsad?
Our GLCD library has screen divided in pages, and font height can not be greater than page height.

Hope this helps a bit.
Best Regards

Vineyards
Posts: 73
Joined: 25 Feb 2008 22:12

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#5 Post by Vineyards » 08 Nov 2010 00:55

Any plans to switch to a less restrictive GLCD library then?

User avatar
marko.ziv
mikroElektronika team
Posts: 530
Joined: 06 Dec 2007 10:11
Contact:

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#6 Post by marko.ziv » 09 Nov 2010 13:43

Hello,

we are planning to make big revision of our GLCD library so it could support
fonts bigger than 8 pixels in size. Since this release (v1.50) was planned to be
a fast release we haven't had the time to implement mentioned changes.
At the moment our plan is to release TFT tool similar to this one, and after that it will be time
to make another update of Visual GLCD.

Best Regards

Vineyards
Posts: 73
Joined: 25 Feb 2008 22:12

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#7 Post by Vineyards » 07 Jan 2011 23:20

[[/quote]
Ok, lets take mikroC PRO for PIC for example. In the compilers installation folder you will find file suitably named "__Lib_GlcdFonts.c".
It contains definition for fonts used by our GLCD library and this is where you need to paste code generated by GLCD Font Creator.
After successful compilation you can utilize your new font with Glcd_Set_Font and Glcd_Write_Text
Massimo wrote:
There are some precautions you need to take, when you export your font.
Font height (in pixels) should not be greater then 8, uncheck all blank row generation
and when exporting mind to select mikroE GLCD lib.
Does this apply to the S1d13700 library too? Can I add fonts into the library using above mentioned method?

Vineyards
Posts: 73
Joined: 25 Feb 2008 22:12

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#8 Post by Vineyards » 07 Jan 2011 23:23

marko.ziv wrote:Hello,

we are planning to make big revision of our GLCD library so it could support
fonts bigger than 8 pixels in size. Since this release (v1.50) was planned to be
a fast release we haven't had the time to implement mentioned changes.
At the moment our plan is to release TFT tool similar to this one, and after that it will be time
to make another update of Visual GLCD.

Best Regards
Is that revision nearing? Currently, I have almost given up on the touch panel functionality. A new problem-free release would really be a welcome development.

User avatar
marko.ziv
mikroElektronika team
Posts: 530
Joined: 06 Dec 2007 10:11
Contact:

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#9 Post by marko.ziv » 11 Jan 2011 17:09

Hello,

right now PIC32 compilers are keeping us very busy.
After we release new PIC32 compilers there will be another release of Visual GLCD.

Best Regards

djanib
Posts: 6
Joined: 31 Mar 2006 08:17
Contact:

Re: Support of GLCD Font Creator 1.1.0 - mikroElektronika Ed

#10 Post by djanib » 14 Apr 2011 22:30

Hello to all!

Before I write anything, apologise for my bad english.
Reading forum, I can see, a lot of people have a problem with big font, using GLCD.
In next few step I will give to you solution, how to create and use font higher then 8 pixel.
In this case, font size 16x24. With font big like this, (from edge to edge) you can only show
8 characters. Enough to see hours,minutes and seconds in one row. 16x8=128.

To create new font, you don't need more then 10 minutes, or less.

In this example i'm use:
- GLCD KS0108 128x64 (Data port to MCU RD0..RD7,,, cfg bit RA-0..RA5)
- DS1307 RTC (Standard hardware i2C connection RC3-RC4)
- MCU PIC18F4520 (osc 8MHz external, all cfg OFF except MCLRE instead of RE3)
- GLCD Font Creator v1.1.0
- MikroPascal PRO for PIC v4.60

Code is devided in two parts, Main prog, and SubProg with "Read/Set time" and
"Font definition" procedure. It is easier to follow steps at this way. Created font have
only numbers "0123456789" and ":" because, only I need to show clock and nothing else.

Voila!
Main Prog:

Code: Select all

program GLCD_Font_Test;
////////////////////////////////////////////////////////////////////////////////
// GLCD Data - PortD 0..7                                                     //
// GLCD Conf - PortA 0..5                                                     //
// DS1307    - RC3-RC4                                                        //
// RTC SQW   - PortE 2 - THIS HELP TO READ TIME ONLY ONCE IN SEC              //
// LED on/off- PortE 0 - Blink led 1HZ                                        //
//                                                                            //
// MCU - PIC18F4520 - External OSC 8MHz (HS)                                  //
// RTC - Dallas DS1307                                                        //
//                                                               By Djani B.  //
////////////////////////////////////////////////////////////////////////////////
Var GLCD_DataPort : byte at PORTD;

    GLCD_CS1 : sbit at RA1_bit;               // Adapt GLCD Configuration to Your hardware
    GLCD_CS2 : sbit at RA0_bit;
    GLCD_RS  : sbit at RA2_bit;
    GLCD_RW  : sbit at RA3_bit;
    GLCD_EN  : sbit at RA4_bit;
    GLCD_RST : sbit at RA5_bit;

    GLCD_CS1_Direction : sbit at TRISA1_bit;
    GLCD_CS2_Direction : sbit at TRISA0_bit;
    GLCD_RS_Direction  : sbit at TRISA2_bit;
    GLCD_RW_Direction  : sbit at TRISA3_bit;
    GLCD_EN_Direction  : sbit at TRISA5_bit;
    GLCD_RST_Direction : sbit at TRISA4_bit;

    tGsec : byte;

begin
  ADCON1:=$0F;        // Analog ports OFF
  CMCON:=$07;         // Comparators off
  Glcd_Init();        // Configure GLCD as you wish
  TRISE := $04;       // PortE Bit 2 Input (SQW from DS1307)
  I2C1_init(100000);  // Set i2C to 100KHz

  Gsec := $00;  // sec $00-$59
  Gmin := $01;  // min $00-$59
  Ghr  := $01;  // hr  $00-$23
  Gday := $04;  // day $01-$07
  Gdt  := $14;  // dt  $01-$31
  Gmn  := $04;  // mn  $01-$12
  Gye  := $11;  // ye  $00-$99
//  Write_Time;                                                        // Set DS1307 (Use it only once to set time, then REM it again)

  Glcd_Fill(0);                                                        // Clear screen}
  repeat
    begin
       PortE.0:=PortE.2;                                               // LED Blink 1Hz
       if (PortE.0=1) and (tGsec=1) and (I2C1_Is_Idle) then            // 1sec passed and i2C BUS idle
       begin
            tGsec:=0;
            Read_Time;                                                 // Read DS1307
            Glcd_Big_Font(TimeStr,2);                                  // Print Time to GLCD (Big numbers)
            Glcd_Set_Font(@Font_Glcd_Character8x7, 8, 7, 32);          // Set Normal font for Date
            For i:=0 to 7 do GLcd_Write_char(DateStr[i],35+(i*8),7,1); // Print Date to GLCD
       end;
       if PortE.0=0 then tGsec:=1;
    end;
  until FALSE;
end.
Sub Prog:

Code: Select all

unit ReadTime_Proc;

Procedure Read_Time;
Procedure Write_Time;
Procedure Glcd_Big_Font(var In_Text : String[7]; f_row : byte);

var
i,GSec,Gmin,Ghr,Gday,Gdt,Gmn,Gye : byte;
               DateStr,TimeStr : array[0..7] of char;
                        cnvstr : array[0..5] of char;

const Comic_1_16x8 : array[176] of byte = (                                              // Font PART Page I
        $00, $C0, $F0, $FC, $FE, $7E, $1F, $0F, $0F, $0F, $1F, $FE, $FC, $F8, $C0, $00,  // Code for char 0
        $00, $00, $18, $3C, $3E, $3E, $FF, $FF, $FF, $FE, $00, $00, $00, $00, $00, $00,  // Code for char 1
        $00, $00, $18, $3C, $3E, $3E, $1F, $0F, $0F, $0F, $9F, $FF, $FE, $FC, $78, $00,  // Code for char 2
        $00, $00, $18, $3C, $3E, $1F, $0F, $0F, $8F, $9F, $FF, $FE, $FC, $F8, $00, $00,  // Code for char 3
        $00, $00, $00, $00, $80, $E0, $F0, $F8, $7C, $FE, $FF, $FF, $FF, $00, $00, $00,  // Code for char 4
        $00, $FE, $FF, $FF, $FF, $8F, $CF, $CF, $CF, $CF, $CF, $8F, $8F, $06, $00, $00,  // Code for char 5
        $00, $00, $80, $E0, $F0, $F8, $FC, $7E, $3F, $1F, $0F, $06, $00, $00, $00, $00,  // Code for char 6
        $00, $06, $0F, $0F, $0F, $0F, $0F, $0F, $CF, $EF, $FF, $FF, $FF, $3F, $0F, $06,  // Code for char 7
        $00, $00, $F0, $FC, $FE, $FE, $9F, $0F, $0F, $9F, $FF, $FE, $FE, $F8, $00, $00,  // Code for char 8
        $00, $F0, $F8, $FC, $FE, $1E, $0F, $0F, $0F, $0F, $1E, $FE, $FC, $F8, $E0, $00,  // Code for char 9
        $00, $00, $00, $00, $00, $F0, $F8, $F8, $F8, $F8, $F0, $00, $00, $00, $00, $00   // Code for char :
        );

const Comic_2_16x8 : array[176] of byte = (                                              // Font PART Page II
        $00, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF, $00,  // Code for char 0
        $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00,  // Code for char 1
        $00, $00, $80, $C0, $E0, $F0, $F8, $7C, $3E, $1F, $0F, $07, $03, $01, $00, $00,  // Code for char 2
        $00, $00, $80, $80, $06, $0F, $0F, $0F, $0F, $1F, $3F, $FF, $FF, $F8, $E0, $00,  // Code for char 3
        $00, $78, $FE, $FF, $FF, $F7, $F3, $F0, $F0, $FF, $FF, $FF, $FF, $F0, $F0, $60,  // Code for char 4
        $00, $0F, $1F, $1F, $1F, $0F, $07, $03, $03, $03, $07, $FF, $FF, $FF, $FC, $00,  // Code for char 5
        $00, $FE, $FF, $FF, $FF, $1F, $0F, $0F, $0F, $0F, $1F, $FE, $FE, $FC, $F0, $00,  // Code for char 6
        $00, $00, $00, $00, $00, $C0, $F8, $FF, $FF, $FF, $0F, $03, $00, $00, $00, $00,  // Code for char 7
        $00, $E0, $F0, $FB, $FF, $3F, $1F, $0F, $0F, $1F, $3F, $FF, $F9, $F0, $E0, $00,  // Code for char 8
        $00, $03, $0F, $1F, $1F, $3E, $3C, $3C, $3C, $FC, $FE, $FF, $FF, $7F, $0F, $00,  // Code for char 9
        $00, $00, $00, $00, $00, $C0, $E1, $E1, $E1, $E1, $C0, $00, $00, $00, $00, $00   // Code for char :
        );
        
const Comic_3_16x8 : array[176] of byte = (                                              // Font PART Page III
        $00, $00, $07, $0F, $1F, $1F, $3E, $3C, $3C, $3E, $1F, $1F, $0F, $03, $00, $00,  // Code for char 0
        $00, $00, $18, $3C, $3C, $3C, $3F, $3F, $3F, $3F, $3C, $3C, $3C, $18, $00, $00,  // Code for char 1
        $00, $1F, $3F, $3F, $3F, $3D, $3C, $3C, $3C, $3C, $3C, $3C, $3C, $3C, $18, $00,  // Code for char 2
        $00, $07, $0F, $1F, $1F, $3E, $3C, $3C, $3C, $3C, $3E, $1F, $0F, $07, $03, $00,  // Code for char 3
        $00, $00, $00, $00, $00, $00, $00, $00, $00, $1F, $3F, $3F, $1F, $00, $00, $00,  // Code for char 4
        $00, $06, $0F, $1F, $3E, $3C, $3C, $3C, $3C, $3E, $1F, $1F, $0F, $07, $01, $00,  // Code for char 5
        $00, $01, $07, $1F, $1F, $3E, $3C, $3C, $3C, $3C, $3E, $1F, $0F, $07, $03, $00,  // Code for char 6
        $00, $00, $00, $00, $1E, $3F, $3F, $1F, $07, $00, $00, $00, $00, $00, $00, $00,  // Code for char 7
        $00, $07, $0F, $1F, $1F, $3E, $3C, $3C, $3C, $3C, $3E, $1F, $1F, $0F, $03, $00,  // Code for char 8
        $00, $00, $10, $38, $3C, $3C, $1E, $1E, $0F, $0F, $07, $03, $01, $00, $00, $00,  // Code for char 9
        $00, $00, $00, $00, $00, $03, $07, $07, $07, $07, $03, $00, $00, $00, $00, $00   // Code for char :
        );
        
implementation

Procedure Read_Time;
begin
   I2C1_Start();
   I2C1_Wr($D0);                        // Init DS1307 in write mode
   I2C1_Wr($00);                        // Set Start Address
   I2C1_Stop();                         // STOP/START used as repeated start
   I2C1_Start();                        //
   I2C1_Wr($D1);                        // Init DS1307 in Read mode
   Gsec :=I2C1_Rd(1);                   // Read sec
   Gmin :=I2C1_Rd(1);                   // Read min
   Ghr  :=I2C1_Rd(1);                   // Read hr
   Gday :=I2C1_Rd(1);                   // Read day in week
   Gdt  :=I2C1_Rd(1);                   // Read date
   Gmn  :=I2C1_Rd(1);                   // Read month
   Gye  :=I2C1_Rd(0);                   // Read Year, ACK Last read
   I2c1_Stop();

   GSec := Bcd2Dec(Gsec);               // Convert HEX to Dec value
   Gmin := Bcd2Dec(Gmin);
   Ghr  := Bcd2Dec(Ghr);
   Gdt  := Bcd2Dec(Gdt);
   Gmn  := Bcd2Dec(Gmn);
   Gye  := Bcd2Dec(Gye);

WordToStrWithZeros(Ghr, CnvStr);        // Create Time String
     TimeStr[0]:=CnvStr[3];
     TimeStr[1]:=CnvStr[4];
     TimeStr[2]:=':';
WordToStrWithZeros(Gmin, CnvStr);
     TimeStr[3]:=CnvStr[3];
     TimeStr[4]:=CnvStr[4];
     TimeStr[5]:=':';
WordToStrWithZeros(Gsec, CnvStr);
     TimeStr[6]:=CnvStr[3];
     TimeStr[7]:=CnvStr[4];
WordToStrWithZeros(Gdt, CnvStr);        // Create Date String
     DateStr[0]:=CnvStr[3];
     DateStr[1]:=CnvStr[4];
     DateStr[2]:='.';
WordToStrWithZeros(Gmn, CnvStr);
     DateStr[3]:=CnvStr[3];
     DateStr[4]:=CnvStr[4];
     DateStr[5]:='.';
WordToStrWithZeros(Gye, CnvStr);
     DateStr[6]:=CnvStr[3];
     DateStr[7]:=CnvStr[4];
end;

Procedure Glcd_Big_Font(var In_Text : String[7]; f_row : byte);              // Parameters: Input String 8chr, start row(page)
begin
            Glcd_Set_Font(@Comic_1_16x8, 16, 8, 48);                         // Ofset 48 (First chr 0)
            For i:=0 to 7 do GLcd_Write_char(In_Text[i],0+(i*16),f_row,1);   // Print String, Raw I   to GLCD
            Glcd_Set_Font(@Comic_2_16x8, 16, 8, 48);                         // Ofset 48 (First chr 0)
            For i:=0 to 7 do GLcd_Write_char(In_Text[i],0+(i*16),f_row+1,1); // Print String, Raw II  to GLCD
            Glcd_Set_Font(@Comic_3_16x8, 16, 8, 48);                         // Ofset 48 (First chr 0)
            For i:=0 to 7 do GLcd_Write_char(In_Text[i],0+(i*16),f_row+2,1); // Print String, Raw III to GLCD
end;

Procedure Write_Time;
begin
    I2C1_start;
    I2C1_wr($D0);           // write to DS1307 RTC
    I2C1_wr($00);           // set pointer to 00
    I2C1_wr(Gsec);          // set sec
    I2C1_wr(Gmin);          // set min
    I2C1_wr(Ghr);           // set hour
    I2C1_wr(Gday);          // set day
    I2C1_wr(Gdt);           // set date
    I2C1_wr(Gmn);           // set month
    I2C1_wr(Gye);           // set year
    I2C1_wr($90);           // set SQW to 1Hz
    I2C1_Stop();
end;

end.
- In GLCD Font Creator v1.1.0, choice font size not bigger then 16x24 matrix.
Try to make correction if you need it, then save new created matrix.

- Now, shrink matrix to 16x8 size, from bottom, and export to ME Compilers.
From generated code, delete first byte of each character row and copy "constant definition"
to your prog. Don't forget to change number of bytes used in const definition.

- Now, load again previous saved complete matrix, then shrink 8 rows from top and 8 rows
from buttom. Now you have middle 16x8 definition. Again export, delete first byte and copy const.

- Reload matrix again, shrink 16 rows from top and do the same with last 16x8 matrix.

How it must look, you can see in my SubProg. Numbers in example are extracted form
COMIC_MS/Bold font, like this way. With little correction in matrix (add/remove dots),
looks good. First try will take some time, but each other will be incredible fast.
Just you need to do it once.

In attachment you can see how it looks.

Best regards
Djani B.

Once more time, my apologize for bad english. I hope it's enough.
Attachments
DSC02248-2.jpg
DSC02248-2.jpg (38.29 KiB) Viewed 8650 times
Beginner.

Post Reply

Return to “Visual GLCD Wish List”