It is currently 20 Oct 2018 09:03

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 15 Jan 2013 15:47 
Offline

Joined: 12 May 2007 13:01
Posts: 171
Location: Bristol, UK
From MikroElektronika GLCD Font Creator V1.2.0.0 Help FAQ
Quote:
Can I create fonts with variable chars width?
Yes of course. But in design time, all chars are the same width. At EXPORT TIME you can choose to export your fonts in FIXED font width or in PROPORTIONAL font width (in this later case, jump tables are automatically computed and inserted in generated source code).

I can't see this option in the Export box and at the bottom of this thread: http://www.mikroe.com/forum/viewtopic.php?f=88&t=22432&hilit=fixed+width+font this is confirmed in a post by LGR:
Quote:
You have to manually edit it, and remove the width. But the choice between how to display fixed and proportional is in you code. It's just as easy to do it proportional.

I have tried editing the top line of a proportional font '$82, $60, $00, $1C' using janni's description in uGLCD help without success:
Quote:
Font file structure

header
byte 0 - $81 - fixed font, $82 - variable-width font
(bit 3 set ($89,$8A) means extended header)
byte 1 - No of chars in font table
byte 2 - width of char (0 for variable-width font)
byte 3 - height of char

How do I create a fixed width font ?


Top
 Profile  
 
PostPosted: 15 Jan 2013 17:14 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Indeed, GLCD Font Creator allows to export fonts in fixed-width format only if font height does not exceed 8 pixels. Unfortunately, my program, uGLCDfonts, follows what GLCD Font Creator produced.

There are two solutions. One which I, in my laziness :wink: , use - simply changing the first column where necessary (mostly digits and space for ease of use when displaying numbers) to constant value in variable-width font table produced by GLCD Font Creator - before applying uGLCDfonts. Obtained font is, naturally, of variable-width type but with chosen fonts or all fonts of equal width.

The second solution requires removal of first column in variable-width font table produced by GLCD Font Creator (exported for GLCD, not for new library) and change of the sentence
//WARNING: This Font Require X-GLCD Lib.
in font file description to
//WARNING: This Font is usable only with MikroE GLCD Lib.
as uGLCDfonts uses it to differentiate between fixed- and variable-width font files.

I will think of a simpler solution where uGLCDfonts program would have an option to produce fixed-width font table from variable-width one obtained from GLCD Font Creator.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 15 Jan 2013 20:28 
Offline

Joined: 12 May 2007 13:01
Posts: 171
Location: Bristol, UK
Thanks janni :D

First solution did the trick and quite simple as the only number I needed to change was '1' as all the others were the same width.

Having a hybrid of fixed width numbers and selected characters only, is quite handy as the reduced width of some characters like 'i' and ':' adds up to more characters which can be fitted on a single line of the display.


Top
 Profile  
 
PostPosted: 15 Jan 2013 22:01 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Malcolm_M wrote:
Having a hybrid of fixed width numbers and selected characters only, is quite handy as the reduced width of some characters like 'i' and ':' adds up to more characters which can be fitted on a single line of the display.
That's what I always thought :) and that's why I didn't have a need for larger fonts in fixed-width format.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 05 Sep 2017 15:34 
Offline

Joined: 05 Sep 2017 15:30
Posts: 2
Hello janni i am trying to reach you out for a specific problem that i encounter in uGLCD library.
Btw its completely perfect work.
I am kinda new to programming PIC's so my problem seems funny to you but i am having problems while i draw rectangles on screen. I can post some screenshots or something else.
Ill be very glad if you can reach me out.


Top
 Profile  
 
PostPosted: 06 Sep 2017 12:16 
Offline

Joined: 05 Sep 2017 15:30
Posts: 2
Actually my problem is not with circles squares etc. Also while writing a text.
For example i simply draw a line on horizontal axis of the screen. When i do that i see extralines goes 2 pixels above the line and then 1 and 2 again.
When i draw line between x= 0 to 31 its okey when i do this like x=0 to 64 an extra line occurs like 2 pixel above the original line with start point x2=32 when x2 goes to 96 1 more line 1 pixel above comes up for point x2= 63.
I see this on like all routines and about to lose it. :( Wirte_Char function is working well for me now but the other routines comes with this problem. I'll be very glad if someone can help me out
Thanks in advance.


Top
 Profile  
 
PostPosted: 07 Sep 2017 17:44 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Hi,
I'll gladly help but more info is needed. What kind of GLCD you use? Exactly which functions cause the effects you mention?

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: