Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Symbol.ttf Font not showing in VFP

Status
Not open for further replies.

Koen Piller

Programmer
Jun 30, 2005
841
NL
Hi,
Using OS(10) with VFP9SP2.
The font Symbol is not showing in my VFP application, it is present in my C:\Windows\Fonts and working in all Office applications like MSWord a.s.o.

It seems this font is a Greek font, have therefore in my control panel, under fontsettings ticked the checkbox "hide fonts based on language settings" without effect on Symbol.ttf


Have now also installed it in my application folder for which I would like to use this font, no effect. Have than tried to install it with
Code:
Declare Long AddFontResource In Gdi32 String lpFileName
*!*At startup load fonts

Local cFileName, cHomeDir
lcMyAppHome = FULLPATh(tcAppHome)
lcHomeDir = Addbs(lcApphome)
lcFileName = Sys(2000, m.lcHomeDir + '*.TTF')   && If Fonts are in <tcAppName> directory
Do While !Empty(lcFileName)
	AddFontResource(m.lcHomeDir + m.lcFileName)
	cFileName = Sys(2000, '', 1)
Enddo
However also this did not give the desired result.
How could I make use of this Font?
Regards,
Koen
 
Not every font is VFP compatible.

You can get at Greek letters via the Arial Unicode MS font and FontScript:
Code:
_screen.FontName = "Arial Unicode MS"
_screen.FontCharSet = 161
?
FOR i = 225 TO 254
?? CHR(i)
endfor

And there are capital Greek letters, too.

How to get 161? Interactively type into the command window: _screen.fontcharset = and then click on the Fontpicker appearing.
Or call GETFONT("Arial Unicode MS",20,"Standard",0). You have to specify the nFontCharset parameter and the result will contain the picked one. Also, the FontCharSet property help topic contains some FontCharSet values.

Bye, Olaf.
 
Olaf,

So Symbol.ttf is not compatible with VFP?
I was not looking for chr(161), I am looking for a font which has the cardsymbols and normal numbers, like in Symbol.ttf
SYmbolttf_uprgjp.jpg

Do you have knowledge of an other, compatible font with VFP, with these?
Regards,
Koen
 
Yes, "Symbol" also isn't appearing in my fontlist

FontCharSet 161 does not mean CHR(161), not at all, please reread what I wrote. You already have your answer and possibility.
FontCahrSet also is a property of eg the Textbox, not only of _Screen.

Bye, Olaf.
 
This is strange. I've used Symbol several times in my applications. It shows up both in the GetFont() dialogue and under Fontname in the Properties windows.

What am I doing wrong?


Cap1_vmsfqe.jpg


Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I don't know, but funny enough, I just executed AFONT() to show the two nearest neighbors before and after Symbol are Sylfaen and System and are direct neighbor elements.
Now Symbol is among them, I can set _screen.Fontname="Symbol" and get alphabetachi from printing "abc".

It also works after restart of VFP without redoing AFONT(). As if AFONT() registers something for usage of fonts for VFP.

Bye, Olaf.



 
Olaf,
I confirm, afonts() and getfont() both show 'Symbol'. However I am still incapable to select Font Symbol for my label, the combobox activating the property FontName does not show Symbol. I will now try to activate the font not by OOP but by code. Funny.
Or do you have an alternative way to set the caption of my label to font Symbol?
I suppose this is something with latest OS() as I am, like Mike, sure I used to use this font in the past.
Following code makes use Symbol font and shows the requested signs.
Code:
clea 
_screen.FontName = "Symbol"
FOR i = 167 TO 170
?? CHR(i)
endfor

so now I hardcoded in my label, textbox a.s.o. in the init
Code:
This.FontName = 'Symbol'

which is working. Seems to me the combobox for Fontname has a bug.
Regards,
Koen

 
I don't know if this is relevant, but I see there are two Symbol fonts in my Fonts directory: Symbol.TTF and Symbol.FON. I assume the FON file is a left-over from Windows 3.x, and that Windows (and therefore VFP) will now always use the TTF.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Code:
. Now I have to figure out how to show it on my label, grid-header, textbox a.s.o.

It should be possible to do it both interactively and programmatically.

So, for a grid, you should be able to simply set the grid's Fontname in the Properties window. That will apply the font to the whole of the grid, including column headers. Or you could do it programmatically, for example in the grid'd Init:

[tt]THIS.FontName = "Symbol"[/tt]

Similarly for all the other controls that have a Fontname property.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi,
to select the font "Symbol" for your object (label a.s.o.) we have 2 possibilities, provided the font is installed ofcourse:

1) in code in e.g. init "This.FontName = Symbol"
2) in the property editor select/click on FontCharSet, here you are presented with a lookup-form with all available fonts inclusive "Symbol" and others which are not shown when you select/click on FontName
Regards,

Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top