GLCD Inverted text oddity

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

GLCD Inverted text oddity

Post by Francis » Thu Dec 04, 2008 8:59 pm

18F4520. EasyPIC4. KS0108 GLCD.

I'm confused by the Pen.style command.

Example Code. (NB. GLCD Inits fine).

Code: Select all

    for i=0 to 63                       // Fill the GLCD screen
        glcd.line(0,i,127,I)
    next
    GLCD.SetFont(ErasDemiITC14)         // Set a font
    pen.style=fsinvert                  // Set pen to Invert
    GLCD.WriteAt(5,3,"HELLO")           // Write first HELLO
    SetFont(Arial18)                   // Set to Font Arial 
    //font.Style=fsInvert               // Set it to inverse again.. it works. Eh?
    glcd.writeat(20,30,"HELLO")     // Write Second HELLO
    while true
    wend
Produces this:-
Image

and if I un-comment the line

Code: Select all

  font.Style=fsInvert               // Set it to inverse again.. it works. Eh?
I get this:-
Image

Surely my first "HELLO" should come out like the second "HELLO" shown above.

for the first font.style, the value can be anything and it stays the same.
It's as though it gets ignored.

Have I put it in the wrong place?
I'd be very grateful if someone cn put me straight, there's nothing in help, examples or, as far as i can find, on the Forum.
Thanks.

PS. Please excuse wobbly images, hand held long exposure.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Thu Dec 04, 2008 10:05 pm

This is something I have come across as well. Every time you change fonts, you have to set fsinvert - otherwise it will revert to normal mode.

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Thu Dec 04, 2008 10:28 pm

Yes, and I have just realised I got pen.style and font.style muddled. argh.

I'm not making excuses (honest) but this could be made clearer in the Help. Yes, I know you can find it out if you try really hard but for niwits (like me) it should be explained better - especially as I still use a Pen for writing - as well as drawing.

Post Reply