Hi - there exists a dialog box to facilitate the selection of a font name, style and size in JMP, which can be accessed when you customize the labels of a chart, for example. It supplies a list of all the fonts installed in Windows, and shows you what each one looks like when you click on it.
I want to use a dialog very much like that in some JSL script I'm working on at the moment. Can anyone tell me where I can find the script used to create the one supplied within JMP, please? Alternatively, can anyone tell me how to access a list of all the fonts installed on my PC using JSL? If I can do that, building the necessary dialog box from scratch would be a simple task.
Many thanks
JMP just has access to the fonts that are installed.
In Windows, I think the fonts are in c:\Windows\Fonts
I suppose you could just get the files names in that directory and you'd be 80% there.
The last 20% is determining the font name from the file name. (Not sure how to do that.)
https://superuser.com/questions/760627/how-to-list-installed-font-families has a discussion too.
This will work in Windows.
Names Default To Here( 1 );
fonts={};
flist={};
flist=Files In Directory( "c:\Windows\Fonts" );
for(i=1, i<=nitems(flist), i++,
if( lowercase(item( 2, flist[i], "."))=="fon"|
lowercase(item( 2, flist[i], "."))=="ttf"
,insert into(fonts,item( 1, flist[i], ".")))
);
show(fonts);