|
Post by pablosl on Jun 4, 2020 21:21:41 GMT -5
Hello,
I want to fill a listbox with the system's Windows fonts. How to do it? Reading the Windows Registry perhaps? Please, post code if you can.
- Pablo
|
|
|
Post by metro on Jun 4, 2020 22:39:19 GMT -5
There maybe other ways but this works for me
gosub [LOADFONTS] nomainwin WindowWidth = 400 WindowHeight = 400 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) listbox #1.list, allFonts$(), [selectionMade], 5, 35, 250, 90 button #1.ab, "Not in use", [p2], UL, 100, 130,200, 20 open "Font Finder" for window as #1 print #1, "trapclose [quit]" wait
[selectionMade] print #1.list, "selection? selection$" notice selection$ + " was chosen" WAIT [p2] wait [quit] close #1 end [LOADFONTS] dim dir$(10,3), allFonts$(3000)
files "C:\windows\Fonts", dir$() qtyFiles = val(dir$(0, 0)) ' print qtyFiles; " files" for x = 1 to qtyFiles allFonts$(x)= left$(dir$(x, 0) + " ", 20) if allFonts$(x) <> "" then ' print allFonts$(x) end if next x RETURN
|
|
|
Post by Rod on Jun 5, 2020 4:44:54 GMT -5
There is of course
fontdialog,f$,fs$
|
|