Font Sampler AppleScriptでの日本語フォントの指定時の問題
こんにちは
下記のFont Sampler AppleScriptでの日本語フォント指定について、特に"MS ゴシック"、"MS 明朝" 、"MS Pゴシック"、 "MS P明朝"を指定した場合、正しい結果が得られていないようで困っております。
この原因と対策につきましてご指導いただければ幸いです。よろしくお願いいたします。
【FontSampler】
set the font_list to {"Osaka", "Times", "Helvetica", "MS ゴシック", "MS 明朝", "MS Pゴシック", "MS P明朝"}
set the sample_string to "謹賀新年。ありがとう。The quick brown fox jumps over the lazy dog."
display dialog "Font Sampler" & return & return & ¬
"This script will use the TextEdit application to create a document containing a sample of each installed typeface." buttons {"Cancel", "Continue"} default button 2
tell application "TextEdit"
activate
try
-- close every document saving no
make new document at the beginning of documents
set the name of window 1 to "Font Sampler"
set zoomed of the front window to true
set the font_count to the count of the font_list
set this_text to ""
repeat with i from 1 to the font_count
set this_font to item i of the font_list
if i is 1 then
set this_text to this_text & this_font & ": " & the sample_string
else
set this_text to this_text & return & this_font & ": " & the sample_string
end if
end repeat
set the text of the front document to this_text
repeat with i from 1 to the font_count
set this_font to item i of the font_list
tell paragraph i of the text of the front document
set the font to this_font
set the size to 14
end tell
end repeat
display dialog "Font Sampler is complete." buttons {"OK"} default button 1 giving up after 2
on error error_message
beep
display dialog error_message buttons {"Cancel"} default button 1
end try
end tell
【結果(写真)】
動作環境:
-Mac OSX 10.6.8 Snow Leopard
-AppleScriptエディタ 2.3 (118) / AppleScript 2.1.2
-TextEdit 1.6 (264)
iMac, Mac OS X (10.6.8)