Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Font Problem

Author
Message
PeterLewis
21
Years of Service
User Offline
Joined: 27th Sep 2003
Location: South Africa
Posted: 17th Oct 2003 22:17
I have trie to load a font to use but it just gives me a standard font
The code I used is below

Can anyone help.

This font is a .ttf file and it seems like it loads ok - no error messages
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 17th Oct 2003 23:22
Make sure the font is actually installed in Windows, i.e. you can select it when you are using a text editor, otherwise it wont work here, as DB doesnt load individual font files as far as I'm aware.

I would be unstoppable if I could just get started...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Oct 2003 23:29
If the font is not installed into windows then you can force windows to load the font by dropping it's file into your game/program folder and using the following two functions to load/unload the file so that you can access the font you want



Warning: If your program ends without you calling the UnloadFont function then you will be unable to remove or move the font file until you reboot windows.
PeterLewis
21
Years of Service
User Offline
Joined: 27th Sep 2003
Location: South Africa
Posted: 19th Oct 2003 04:12
Thanks I eventually got the font to load. The file name and the font name were 2 different things.

Another problem arose !!!!

I load a full screen graphic as a sprite with alpha channels
When I try to write to the screen some text--- the screen moves up and the text is at the bottom left hand corner.

It does not matter what set cursor values I use. I have tried many other ways but then the text dissapears

If the text is not in a loop is does not display

Please help

Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Oct 2003 15:29 Edited at: 19th Oct 2003 15:29
It's called 'scrolling'

When the print command reaches the bottom of the screen, it will move everything up one line - including any graphics you have drawn

Put the SET CURSOR command inside your loop (so that it is reset each time you print) and it will work fine.
PeterLewis
21
Years of Service
User Offline
Joined: 27th Sep 2003
Location: South Africa
Posted: 19th Oct 2003 17:21
Thanks, please bear wth me I have not programmmed for at least 10 years

Login to post a reply

Server time is: 2024-11-25 12:52:11
Your offset time is: 2024-11-25 12:52:11