« [PDFKit]ブランクPDFを生成する | トップページ | [資料]The Type 2 Charstring Format Technical Note #5177 »

[Python]FontのName要素を全て取得する(仮)


【スクリプトエディタで開く】|

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe

Dutch Type LibraryのOTMasterで取得できる
NameID 情報『のみ』を取得出来るのを目指したが
処理時間がかかりすぎるため挫折した

Font NameID 詳細資料
https://learn.microsoft.com/en-us/typography/opentype/spec/name

フォントのNameIDを取得して
値をHTMLに出力します

Pythonのパッケージ fonttoolをインストールします
インストールしたくない方は実行しないでください

最後に選択したファイルのディレクトリを設定ファイルとして保持します
設定ファイルは以下のディレクトリに保存します
$HOME/Library/Application Support/com.cocolog-nifty.quicktimer

出力のHTMLはユーザーの書類フォルダ内に保存します
$HOME/Documents/Library/Fonts/FontInfo

v2
保存ファイル名をpostscript名に変更しました
v3
Pythonのインストールチェックは初回実行時のみに変更

*)
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use framework "UniformTypeIdentifiers"
use scripting additions

property refMe : a reference to current application
property refBundleID : "com.cocolog-nifty.quicktimer.getFontInfoPy" as text
property listUTI : {"public.opentype-font", "public.truetype-ttf-font", "public.truetype-collection-font", "public.opentype-collection-font"} as list
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807
########################
##RUN
########################
on run
  ####################
  #前回の設定を読み出す
  set listReturn to doGetDefDirURL()
  set ocidDefaultDirPathURL to (item 1 of listReturn)
  set aliasDefaultDirPath to (ocidDefaultDirPathURL's absoluteURL()) as alias
  set strBinPath to (item 2 of listReturn) as text
  ####################
  ###Pythonイストールチェック
  if strBinPath is ("missing value") then
    set listReturn to doChkPython3()
    set boolDone to (item 1 of listReturn) as boolean
    set strBinPath to (item 2 of listReturn) as text
    if boolDone is false then
return "Pythonパッケージのインストールに失敗しました"
    else if strBinPath is ("missing value") then
return "Pythonがインストールされていません"
    end if
  end if
  ####################
  ###ダイアログを前面に出す
  tell current application
    set strName to name as text
  end tell
  if strName is "osascript" then
    tell application "Finder" to activate
  else
    tell current application to activate
  end if
  set listChooseFileUTI to {"public.font"}
  set strPromptText to "fontファイルを選んでください" as text
  set listAliasFilePath to (choose file with prompt strPromptText default location (aliasDefaultDirPath) of type listChooseFileUTI with invisibles and multiple selections allowed without showing package contents) as list
  ####################
  ###戻り値の最初の1つ
  set aliasChooseFilePath to (item 1 of listAliasFilePath) as alias
  set strChooseFilePath to (POSIX path of aliasChooseFilePath) as text
  set ocidChooseFilePathStr to refMe's NSString's stringWithString:(strChooseFilePath)
  set ocidChooseFilePath to ocidChooseFilePathStr's stringByStandardizingPath()
  set ocidChooseFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidChooseFilePath) isDirectory:false)
  set ocidLastDirPathURL to ocidChooseFilePathURL's URLByDeletingLastPathComponent()
  ####################
  #設定を書き込み
  set boolDone to doWriteDefDirURL(ocidLastDirPathURL, strBinPath)
  if boolDone is false then
log "設定の書き込みに失敗しました"
  end if
  ####################
  set listReturnOpen to {listAliasFilePath, strBinPath} as list
  #選択したファイルをOpenに渡す
open listReturnOpen
end run

########################
##OPEN
########################
on open listReturnOpen
  set listAliasFilePath to (item 1 of listReturnOpen) as list
  set strBinPath to (item 2 of listReturnOpen) as text
  ########################
  ##python3イストールチェック
  if strBinPath is ("missing value") then
    set listReturn to doChkPython3()
    set boolDone to (item 1 of listReturn) as boolean
    set strBinPath to (item 2 of listReturn) as text
    if refReturn is false then
return "Pythonパッケージのインストールに失敗しました"
    else if strBinPath is ("missing value") then
    else
      set strBinPath to refReturn as text
      #set strBinPath to ("/usr/bin/python3") as text
    end if
  end if
  
  ########################
  ##対象ファイルだけにする
  set ocidFilePathArray to doMakeProcessingArray(listAliasFilePath)
  ########################################
  ## 本処理
  ########################################
  ##ファイルの数だけ繰り返し
  repeat with itemFilePath in ocidFilePathArray
    #ファイル名
    set ocidFileName to itemFilePath's lastPathComponent()
    #テキストパス
    set strFilePath to itemFilePath as text
    #拡張子による分岐
    set ocidExtensionName to itemFilePath's pathExtension()
    set strExtension to (ocidExtensionName's lowercaseString) as text
    #戻り値格納用
    if ("ttf otf") contains strExtension then
log "単体フォントファイルです"
      ##フォント情報を取得する
      set ocidFontToolsDict to doGetFontInfoDicTTF(strFilePath, strBinPath)
      ##フォント情報を元にHTMLを生成する
      set listResponse to doMakeFontInfoHtml(ocidFontToolsDict, strFilePath, 0)
    else if ("otc ttc") contains strExtension then
log "コレクションフォントです"
      ##同封されている書体数を数えて
      set strCommandText to ("\"" & strBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(len(TTCollection('" & strFilePath & "').fonts));\"") as text
      set numCntFont to (do shell script strCommandText) as integer
      repeat with itemTTCNo from 0 to (numCntFont - 1) by 1
        set ocidFontToolsDict to doGetFontInfoDicTTC(strFilePath, strBinPath, itemTTCNo)
        ##フォント情報を元にHTMLを生成する
        set listResponse to doMakeFontInfoHtml(ocidFontToolsDict, strFilePath, itemTTCNo)
      end repeat
    end if
  end repeat
  #HTMLの保存先を開く
  set aliasSaveDirPath to ((item 2 of listResponse)'s absoluteURL()) as alias
  tell application "Finder"
open location aliasSaveDirPath
  end tell
  
end open

########################
##本処理ファンクション
########################
to doMakeFontInfoHtml(argFontToolsDict, argFilePath, argTTCNo)
  ########################
  ##入力パス
  ########################
  set strFilePath to argFilePath as text
  set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
  set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
  set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
  set ocidFileName to ocidFilePathURL's lastPathComponent()
  ########################
  ##言語コードレコード
  ########################
  set recordWinLangID to {|1025|:"ar-SA", |1069|:"eu-ES", |1026|:"bg-BG", |1027|:"ca-ES", |3076|:"zh-HK", |2052|:"zh-CN", |1028|:"zh-TW", |1050|:"hr-HR", |1029|:"cs-CZ", |1030|:"da-DK", |1043|:"nl-NL", |1033|:"en-US", |2057|:"en-GB", |1061|:"et-EE", |1035|:"fi-FI", |3084|:"fr-CA", |1036|:"fr-FR", |1110|:"gl-ES", |1031|:"de-DE", |1032|:"el-GR", |1037|:"he-IL", |1038|:"hu-HU", |1057|:"id-ID", |1040|:"it-IT", |1041|:"ja-JP", |1042|:"ko-KR", |1062|:"lv-LV", |1063|:"lt-LT", |1044|:"nb-NO", |1045|:"pl-PL", |1046|:"pt-BR", |2070|:"pt-PT", |1048|:"ro-RO", |1049|:"ru-RU", |1051|:"sk-SK", |1060|:"sl-SI", |2058|:"es-MX", |3082|:"es-ES", |1053|:"sv-SE", |1054|:"th-TH", |1055|:"tr-TR", |1058|:"uk-UA", |1066|:"vi-VN"} as record
  set ocidWinLangIDDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidWinLangIDDict's setDictionary:(recordWinLangID))
  
  set recordMacLangID to {|0|:"en", |1|:"fr", |2|:"de", |3|:"it", |4|:"nl", |5|:"sv", |6|:"es", |7|:"da", |8|:"pt", |9|:"no", |10|:"he", |11|:"ja", |12|:"ar", |13|:"fi", |14|:"el", |15|:"is", |16|:"mt", |17|:"tr", |18|:"hr", |19|:"zh-Hant", |20|:"ur", |21|:"hi", |22|:"th", |23|:"ko", |24|:"lt", |25|:"pl", |26|:"hu", |27|:"es", |28|:"lv", |29|:"se", |30|:"fo", |31|:"fa", |32|:"ru", |33|:"zh", |34|:"nl-BE", |35|:"ga", |36|:"sq", |37|:"ro", |38|:"cz", |39|:"sk", |40|:"sl", |41|:"yi", |42|:"sr", |43|:"mk", |44|:"bg", |45|:"uk", |46|:"be", |47|:"uz", |48|:"kk", |49|:"az-Cyrl", |50|:"az-Arab", |51|:"hy", |52|:"ka", |53|:"mo", |54|:"ky", |55|:"tg", |56|:"tk", |57|:"mn-CN", |58|:"mn", |59|:"ps", |60|:"ks", |61|:"ku", |62|:"sd", |63|:"bo", |64|:"ne", |65|:"sa", |66|:"mr", |67|:"bn", |68|:"as", |69|:"gu", |70|:"pa", |71|:"or", |72|:"ml", |73|:"kn", |74|:"ta", |75|:"te", |76|:"si", |77|:"my", |78|:"km", |79|:"lo", |80|:"vi", |81|:"id", |82|:"tl", |83|:"ms", |84|:"ms-Arab", |85|:"am", |86|:"ti", |87|:"om", |88|:"so", |89|:"sw", |90|:"rw", |91|:"rn", |92|:"ny", |93|:"mg", |94|:"eo", |128|:"cy", |129|:"eu", |130|:"ca", |131|:"la", |132|:"qu", |133|:"gn", |134|:"ay", |135|:"tt", |136|:"ug", |137|:"dz", |138|:"jv", |139|:"su", |140|:"gl", |141|:"af", |142|:"br", |143|:"iu", |144|:"gd", |145|:"gv", |146|:"ga", |147|:"to", |148|:"el-polyton", |149|:"kl", |150|:"az", |151|:"nn"} as record
  set ocidMacLangIDDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidMacLangIDDict's setDictionary:(recordMacLangID))
  
  #namelDとコメントのレコード
  set recordNameID to {|0|:"著作権", |1|:"フォントファミリ", |2|:"サブファミリ", |3|:"識別子", |4|:"フォント名", |5|:"バージョン", |6|:"PostScript名", |7|:"商標", |8|:"メーカー名", |9|:"デザイナー", |10|:"説明", |11|:"URL", |12|:"デザイナーURL", |13|:"ライセンス", |14|:"ライセンスURL", |15|:"未使用", |16|:"Preferredファミリー名", |17|:"Preferredサブファミリー名", |18|:"互換フォント名", |19|:"サンプルテキスト", |20|:"PostScriptCIDフォント名", |21|:"WWS太幅斜型ファミリ名", |22|:"WWS太幅斜型サブファミリ名", |23|:"CPALLカラーライト", |24|:"CPALDカラーダーク", |25|:"MultipleMaster名", |26|:"DebugPostScriptName"} as record
  set ocidNameIDDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidNameIDDict's setDictionary:(recordNameID))
  
  #MacEnc
  set recordMacEnc to {|0|:"Roman", |1|:"Japanese", |2|:"Chinese (Traditional)", |3|:"Korean", |4|:"Arabic", |5|:"Hebrew", |6|:"Greek", |7|:"Russian", |8|:"RSymbol", |9|:"Devanagari", |10|:"Gurmukhi", |11|:"Gujarati", |12|:"Odia", |13|:"Bangla", |14|:"Tamil", |15|:"Telugu", |16|:"Kannada", |17|:"Malayalam", |18|:"Sinhalese", |19|:"Burmese", |20|:"Khmer", |21|:"Thai", |22|:"Laotian", |23|:"Georgian", |24|:"Armenian", |25|:"Chinese (Simplified)", |26|:"Tibetan", |27|:"Mongolian", |28|:"Geez", |29|:"Slavic", |30|:"Vietnamese", |31|:"Sindhi", |32|:"Uninterpreted"} as record
  set ocidMacEncDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidMacEncDict's setDictionary:(recordNameID))
  #WinEnc
  set recordWinEnc to {|0|:"Symbol", |1|:"Unicode BMP", |2|:"ShiftJIS", |3|:"PRC", |4|:"Big5", |5|:"Wansung", |6|:"Johab", |7|:"Reserved", |8|:"Reserved", |9|:"Reserved", |10|:"Unicode full"} as record
  set ocidWinEncDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidWinEncDict's setDictionary:(recordNameID))
  
  ########################
  ##HTML生成開始
  ########################
  ##Header に渡すエレメント
  set ocidSetHeaderElement to (refMe's NSXMLElement's elementWithName:("div"))
  set ocidH3Element to (refMe's NSXMLElement's elementWithName:("h3"))
  set strSetValue to ("フォント情報: " & ocidFileName) as text
(ocidH3Element's setStringValue:(strSetValue))
(ocidSetHeaderElement's addChild:(ocidH3Element))
  ########################
  #footerに渡すエレメント
  set ocidSetFooterElement to (refMe's NSXMLElement's elementWithName:("div"))
  set ocidAElement to (refMe's NSXMLElement's elementWithName:("a"))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("href") stringValue:("https://quicktimer.cocolog-nifty.com/"))
(ocidAElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("target") stringValue:("_blank"))
(ocidAElement's addAttribute:(ocidAddNode))
  set strSetValue to ("AppleScriptで生成しました") as text
(ocidAElement's setStringValue:(strSetValue))
(ocidSetFooterElement's addChild:(ocidAElement))
  ########################
  #Articleに渡すエレメント
  set ocidSetArticleElement to (refMe's NSXMLElement's elementWithName:("div"))
  set ocidH3Element to (refMe's NSXMLElement's elementWithName:("h3"))
  set strSetValue to ("フォント情報一覧: " & argFilePath) as text
(ocidH3Element's setStringValue:(strSetValue))
(ocidSetArticleElement's addChild:(ocidH3Element))
  ##################################
  #テーブル部生成開始
  set ocidTableElement to (refMe's NSXMLElement's elementWithName:("table"))
  ##################################
  #ファイル名にPs名を利用
  set ocidPostScriptName to (argFontToolsDict's valueForKey:("26,0,0,0"))
  if ocidPostScriptName = (missing value) then
    set ocidPostScriptName to ocidFileName
  end if
  #####【caption】
  set ocidCaptionElement to (refMe's NSXMLElement's elementWithName:("caption"))
(ocidCaptionElement's setStringValue:("fonttoolで取得した:" & (ocidPostScriptName as text) & "のNameID情報"))
(ocidTableElement's addChild:(ocidCaptionElement))
  ##################################
  #####【colgroup】
  set ocidColgroupElement to (refMe's NSXMLElement's elementWithName:("colgroup"))
  set listColName to {"#", "namelD", "platformiD", "encodingiD", "languagelD", "nameString", "Comment"}
  repeat with itemColName in listColName
    #######【col】col生成
    set ocidAddElement to (refMe's NSXMLElement's elementWithName:("col"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
(ocidColgroupElement's addChild:(ocidAddElement))
  end repeat
  #テーブルエレメントに追加
(ocidTableElement's addChild:(ocidColgroupElement))
  ##################################
  #######【thead】
  set ocidTheadElement to (refMe's NSXMLElement's elementWithName:("thead"))
  set ocidTrElement to (refMe's NSXMLElement's elementWithName:("tr"))
  repeat with itemColName in listColName
    #TH
    set ocidAddElement to (refMe's NSXMLElement's elementWithName:("th"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("id") stringValue:(itemColName))
(ocidAddElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidAddElement's addAttribute:(ocidAddNode))
(ocidAddElement's setStringValue:(itemColName))
(ocidTrElement's addChild:(ocidAddElement))
  end repeat
(ocidTheadElement's addChild:(ocidTrElement))
(ocidTableElement's addChild:(ocidTheadElement))
  ##################################
  #フォント情報のキーの一覧
  set ocidAllKey to argFontToolsDict's allKeys()
  #並び替え
  set ocidSortedAllKeys to ocidAllKey's sortedArrayUsingSelector:("localizedStandardCompare:")
  set numCntAllKey to (count of ocidSortedAllKeys) as integer
  ################################################
  ######【tbody】
  set ocidTbodyElement to (refMe's NSXMLElement's elementWithName:("tbody"))
  ##################################
  repeat with itemKeyNo from 0 to (numCntAllKey - 1) by 1
    ##############
    #TRの開始
    set ocidTrElement to (refMe's NSXMLElement's elementWithName:("tr"))
    ####【TH】項番処理
    set strSetValue to (itemKeyNo + 1) as text
    set ocidThElement to (refMe's NSXMLElement's elementWithName:("th"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("項目番号:" & strSetValue))
(ocidThElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:("LineNO"))
(ocidThElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidThElement's addAttribute:(ocidAddNode))
(ocidThElement's setStringValue:(strSetValue))
(ocidTrElement's addChild:(ocidThElement))
    ###
    set ocidKeyCSV to (ocidSortedAllKeys's objectAtIndex:(itemKeyNo))
    set ocidKeyArray to (ocidKeyCSV's componentsSeparatedByString:(","))
    set listColName to {"namelD", "platformiD", "encodingiD", "languagelD"}
    set numCntItemKeyArray to (count of ocidKeyArray) as list
    repeat with itemItemKeyNo from 0 to (numCntItemKeyArray - 1) by 1
      set strColValue to (item (itemItemKeyNo + 1) of listColName) as text
      set strSetValue to (ocidKeyArray's objectAtIndex:(itemItemKeyNo))
      set ocidTdElement to (refMe's NSXMLElement's elementWithName:("td"))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:(strColValue))
(ocidTdElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:(strColValue))
(ocidTdElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidTdElement's addAttribute:(ocidAddNode))
      set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("class") stringValue:("wid"))
(ocidTdElement's addAttribute:(ocidAddNode))
(ocidTdElement's setStringValue:(strSetValue))
(ocidTrElement's addChild:(ocidTdElement))
    end repeat
    ####値欄
    set ocidSetValue to (argFontToolsDict's valueForKey:(ocidKeyCSV))
    set ocidTdElement to (refMe's NSXMLElement's elementWithName:("td"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("nameString"))
(ocidTdElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:("nameString"))
(ocidTdElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidTdElement's addAttribute:(ocidAddNode))
(ocidTdElement's setStringValue:(ocidSetValue))
(ocidTrElement's addChild:(ocidTdElement))
    ####コメント欄
    ####NameiD
    set strNameiD to (ocidKeyArray's objectAtIndex:0) as text
    set numNameiD to strNameiD as integer
    if numNameiD > 25 then
      set strSetValue to ("Font-Specific ") as text
    else
      set strNameiD to numNameiD as text
      set strNameDiscription to (ocidNameIDDict's valueForKey:(strNameiD)) as text
      set strSetValue to (strNameDiscription & " ") as text
    end if
    ####PlatformiD
    set recordPlatForm to {|0|:"汎用", |1|:"Mac", |2|:"Win"} as record
    set ocidPlatFormDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
(ocidPlatFormDict's setDictionary:(recordPlatForm))
    
    set strPlatformiD to (ocidKeyArray's objectAtIndex:1) as text
    set numPlatformiD to strPlatformiD as integer
    if numPlatformiD = 1 then
      set strSetValue to (strSetValue & "Mac ") as text
    else if numPlatformiD = 3 then
      set strSetValue to (strSetValue & "Win ") as text
    else
      set strSetValue to (strSetValue & "UniPlatform ") as text
    end if
    ###EncodingiD
    set strEncodingiD to (ocidKeyArray's objectAtIndex:2) as text
    set numEncodingiD to strEncodingiD as integer
    if numEncodingiD = 0 then
      set strSetValue to (strSetValue & "Roman ") as text
    else if numEncodingiD = 1 then
      set strSetValue to (strSetValue & "Uni1.1 ") as text
    else if numEncodingiD = 2 then
      set strSetValue to (strSetValue & "Uni10646 ") as text
    else if numEncodingiD = 3 then
      set strSetValue to (strSetValue & "Uni2.0BMP ") as text
    else if numEncodingiD = 4 then
      set strSetValue to (strSetValue & "Uni2.0FULL ") as text
    end if
    ###LanguagelD
    set strLanguagelD to (ocidKeyArray's objectAtIndex:3) as text
    set strLangIdName to (ocidMacLangIDDict's valueForKey:(strLanguagelD))
    if strLangIdName = (missing value) then
      set strLangIdName to (ocidWinLangIDDict's valueForKey:(strLanguagelD))
      if strLangIdName = (missing value) then
        set strSetValue to (strSetValue & "Other ") as text
      else
        set strSetValue to (strSetValue & strLangIdName & " ") as text
      end if
    else
      set strSetValue to (strSetValue & strLangIdName & " ")
    end if
    set ocidTdElement to (refMe's NSXMLElement's elementWithName:("td"))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("Comment"))
(ocidTdElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("headers") stringValue:("Comment"))
(ocidTdElement's addAttribute:(ocidAddNode))
    set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("col"))
(ocidTdElement's addAttribute:(ocidAddNode))
(ocidTdElement's setStringValue:(strSetValue))
(ocidTrElement's addChild:(ocidTdElement))
    #
(ocidTbodyElement's addChild:(ocidTrElement))
  end repeat
  #Tbodyをテーブルにセット
ocidTableElement's addChild:(ocidTbodyElement)
  ######【tfoot】 TRで
  set ocidTfootElement to refMe's NSXMLElement's elementWithName:("tfoot")
  set ocidTrElement to refMe's NSXMLElement's elementWithName:("tr")
  #colspan指定して1行でセット
  set ocidThElement to (refMe's NSXMLElement's elementWithName:("th"))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("title") stringValue:("テーブルの終わり"))
(ocidThElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("colspan") stringValue:("7"))
(ocidThElement's addAttribute:(ocidAddNode))
  set ocidAddNode to (refMe's NSXMLNode's attributeWithName:("scope") stringValue:("row"))
(ocidThElement's addAttribute:(ocidAddNode))
  #
  set strContents to ("項目数 : " & (numCntAllKey)) as text
(ocidThElement's setStringValue:(strContents))
  #THをTRにセットして
ocidTrElement's addChild:(ocidThElement)
  #TRをTFOOTにセット
ocidTfootElement's addChild:(ocidTrElement)
  #TFOOTをテーブルにセット
ocidTableElement's addChild:(ocidTfootElement)
ocidSetArticleElement's addChild:(ocidTableElement)
  ##############################
  #HTMLにする
  ##############################
  set strSetTitleValue to ("フォント情報一覧: " & strFilePath) as text
  set ocidHTML to doMakeRootElement({ocidSetHeaderElement, ocidSetArticleElement, ocidSetFooterElement, strSetTitleValue})
  ##############################
  #保存先
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
  set ocidSaveDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Library/Fonts/FontInfo") isDirectory:(true)
  set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
  set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
  #保存ファイル名
  set ocidSetValue to (ocidPostScriptName's stringByReplacingOccurrencesOfString:(".") withString:(""))
  set ocidSaveBaseFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(ocidSetValue)
  if argTTCNo = 0 then
    set ocidSaveFilePathURL to ocidSaveBaseFilePathURL's URLByAppendingPathExtension:("html")
  else
    set strSetValue to (argTTCNo & ".html") as text
    set ocidSaveFilePathURL to ocidSaveBaseFilePathURL's URLByAppendingPathExtension:(strSetValue)
  end if
  #読み取りやすい表示
  set ocidXMLdata to ocidHTML's XMLDataWithOptions:(refMe's NSXMLNodePrettyPrint)
  set listDone to ocidXMLdata's writeToURL:(ocidSaveFilePathURL) options:(refMe's NSDataWritingAtomic) |error|:(reference)
  set boolDone to (item 1 of listDone) as boolean
return {boolDone, ocidSaveDirPathURL, ocidSaveFilePathURL}
end doMakeFontInfoHtml


############################################################
# 基本的なHTMLの構造
(*
doMakeRootElement({argHeaderContents, argArticleContents, argFooterContents})
HTMLのBODY部
header
article
footerにそれぞれAddchildするデータをリストで渡す
戻り値はRootエレメントにセットされた
NSXMLDocumentを戻すので 保存すればOK
*)
############################################################
to doMakeRootElement({argHeaderContents, argArticleContents, argFooterContents, argTitle})
  #XML初期化
  set ocidXMLDoc to refMe's NSXMLDocument's alloc()'s init()
ocidXMLDoc's setDocumentContentKind:(refMe's NSXMLDocumentHTMLKind)
  # DTD付与
  set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
ocidDTD's setName:("html")
ocidXMLDoc's setDTD:(ocidDTD)
  #
  set ocidRootElement to refMe's NSXMLElement's elementWithName:("html")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("lang") stringValue:("ja")
ocidRootElement's addAttribute:(ocidAddNode)
  #
  set ocidHeadElement to refMe's NSXMLElement's elementWithName:("head")
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("title")
ocidAddElement's setStringValue:(argTitle)
ocidHeadElement's addChild:(ocidAddElement)
  # http-equiv
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("http-equiv") stringValue:("Content-Type")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("text/html; charset=UTF-8")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("meta")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("name") stringValue:("viewport")
ocidAddElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("content") stringValue:("width=720")
ocidAddElement's addAttribute:(ocidAddNode)
ocidHeadElement's addChild:(ocidAddElement)
  #
  set ocidAddElement to refMe's NSXMLElement's elementWithName:("style")
ocidAddElement's setStringValue:("body {margin: 10px;background-color: #FFFFFF;font-family: system-ui;}table {max-width: 1280px;border-spacing: 0;caption-side: top;}thead th {border: solid 1px #666666;padding: .5ch .1ch;border-block-width: 1px 0;border-inline-width: 1px 0;&:first-of-type {border-start-start-radius: .5em}&:last-of-type {border-start-end-radius: .5em;border-inline-end-width: 1px}}tbody th {border-spacing: 0;max-width: 360px;border: solid 1px #666666;border-block-width: 1px 0;border-inline-width: 1px 0;}tbody td {max-width: 360px;border-spacing: 0;border: solid 1px #666666;padding: .5ch 1ch;border-block-width: 1px 0;border-inline-width: 1px 0;overflow-wrap: break-word;white-space: pre-wrap;&:last-of-type {border-inline-end-width: 1px}}tbody td.wid {width: 40px !important;max-width: 60px !important;text-align: right;}tbody tr:nth-of-type(odd) {background: #F2F2F2;}.kind_string {font-size: 0.75em;}.date_string {font-size: 0.5em;}tfoot th {border: solid 1px #666666;padding: .5ch 1ch;&:first-of-type {border-end-start-radius: .5em}&:last-of-type {border-end-end-radius: .5em;border-inline-end-width: 1px}}")
ocidHeadElement's addChild:(ocidAddElement)
ocidRootElement's addChild:(ocidHeadElement)
  #
  #ボディエレメント
  set ocidBodyElement to refMe's NSXMLElement's elementWithName:("body")
  #ヘッダー
  set ocidHeaderElement to refMe's NSXMLElement's elementWithName:("header")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("header")
ocidHeaderElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_header")
ocidHeaderElement's addAttribute:(ocidAddNode)
ocidHeaderElement's addChild:(argHeaderContents)
ocidBodyElement's addChild:(ocidHeaderElement)
  #アーティクル
  set ocidArticleElement to refMe's NSXMLElement's elementWithName:("article")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("article")
ocidArticleElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_article")
ocidArticleElement's addAttribute:(ocidAddNode)
ocidArticleElement's addChild:(argArticleContents)
ocidBodyElement's addChild:(ocidArticleElement)
  #フッター
  set ocidFooterElement to refMe's NSXMLElement's elementWithName:("footer")
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("id") stringValue:("footer")
ocidFooterElement's addAttribute:(ocidAddNode)
  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("class") stringValue:("body_footer")
ocidFooterElement's addAttribute:(ocidAddNode)
ocidFooterElement's addChild:(argFooterContents)
ocidBodyElement's addChild:(ocidFooterElement)
  #ボディをROOTエレメントにセット
ocidRootElement's addChild:(ocidBodyElement)
  #ROOTをXMLにセット
ocidXMLDoc's setRootElement:(ocidRootElement)
  #値を戻す
return ocidXMLDoc
end doMakeRootElement



########################
## TTCフォント用
########################
to doGetFontInfoDicTTC(argFontFilePath, argBinPath, argItemNO)
  set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].names);\"") as text
  set strResponse to (do shell script strCommandText) as text
  set ocidFontToolsArray to doFormattingDic(strResponse)
  ##戻り値格納用のDICT
  set ocidFontToolsDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
  #['name'].namesの戻り値の数だけ繰り返し
  repeat with itemFontToolsArray in ocidFontToolsArray
    #各IDを定義
    set strNamelD to (item 1 of itemFontToolsArray) as text
    set strPlatformiD to (item 2 of itemFontToolsArray) as text
    set strLanguagelD to (item 3 of itemFontToolsArray) as text
    if strLanguagelD is "0" then
      set strEncodingiD to "0" as text
    else
      set strEncodingiD to "1" as text
    end if
    # namelD platformiD encodingiD languagelD
    set strSetValue to (strNamelD & "," & strPlatformiD & "," & strEncodingiD & "," & strLanguagelD) as text
    set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].getName(" & strSetValue & "));\"") as text
    set strResponse to (do shell script strCommandText) as text
    if strResponse is "None" then
      set strSetValue to (strNamelD & "," & strPlatformiD & ",1," & strLanguagelD) as text
      set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].getName(" & strSetValue & "));\"") as text
      set strResponse to (do shell script strCommandText) as text
    end if
    #戻り値をDictに入れていく
(ocidFontToolsDict's setValue:(strResponse) forKey:(strSetValue))
    ##getDebugName post script
    set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].getDebugName(6));\"") as text
    set strPostScriptName to (do shell script strCommandText) as text
    if strPostScriptName is "None" then
      set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].getName(6,3,1,1033));\"") as text
      set strPostScriptName to (do shell script strCommandText) as text
      if strPostScriptName is "None" then
        set strCommandText to ("\"" & argBinPath & "\" -c \"from fontTools.ttLib import TTCollection;print(TTCollection('" & argFontFilePath & "').fonts[" & argItemNO & "]['name'].getName(6,1,0,0));\"") as text
        set strPostScriptName to (do shell script strCommandText) as text
      end if
    end if
    
(ocidFontToolsDict's setValue:(strPostScriptName) forKey:("26,0,0,0"))
  end repeat
return ocidFontToolsDict
end doGetFontInfoDicTTC

########################
#単体TTフォント用
########################
to doGetFontInfoDicTTF(argFontFilePath, argPysonBinPath)
  ###
  set strCommandText to ("\"" & argPysonBinPath & "\" -c \"from fontTools.ttLib import TTFont;print(TTFont('" & argFontFilePath & "')['name'].names);\"") as text
  set strResponse to (do shell script strCommandText) as text
  set ocidFontToolsArray to doFormattingDic(strResponse)
  ##戻り値格納用のDICT
  set ocidFontToolsDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
  #['name'].namesの戻り値の数だけ繰り返し
  repeat with itemFontToolsArray in ocidFontToolsArray
    #各IDを定義
    set strNamelD to (item 1 of itemFontToolsArray) as text
    set strPlatformiD to (item 2 of itemFontToolsArray) as text
    set strLanguagelD to (item 3 of itemFontToolsArray) as text
    if strLanguagelD is "0" then
      set strEncodingiD to "0" as text
    else
      set strEncodingiD to "1" as text
    end if
    # namelD platformiD encodingiD languagelD
    set strSetValue to (strNamelD & "," & strPlatformiD & "," & strEncodingiD & "," & strLanguagelD) as text
    set strCommandText to ("\"" & argPysonBinPath & "\" -c \"from fontTools.ttLib import TTFont;print(TTFont('" & argFontFilePath & "')['name'].getName(" & strSetValue & "));\"") as text
    set strResponse to (do shell script strCommandText) as text
    if strResponse is "None" then
      set strSetValue to (strNamelD & "," & strPlatformiD & ",1," & strLanguagelD) as text
      set strCommandText to ("\"" & argPysonBinPath & "\" -c \"from fontTools.ttLib import TTFont;print(TTFont('" & argFontFilePath & "')['name'].getName(" & strSetValue & "));\"") as text
      set strResponse to (do shell script strCommandText) as text
    end if
    #戻り値をDictに入れていく
(ocidFontToolsDict's setValue:(strResponse) forKey:(strSetValue))
    ##getDebugName PostScriptname
    set strCommandText to ("\"" & argPysonBinPath & "\" -c \"from fontTools.ttLib import TTFont;print(TTFont('" & argFontFilePath & "')['name'].getDebugName(6));\"") as text
    set strPostScriptName to (do shell script strCommandText) as text
(ocidFontToolsDict's setValue:(strPostScriptName) forKey:("26,0,0,0"))
  end repeat
return ocidFontToolsDict
end doGetFontInfoDicTTF

########################
#fontToolのDictをArrayに
########################
to doFormattingDic(argText)
  set ocidResponse to refMe's NSString's stringWithString:(argText)
  set ocidRepStrings to (ocidResponse's stringByReplacingOccurrencesOfString:("[") withString:(""))
  set ocidRepStrings to (ocidRepStrings's stringByReplacingOccurrencesOfString:("]") withString:(""))
  set ocidRepStrings to (ocidRepStrings's stringByReplacingOccurrencesOfString:("<") withString:(""))
  set ocidRepStrings to (ocidRepStrings's stringByReplacingOccurrencesOfString:(">") withString:(""))
  set ocidStringArray to ocidRepStrings's componentsSeparatedByString:(",")
  #
  set ocidNamesArrayM to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
  repeat with itemArray in ocidStringArray
    set ocidItemArrayM to (refMe's NSMutableArray's alloc()'s initWithCapacity:(0))
    set ocidSubArray to (itemArray's componentsSeparatedByString:(";"))
    repeat with itemSubArray in ocidSubArray
      set ocidGetArray to (itemSubArray's componentsSeparatedByString:("="))
      set strID to ocidGetArray's lastObject()
(ocidItemArrayM's addObject:(strID))
    end repeat
(ocidNamesArrayM's addObject:(ocidItemArrayM))
  end repeat
  ##戻り値はArrayINArray
return ocidNamesArrayM
end doFormattingDic



########################
##処理対象ファイルだけ処理に回す
########################
to doMakeProcessingArray(argListAliasFilePath)
  set ocidUTIarray to refMe's NSArray's arrayWithArray:(listUTI)
  #処理するパスを格納する
  set ocidDoPathArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
  #
  repeat with itemAliasFilePath in argListAliasFilePath
    set aliasFilePath to itemAliasFilePath as alias
    set strFilePath to (POSIX path of aliasFilePath) as text
    set ocidFilePathStr to (refMe's NSString's stringWithString:(strFilePath))
    set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
    set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath))
    set listResourceValue to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLContentTypeKey) |error|:(reference))
    set ocidContentType to (item 2 of listResourceValue)
    set strUTI to (ocidContentType's identifier) as text
    set boolContain to (ocidUTIarray's containsObject:(strUTI))
    if boolContain is true then
log "対象フォントです"
      ##URLを使う場合
      # (ocidDoPathArray's addObject:(ocidFilePathURL))
      ##パスが必要な場合
(ocidDoPathArray's addObject:(ocidFilePath))
      ##テキストパスを戻す場合
      # (ocidDoPathArray's addObject:(strFilePath))
    else
log "対象外のファイルですリストに追加しません"
    end if
  end repeat
  ###戻り値はArray
return ocidDoPathArray
end doMakeProcessingArray

####################
#設定ファイル書き込み
####################
to doWriteDefDirURL(argDirPathURL, argBinPath)
  #設定ファイルのパス
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidApplicationSupportDirPathURL to ocidURLsArray's firstObject()
  set ocidPrefFilePathURL to ocidApplicationSupportDirPathURL's URLByAppendingPathComponent:("com.cocolog-nifty.quicktimer/" & refBundleID)
  set ocidPrefFilePathURL to ocidPrefFilePathURL's URLByAppendingPathExtension:("plist")
  #NSDATAでデータを読み出して
  set listResponse to refMe's NSData's dataWithContentsOfURL:(ocidPrefFilePathURL) options:(refMe's NSDataReadingMappedIfSafe) |error|:(reference)
  set ocidPlistData to (item 1 of listResponse)
  #NSKeyedArchiverで圧縮されているのでUnarchive解凍する
  set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
  set ocidPlistDict to (item 1 of listResponse)
  if ocidPlistDict = (missing value) then
    set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
  end if
  #NSURLを保存
ocidPlistDict's setObject:(argDirPathURL) forKey:("LastChooseDir")
  #Pyのパスを保存する
  if argBinPath is not (missing value) then
ocidPlistDict's setObject:(argBinPath) forKey:("PythonPath")
  end if
  #NSKeyedArchiverで圧縮して
  set listSaveData to refMe's NSKeyedArchiver's archivedDataWithRootObject:(ocidPlistDict) requiringSecureCoding:(true) |error|:(reference)
  set ocidSaveData to (item 1 of listSaveData)
  #NSDATAで保存
  set listDone to ocidSaveData's writeToURL:(ocidPrefFilePathURL) options:0 |error|:(reference)
  #戻り値は成功したかのBOOL値
  set boolDone to (item 1 of listDone) as boolean
return boolDone
end doWriteDefDirURL


####################
#設定ファイル読み出し
####################
to doGetDefDirURL()
  #設定ファイルの保存先
  set appFileManager to refMe's NSFileManager's defaultManager()
  set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSApplicationSupportDirectory) inDomains:(refMe's NSUserDomainMask))
  set ocidApplicationSupportDirPathURL to ocidURLsArray's firstObject()
  #フォルダは一応作る
  set ocidConfDirPathURL to ocidApplicationSupportDirPathURL's URLByAppendingPathComponent:("com.cocolog-nifty.quicktimer")
  set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions)
  set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidConfDirPathURL) withIntermediateDirectories:(true) attributes:(ocidAttrDict) |error|:(reference)
  #設定ファイルのパス
  set ocidPrefFilePathURL to ocidConfDirPathURL's URLByAppendingPathComponent:(refBundleID)
  set ocidPlistFilePathURL to ocidPrefFilePathURL's URLByAppendingPathExtension:("plist")
  #NSDATAで読み出して
  set listResponse to refMe's NSData's dataWithContentsOfURL:(ocidPlistFilePathURL) options:(refMe's NSDataReadingMappedIfSafe) |error|:(reference)
  set ocidPlistData to (item 1 of listResponse)
  #NSKeyedArchiverで圧縮されているのでUnarchive解凍する
  set listResponse to refMe's NSKeyedUnarchiver's unarchivedObjectOfClass:((refMe's NSObject)'s class) fromData:(ocidPlistData) |error|:(reference)
  set ocidPlistDict to (item 1 of listResponse)
  #戻り値が空なら
  if ocidPlistDict = (missing value) then
log "初回起動です"
    #フォントフォルダをデフォルトとして登録する
    set ocidDirPathURLArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSUserDomainMask))
    set ocidDirPathURL to ocidDirPathURLArray's firstObject()
    set ocidDefaultDirPathURL to ocidDirPathURL's URLByAppendingPathComponent:("Fonts")
    #保存するDICT
log doWriteDefDirURL(ocidDefaultDirPathURL, (missing value))
    set strBinPath to (missing value)
  else
    set ocidDefaultDirPathURL to ocidPlistDict's valueForKey:("LastChooseDir")
    set strBinPath to ocidPlistDict's valueForKey:("PythonPath")
  end if
  #戻り値は設定ファイルから取得してNSURL
  set listReturn to {ocidDefaultDirPathURL, strBinPath} as list
return listReturn
end doGetDefDirURL

####################
## python3のチェック
####################
to doChkPython3()
  ## python3のパス
  try
    set strCmdText to ("/usr/bin/which python3") as text
    set strBinPath to (do shell script strCmdText) as text
  on error
log "python3が見つかりませんでした終了します"
return {false, (missing value)} as list
  end try
  ###fonttoolのインストールチェック
  set strCmdText to ("\"" & strBinPath & "\" -m pip show fontTools") as text
  try
    set strPipDone to (do shell script strCmdText) as text
  on error
    try
      set strCmdText to ("/bin/mkdir -p $HOME/Library/Caches/pip") as text
do shell script strCmdText
      set strCmdText to ("/bin/chmod 777 $HOME/Library/Caches/pip") as text
do shell script strCmdText
      set strCmdText to ("/bin/mkdir -p $HOME/Library/Python/3.9/lib/python/site-packages") as text
do shell script strCmdText
      set strCmdText to ("/bin/chmod 755 $HOME/Library/Python/3.9/lib/python/site-packages") as text
do shell script strCmdText
    end try
    try
      ##pipのアップデート
      set strCmdText to ("\"" & strBinPath & "\" -m pip install --upgrade --user pip") as text
      set strPipDone to (do shell script strCmdText) as text
    on error
log "pipのアップデートに失敗しました"
return {false, (missing value)} as list
    end try
    try
      ##インストールされていなければインストールする
      set strCmdText to ("\"" & strBinPath & "\" -m pip install --user fontTools") as text
      set strPipDone to (do shell script strCmdText) as text
    on error
log "fontToolsのインストールに失敗しました"
return {false, (missing value)} as list
    end try
  end try
return {true, strBinPath} as list
end doChkPython3


|

« [PDFKit]ブランクPDFを生成する | トップページ | [資料]The Type 2 Charstring Format Technical Note #5177 »

AppleScript Fonts」カテゴリの記事