« apple-preview:Bookmarks | トップページ | [PDFOutline]親要素に対して子要素として入れる »

[NSFontManager]フォントリスト あれこれ

フォント名

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application



set appFontManager to refMe's NSFontManager
set appSharedMaanager to appFontManager's sharedFontManager()
set ocidFontList to appSharedMaanager's availableFonts()

repeat with itemFontList in ocidFontList
  
  log itemFontList as text
  
end repeat



フォントファミリー

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application



set appFontManager to refMe's NSFontManager
set appSharedMaanager to appFontManager's sharedFontManager()
set ocidFontList to appSharedMaanager's availableFontFamilies()

repeat with itemFontList in ocidFontList
  
  log itemFontList as text
  
end repeat



スタイル別で指定(NSFontTraitMask)

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application



set appFontManager to refMe's NSFontManager
set appSharedMaanager to appFontManager's sharedFontManager()
set ocidFontList to appSharedMaanager's availableFontNamesWithTraits:(refMe's NSBoldFontMask)
(*
NSBoldFontMask
NSCompressedFontMask
NSCondensedFontMask
NSExpandedFontMask
NSFixedPitchFontMask
NSItalicFontMask
NSNarrowFontMask
NSNonStandardCharacterSetFontMask
NSPosterFontMask
NSSmallCapsFontMask
NSUnboldFontMask
NSUnitalicFontMask
*)

repeat with itemFontList in ocidFontList
  
  log itemFontList as text
  
end repeat



フォントファミリーメンバー

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application



set appFontManager to refMe's NSFontManager
set appSharedMaanager to appFontManager's sharedFontManager()
set ocidFontList to appSharedMaanager's availableFontFamilies()

repeat with itemFontList in ocidFontList
  set ocidFamilyMember to (appSharedMaanager's availableMembersOfFontFamily:itemFontList)
  
  repeat with itemFamilyMember in ocidFamilyMember
    log itemFamilyMember as list
    
  end repeat
  
end repeat

|

« apple-preview:Bookmarks | トップページ | [PDFOutline]親要素に対して子要素として入れる »

NSFontManager」カテゴリの記事