獲取所有已安裝字體的列表嗨 - 存在一個對話框,便於在JMP中選擇字體名稱,樣式和大小,例如,可以在自定義圖表標籤時訪問。它提供了Windows中安裝的所有字體的列表,並顯示了單擊它時每個字體的外觀。
我想在我正在研究的一些JSL腳本中使用非常類似的對話框。任何人都可以告訴我在哪裡可以找到用於創建JMP中提供的腳本的腳本,好嗎?或者,任何人都可以告訴我如何使用JSL訪問我的PC上安裝的所有字體的列表?如果我能做到這一點,從頭開始構建必要的對話框將是一項簡單的任務。
非常感謝
Re:獲取所有已安裝字體的列表這適用於Windows。
<SPAN class="token function">Names Default To Here</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
fonts<SPAN class="token operator">=</SPAN><SPAN class="token punctuation">{</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">;</SPAN>
flist<SPAN class="token operator">=</SPAN><SPAN class="token punctuation">{</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">;</SPAN>
flist<SPAN class="token operator">=</SPAN><SPAN class="token function">Files In Directory</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"c:\Windows\Fonts"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">for</SPAN><SPAN class="token punctuation">(</SPAN>i<SPAN class="token operator">=</SPAN><SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> i<SPAN class="token operator"><=</SPAN><SPAN class="token function">nitems</SPAN><SPAN class="token punctuation">(</SPAN>flist<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> i<SPAN class="token operator">++</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token function">if</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">lowercase</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token function">item</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">2</SPAN><SPAN class="token punctuation">,</SPAN> flist<SPAN class="token punctuation">[</SPAN>i<SPAN class="token punctuation">]</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"."</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token operator">==</SPAN><SPAN class="token string">"fon"</SPAN><SPAN class="token operator">|</SPAN>
<SPAN class="token function">lowercase</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token function">item</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">2</SPAN><SPAN class="token punctuation">,</SPAN> flist<SPAN class="token punctuation">[</SPAN>i<SPAN class="token punctuation">]</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"."</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token operator">==</SPAN><SPAN class="token string">"ttf"</SPAN>
<SPAN class="token punctuation">,</SPAN><SPAN class="token function">insert into</SPAN><SPAN class="token punctuation">(</SPAN>fonts<SPAN class="token punctuation">,</SPAN><SPAN class="token function">item</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> flist<SPAN class="token punctuation">[</SPAN>i<SPAN class="token punctuation">]</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"."</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;<BR /><SPAN class="token function">show</SPAN>(fonts);<BR /></SPAN>
Re:獲取所有已安裝字體的列表最後20%是從文件名確定字體名稱。(不知道該怎麼做。)
https://superuser.com/questions/760627/how-to-list-installed-font-families 也有討論。
Re:獲取所有已安裝字體的列表JMP只能訪問已安裝的字體。
在Windows中,我認為字體位於c:\ Windows \ Fonts中
我想你可以只獲取該目錄中的文件名,然後你就會80%。