I cannot get X font to load any fonts.
I have tried moving the fonts to C:\fonts and changing the path
but i still get file not found error.
Any help would be appreciated.
Billythebarge.
X font
-
- Posts: 489
- Joined: Apr 18, 2008 4:09
- Location: Los Angeles, CA
- Contact:
Have you seen the documentation and examples at this site ?
http://xaviorsoft.freebasic.net/fbproduct/index.html
http://xaviorsoft.freebasic.net/fbproduct/index.html
X font
Yes I have dowloaded the doc and the examples.
Its those examples that do not load the fonts.
Using the font.fontname it says default.
Do I need a special font lib for xfonts as the file "xfont" set in the example
dose not seem to exist."C:\Program Files\FreeBASIC\inc\xfont\"
Thanks for answering.
Billythebarge.
Its those examples that do not load the fonts.
Using the font.fontname it says default.
Do I need a special font lib for xfonts as the file "xfont" set in the example
dose not seem to exist."C:\Program Files\FreeBASIC\inc\xfont\"
Thanks for answering.
Billythebarge.
x font
I have done as you sugested but I still get the same results.
First with fbide version 0.4.6 and again with
FbEdit version 1.0.7
This is the code I am using,maybe I have missed somthing.
#Include Once "xfont.bi"
Dim Shared As xfont.interface font
ScreenRes 640,480,32
font.loadfont ("c:\xfonts\fonts/gigi", 1)
if font.loadfont("c:\xfonts\fonts/gigi",1) then
Print "LoadFont Error. File not found."
End If
font.fontindex = 1
font.forecolor=rgb(200,100,200)
font.backcolor=rgb(100,200,100)
font.drawstring (," Hello World! ",10,10,2,2)
print font.fontname
Sleep
Billythebarge.
First with fbide version 0.4.6 and again with
FbEdit version 1.0.7
This is the code I am using,maybe I have missed somthing.
#Include Once "xfont.bi"
Dim Shared As xfont.interface font
ScreenRes 640,480,32
font.loadfont ("c:\xfonts\fonts/gigi", 1)
if font.loadfont("c:\xfonts\fonts/gigi",1) then
Print "LoadFont Error. File not found."
End If
font.fontindex = 1
font.forecolor=rgb(200,100,200)
font.backcolor=rgb(100,200,100)
font.drawstring (," Hello World! ",10,10,2,2)
print font.fontname
Sleep
Billythebarge.
-
- Posts: 489
- Joined: Apr 18, 2008 4:09
- Location: Los Angeles, CA
- Contact:
Try This
The xFont Zip for Win32 contains a sample font file, freesans.xf. To run from FBIde, first make sure you save the code of this example program to your default FB folder which also contains freessans.xf.
Code: Select all
#Include Once "xfont.bi"
Dim Shared As xfont.interface font
Dim as integer id
ScreenRes 640,480,32
IF font.loadfont("freesans.xf",1) = -1 Then
Print "Font not found"
end if
font.fontindex = 1
font.forecolor=rgb(200,100,200)
font.backcolor=rgb(200,200,100)
font.drawstring (," Hello World! ",10,20,2,2)
print font.fontname
Sleep
I also resolved the font problem by substituting freesans.xf, and compiling with FBC version 0.21.0 (03-09-2009) for win32 (target:win32), and this batch file:
And using the Windows version of xfont and running under Windows 2000, the source compiles without error and the EXE runs OK.
Code: Select all
"c:\Program Files\freeBASIC\fbc" -v -C -R -s gui test.bas
pause
xfont
Yes your code works fine.
Dose this mean that i can't use normal window fonts
with xfont.
Dose this mean that i can't use normal window fonts
with xfont.