[futurebasic] Font ID

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: scram@... (Stu Cram)
Date: Fri, 8 Oct 1999 07:57:29 -0700
Brian Heibert wrote:

>Well I need to know what font # Ariel is.
>because I want to use it my program.
>Does anyone know how I can find out?
>I've tried TEXT _Ariel,12,0,0
>It works if I would type TEXT _Helvetica (similar),12,0,0
>but not with Ariel & I just so happen to be picky this time.

1) _Ariel (or _Arial) is not a predefined constant in FB.
2) Use a variable such as myFont% for the font number of
   other fonts and get its internal number as follows:

        CALL GETFNUM( "Arial", myFont% )
        IF myFont% = 0 THEN ... << FN doMissingFontRoutine >>
        TEXT myFont%,12,0,0

3) This will always use the # of the designated font as
   assigned by your system. I get 2001 for Arial but...
   these numbers are not guaranteed to be the same for
   all time and all systems as you add/replace fonts.
   This call will always match your values.
   - This approach can let the user choose a font name
   from a menu and then your program can convert it into
   a useable font number for the TEXT instruction.
4) Be sure to use the official spelling name of the font.
5) You should check that the font is actually installed
   to have a fail-safe program. Unknown font names give a
   result of 0 causing the system font to be used.


Hope this helps
- Stu Cram, Regina, SK CANADA