FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

FONTS

List all the available fonts


Frank Turovich posted on his site a function to get the fonts from the System. In my program MacAutoFormat I modified this and call it and then write the resulting list to a file with;

PRINT #2, "{\fonttbl "
FN getFONTLIST
PRINT #2, "}"

(The fonttbl and brackets are because I am writing RTF coding here)

Replace the above piece of code with that necessary to write it out in an edit field.

LOCAL FN getFONTLIST 'Thank Frank for this function
  DIM fontName$(100)
  DIM origRes
  origRes=FN CURRESFILE
'don't load; just look
  CALL SETRESLOAD(_false)
'get res count
  theCount=FN COUNTRESOURCES(_"FOND")
'get each res handle and info
  FOR i = 1 TO theCount
    rHndl&=FN GETINDRESOURCE(_"FOND",i)
    fontName$=rName$
    CALL GETRESINFO(rHndl&,rID,rType&,rName$)
'fontName$(i)=rName$
    longID$=STR$(rID)
    P=LEN(longID$)
    ID$=RIGHT$(longID$,P-1)
    PRINT #2, "{\f"+ID$+"\froman "+rName$+";}" 'modify this to print
'to your edit field
'this is RTF fontbl code
'for my program
  NEXT
'restore normal res loading
  CALL SETRESLOAD(_zTrue)
'put things back like we found them
END FN

LOCAL FN fontTable$ 'create your own code to put in edit field
  PRINT #2, "{\fonttbl "
  FN getFONTLIST
  PRINT #2, "}"
END FN

Bob Bryce