Inverse text with GLCD module

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

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

Inverse text with GLCD module

Post by rmteo » Mon Oct 20, 2008 6:16 pm

Is there a way to display text in inverse with the GLCD module (KS0108)?

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Mon Oct 20, 2008 6:52 pm

Hello,
from Swordfish help file in GLCD section:
structure TFont

Header as word

Data as word

Width as byte

Height as byte

Style as byte

LetterSpacing as byte

NumberOfChars as Header.Byte1

IsFixed as Header.Booleans(0)

IsVariable as Header.Booleans(1)

IsScanX as Header.Booleans(6)

IsScanY as Header.Booleans(7)

end structure

Header - The font header
Data - Start address of the font data table
Width - The font width, in pixels. For variable width fonts, this value is 0.
Height - The font height, in pixels.
Style - The font style. Can be fsNormal, fsMerge, fsXOR or fsInvert. Please note that different GLCD drivers may only allow a subset of font styles to be used or none at all. You should refer to specific driver documentation for information on supported font styles.
LetterSpacing - The distance between font characters, in pixels.
NumberOfChars - The number of characters in a font table.
IsFixed - Font fixed width flag
IsVariable - Font variable width flag
IsScanX - Font data is scanned along x flag
IsScanY - Font data is scanned along y flag
Regards
octal

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

Post by rmteo » Mon Oct 20, 2008 7:01 pm

Thank you. Also, is there a way to filled rectangles?

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Mon Oct 20, 2008 7:03 pm

rmteo wrote:Thank you. Also, is there a way to filled rectangles?

You already asked for that a long time ago :wink:

http://www.sfcompiler.co.uk/forum/viewt ... +rectangle

Regards
octal

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

Post by rmteo » Mon Oct 20, 2008 8:15 pm

Sorry, about that. I know that it can be done by drawing lines - that is the way I have always been doing it. I was just wondering if it could be done using SF primitives. Something like this (would be nice if it can also be done for circles and ellipses):

Code: Select all

brush.style = bssolid    ' Draw a filled rectangle
glcd.rectangle(0,0,127,63)

brush.style = bsclear    ' Draw outline only
glcd.rectangle(0,0,127,63)

Post Reply