Visual GLCD and Right Justification of Variable

General discussion on Visual GLCD Software.
Author
Message
dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Visual GLCD and Right Justification of Variable

#1 Post by dsiegel » 14 Sep 2012 14:14

I'm trying to produce a display (T6963C 128x128) with a large variable display (i.e. a weight) which is right justified.

Adjust Bed >
Weight Change >
+123.4 kg Print >
etc. >

I am unable to find a fixed width font that can be used with Visual GLCD.
Does anyone know of a work-around?

This display also needs multiple language screens for each screen and it would be nice to replace the label caption with strcpy
while keeping the right justified text in-line for the push buttons (on the right side, sorry left-handers)

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#2 Post by dsiegel » 14 Sep 2012 14:16

Interesting, even this forum strips out the spaces.

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Visual GLCD and Right Justification of Variable

#3 Post by janko.kaljevic » 18 Sep 2012 15:37

Hello,

In order to use Fixed width font you will have to choose font which is designed this way.
Also in VisualGLCD Tool you should un check One Pixel Space Width box.
To do this go to:
Settings->Advanced Settings->General tab

Best regards.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#4 Post by dsiegel » 24 Sep 2012 15:56

Sorry for the hiatus, had to upgrade to Win7x64.
I've tried using a known monospaced/fixed width font Bitstream Vera Sans Mono.
The text in Visual GLCD shows a full width space, but once compiled, my display shows a infintessimal space.

The settings has One Pixel Space Width un-checked, as does the *.vglcd:
//FONT SPACE OPTIONS
ONE_PIXEL_SPACE_WIDTH = False

The font in _events_code.c does show a fixed number of bytes
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Code for char num 32
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00, // Code for char num 33

I suspect there is some mechanism to proportionalize the fonts after the fact.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#5 Post by dsiegel » 25 Sep 2012 12:42

I just stepped the font size up to 28 (Bitstream Vera Sans Mono)
const code char Bitstream_Vera_SansMono22x43_Regular[]
' ' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Code for char num 32 *SPACE*
'!' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Code for char num 33
'M' 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x1F,0xFC,0x80,0x1F,0xFC,0x80,0x1F,0xFC,0x80,0x1F,0xFC,0xC1,0x1F,0xBC,0xC1,0x1E,0xBC,0xC1,0x1E,0xBC,0xE3,0x1E,0xBC,0xE3,0x1E,0x3C,0x63,0x1E,0x3C,0x77,0x1E,0x3C,0x77,0x1E,0x3C,0x36,0x1E,0x3C,0x3E,0x1E,0x3C,0x3E,0x1E,0x3C,0x1C,0x1E,0x3C,0x1C,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x3C,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // Code for char num 77

Do I need to pack the characters myself?
If so, what is the framework for a font?
And how do I force the space to be a full character width?
It does appear that Visual GLCD proportionalizes the font, and the compiler also changes the space to a single column regardless.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#6 Post by dsiegel » 26 Sep 2012 17:43

I have established:
Using Visual GLCD using the T6963C with mikroCpro for pic32 generates a space width of only 1 bit even when not configured to do so.
The choice of mono-spaced/fixed width fonts still generates fonts of variable width in the _resources.c file.
I cannot generate a font greater than 8 bits high for the T6963C using GLCD font creator.
And I have no idea what the format for a defining font would be.
Ergo, I cannot right justify a volatile string or number using these products.

I cast down the gauntlet, prove me wrong!

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: Visual GLCD and Right Justification of Variable

#7 Post by janko.kaljevic » 28 Sep 2012 16:46

Hello,

The problem with representing fonts on VisuaGLCD is total screen resolution.
On your VisualGLCD application fonts are represented the they are, and usually screen resolution is much higher then on GLCD.

Font creator needs to decide whether a font should take a specific pixel or not (because it can not occupy half of a pixel).
So some letters are truncated and some are extended. This is very small difference, but noticeable on large strings.

In your case you can use button in order to right justify your variables.
Just place button instead of a label (You can set edges of a button as background color so it will not be visible).
Then set right text align to right. This should help you to right align your text.

Best regards.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#8 Post by dsiegel » 01 Oct 2012 13:25

Correct, the button allows for right and left justification (also center).
Can this not be grafted onto the Label command????
This way we do not give the indication that you should press the screen.

Wrong answer for the single pixel spacing, If you use a fixed width font,
you get a single pixel space regardless of the settings check box in the real life output.
(Also the checkbox has no effect in the computer graphical display (always a multi-pixel space for a fixed width font))

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#9 Post by dsiegel » 01 Oct 2012 13:27

Another thought....
If adding justification to Label raises compatibility issues, add a Text command with justification.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#10 Post by dsiegel » 01 Oct 2012 13:46

Now, on to the Monospaced/fixed-width issue.
I used GLCD Font creator to import a fixed width font,
Bitstream Vera Sans Mono, 20 ems, and copied the output from export for GLCD.
I then tacked on the header from export for X-GLCD and tweaked the jump table
and character widths.
I can use the adv_text commands to achieve right and left justified screens.

What would it take to prevent Visual GLCD/GLCD Font Creator to NOT proportionalize?
There are obviously subroutines that repack the font and add the jump table info.
Could you not skip the repacking of the character array and implement the jump table
as a constant character width and uniform jump increments?

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#11 Post by dsiegel » 01 Oct 2012 13:47

I actually think this product is much needed, I want to help make it a great product.

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#12 Post by dsiegel » 01 Oct 2012 17:23

I'm looking at the button, and other than editing the user code, I don't see a background color.
(at least in the T6963C monochrome).

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#13 Post by dsiegel » 12 Jun 2014 19:56

Coming back after 2 years with a new project that requires a graphical display.
Any prognosis on the bug fix edition?
Proportional/NonProportional Fonts (especially non-proportional)
T6393C

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: Visual GLCD and Right Justification of Variable

#14 Post by Megahurts » 26 Jun 2014 13:22

Hi dsiegel,

If you have not fully explored the option of using a button instead of a label to display data that changes, then maybe this can help you to try it again.

If you use a button for displaying anything, text or numbers (numbers require converting to string first) that change during the programs
running, you won't have to write erase code that using a label requires in order to get rid of the old data displayed before drawing new data*,
the button takes care of that automatically due to the way they are drawn.
*(at least it is required to do with TFT displays and using V-TFT labels, not sure with GLCDs and V-GLCD labels)

You can change the properties of the button to make it visually different from the other buttons that are to be pressed so users won't be confused,
and making them so they are not active will give no indication pressing it does anything, so users won't try again after getting no response.
Or use one type (either rounded or normal), for the ones to be pressed as buttons and the other for displaying changing data
and this might be enough difference visually so there is no confusion for the user?

The buttons having the justification settings gives them an edge over using labels also as stated above.

Both V-GLCD and V-TFT have this issue with the Label component and has not been addressed yet, so getting creative with the other components
and their usage has been the most used methodology by users.

Hope this helps you out anyway, Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

dsiegel
Posts: 38
Joined: 21 Aug 2012 15:10

Re: Visual GLCD and Right Justification of Variable

#15 Post by dsiegel » 27 Jan 2015 13:44

Checking in to see how the next update is coming.
i.e. TC6963 fix
non-proportional font fix
right justification

Post Reply

Return to “Visual GLCD General”