Finding the size from a font requestor.

BlitzPlus Forums/BlitzPlus Programming/Finding the size from a font requestor.

Simon S(Posted 2004) [#1]
When you use fontrequest there's no problem using the font itself, but is there anyway to find out the point size selected.

The handle just returns a memory address for the font, so I assume it's hidden around there.


Simon S(Posted 2004) [#2]
Oh, I'd also like to find out the bold, italic and underline selections too, if that's possible.


darklordz(Posted 2004) [#3]
would u consider using an external userlib i wrote?


Simon S(Posted 2004) [#4]
I've no problems with userlibs (unless they're unusually large or awkward)

Besides, looks like I have no choice. Both stringheight and fontheight won't work in anything except Graphics x,y,dep. Try it on a canvas, window or bitmap and it returns Invalid B2D buffer or somesuch. Useless for windows apps.


darklordz(Posted 2004) [#5]
hey Si sorry for the late reply i forgot all about it. This is a lob iwrote a year ago... http://81.173.33.17/balpoint.com/files/Requester.rar ive updated it many times since and from what ive heard this is beeing used @ db forums as well. samples included...

good luck...


Simon S(Posted 2004) [#6]
Damn, it looks great. A file requestor where defining the default path actually works. What a revelation! It's good work, thanks for that.

Unfortunatly the one thing I want isn't working. When it tries to call FontRequest it says "Incorrect Function Return Type", for some reason it's being overriden by the default FontRequest command.

Any ideas?


Simon S(Posted 2004) [#7]
On further study this also effects the colorrequest (another internal command). The rest works perfectly though, and I'll definitly use it in any further apps that need file requests. Perhaps some different names for font and colour requests?

Of course I may have messed up activating the userlib.
I copied the decs to the userlibs directory and put the dll into my programs directory. Is this right? I've not had much experience of userlibs.


darklordz(Posted 2004) [#8]
@Simon S It' simple i'll rename the commands :P....
Then they wont mock up the internal cmd's. I did do that in the feature packed v2.0 but due to a system metldown i lost he code this is all i had on backup cd i'll rrange it l8tr in the afternoon..


darklordz(Posted 2004) [#9]
Alter the decls file like this
.lib "Requester.dll"

; Requester Functions...
Req_RequestColor$():"RequestColor"
Req_RequestFont$(iFontName$, iFontSize, iFlags):"RequestFont"
Req_RequestInput$(iTitle$, iMessage$, iDefaultText$):"RequestInput"
Req_RequestMessage$(iTitle$, iText$, iFlags):"RequestMessage"
Req_RequestOpenFile$(Title$, DefaultFile$, Pattern$, PatternPosition, Flags):"RequestOpenFile"
Req_RequestPath$(Title$, InitialPath$):"RequestPath"
Req_RequestSaveFile$(Title$, DefaultFile$, Pattern$, PatternPosition):"RequestSaveFile"
Req_RequestFileExtension$(FilePath$):"RequestFileExtension"
Req_RequestFileFileName$(FilePath$):"RequestFileFileName"
Req_RequestFilePath$(FilePath$):"RequestFilePath"


Now all commands have the Req_ extention...


Simon S(Posted 2004) [#10]
Thanks. A cunning fix and it works perfectly. The lib is a good addition to blitz. Maybe you should add it to the userlib code archives?


darklordz(Posted 2004) [#11]
when i rewrite v2.0 witch had about 30 more feature i will!