[futurebasic] Re: Font Info

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1998 : Group Archive : Group : All Groups

From: BMichael@...
Date: Mon, 28 Sep 1998 02:15:50 EDT
>How can I make a EDIT FIELD, that displays all the fonts in the system?
>
>I can't just add a FONT menu, my program needs them in a edit field.

This is a "brute force" method... you'd do better by counting the 
available "FOND" resources and getting their id's one at a time, the 
using that id instead of the "i%" below;

  EDIT FIELD -1,"Fonts",(14,52)-(495,297),_statFramed,_leftJust
  hdl& = TEHANDLE(WINDOW(_efNum))
  LONG IF hdl&
    BLOCKMOVE [hdl&],@rect,8
    FOR i% = 0 TO 32766
      CALL GETFONTNAME(i%,fntNm$)
      LONG IF fntNm$ <> ""
        TEXT i%,12
        fntNm$ = fntNm$ + CHR$(13)
        CALL TESETSELECT(32767,32767,hdl&)
        CALL TEINSERT(@fntNm$+1,LEN(fntNm$),hdl&)
      END IF
    NEXT temp%
    TEKEY$ = CHR$(13)
    CALL TESETSELECT(0,32767,hdl&)
    AUTOCLIP = _false
    CALL TEUPDATE(rect,hdl&)
    AUTOCLIP = _true
    CALL TEAUTOVIEW(_zTrue,hdl&)
  END IF

Note: I did _not_ compile and test this... it may not work "as written", 
so be careful...

Bill