[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
| 固定リンク
「NSFontManager」カテゴリの記事
- [NSFontManager]フォント名の取得(修正)(2024.12.24)
- [NSFont]フォント名の取得(フォント名=FULLNAME 英語 日本語ローカライズ名 postscript名)(2024.12.11)
- Fontのpostscript名を取得する(訂正)(2024.09.24)
- [NSFontManager]フォントのリストを取得する(基本編)(2024.06.18)
- [font book]フォントライブラリを作成する(2023.06.19)