Font invert

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Font invert

Post by Mast » Wed Aug 29, 2007 3:39 pm

How can i invert the font with this line (black background), i don't andestand the help topic

GLCD.SetFont(ArialBold)
GLCD.WriteAt(60,40,"ALARME")

thanks

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

Post by octal » Wed Aug 29, 2007 3:47 pm

From Swordfish help ....
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
you have to set the font style fsXOR I think.
Font as TFont

The graphics Font variable holds information about the currently loaded font. It also enables certain rendering characteristics of the font to be changed. For example, style and letter spacing. Note that different GLCD drivers may only allow a subset of font members to be used. You should refer to specific driver documentation for further information.
Regards
Octal

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Wed Aug 29, 2007 4:29 pm

I need example line please

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Aug 29, 2007 5:00 pm

Ensure that you have both of these includes at the top (after the device & clock settings):

Code: Select all

Include "Graphics.bas"
Include "GLCD.bas"
Then use:

Code: Select all

SetFont(ArialBold)
Font.Style = fsInvert
Steve

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Wed Aug 29, 2007 10:27 pm

I have a error : Function call expected with this line : Font.style (fsinvert)

Code: Select all

Sub alarme1 ()
GLCD.Cls
GLCD.SetImage(0,0,alarme)
text = DecToStr(t)
GLCD.SetFont(Arial13x12)
Font.Style (fsInvert)
GLCD.WriteAt(80,10,text)
[quote="Steven"]Ensure that you have both of these includes at the top (after the device & clock settings):

Code: Select all

Include "Graphics.bas"
Include "GLCD.bas"
Then use:

Code: Select all

SetFont(ArialBold)
Font.Style = fsInvert

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Aug 29, 2007 10:33 pm

It's Font.Style = fsInvert, not Font.Style (fsInvert). You are setting the value of a public variable (Style) in the structure Font.

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Wed Aug 29, 2007 10:55 pm

Excuse me Steven :cry: Now it's ok

I try your compiler, so with eeprom, string, adc ....

but , for now it's a very good compiler, with my 192x64

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Aug 29, 2007 11:29 pm

The more you use Swordfish, the more you will like it I think.

Best wishes,

Steve

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

Post by octal » Thu Aug 30, 2007 4:09 am

Steven wrote:The more you use Swordfish, the more you will like it I think.
:twisted: I confirm that ... this Swordfish fish you instead of being fished :o :o :o

Octal

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Thu Aug 30, 2007 6:41 am

With and Without Flash.

Image

Image

Image

Image

Image

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Thu Aug 30, 2007 7:11 am

That's impressive progress! What is your project?

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Post by Mast » Thu Aug 30, 2007 7:21 am

1 day to modify my Mikroe :evil: code for SF :lol: code.

My project, is for my 4x4. Temp sensor on the shocks, water, oil, and other. cause i go to tunisia in 2008, and it's very high temp for shocks. So if want return in france, it's a good system for slow drive

Sorry for my english, but the scool is....longuer ?

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

Post by octal » Thu Aug 30, 2007 7:54 am

Hey Mast,
photos are really impressive. Once your system finished, it would be nice to post something about the final project (description+photos) on the Featured Products page of the Swordfish WIKI http://www.sfcompiler.co.uk/wiki/pmwiki ... edProducts

Please Mast, do it before going to Tunisia, because if your code does not work fine ... your 4x4 will burn :( and it will take a lot of time to you to come back on a camel :D

Mast
Posts: 65
Joined: Wed Aug 29, 2007 6:24 am
Location: France

Good news

Post by Mast » Tue Sep 04, 2007 7:32 am

Weel, i purchase SF. i waiting for.

Mast

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

Post by octal » Tue Sep 04, 2007 7:50 am

hehehe ... you have been (sword)fished .... :o a new converted user :twisted: I'm becoming Swordfish Evangelist :o


btw. I cleaned up the code for 192x64 GLCD Module. The code will be published this afternoon (I hope) to let users have the possibility to use GLCDs with CS3 line. Steven gave me instead a totally rewritten (deeply modified) for SED1520 modules that can work for GLCDs with two or three CS lines. I'm trying to modify it a bit and to test it before I publish final version.

Regards
Octal

Post Reply