Can you get a list of OSX fonts somehow?
-
@driven said:
what in particular are you looking to achieve?
Get a list of fonts installed on the users system.
I've found a method for Windows - trying to find a solution for OSX. -
You may notice that my code [untested as I have no access to a MAC right now!] includes
| grep \/Library
So it only list fonts in a path with "\Library" in, you can omit or change that...There are several potential font locations:
-
"User" ~/Library/Fonts/ Each user has complete control over the fonts installed in their Home. These fonts are available to that user when he or she is logged in to the computer. Fonts installed here are not available to all users of the computer.
-
"Local" /Library/Fonts/ Any local user of the computer can use fonts installed in this folder. Mac OS X does not require these additional fonts for system operation. An admin user can modify the contents of this folder. This is the recommended location for fonts that are shared among applications.
-
"Network" /Network/Library/Fonts/ The Network folder is for fonts shared among all users of a local area network. This feature is normally used on network file servers, under the control of a network administrator.
-
"System" /System/Library/Fonts/ Mac OS X requires fonts in this folder for system use and displays. They should not be manually altered or removed.
-
"Classic" /System Folder/Fonts/ This folder contains fonts used by the Classic environment (Mac OS X v10.4 or earlier only). If more than one Mac OS 9.1 System Folder is present, only fonts in the System Folder selected in the Classic pane of System Preferences are used. Classic applications can access only these fonts, not those stored elsewhere. Conversely, Mac OS X applications can use these fonts, even when the Classic environment is not active.
As you see the 'Classic' fonts would not be listed, as there is no '/Library' in their path...
-
-
I'll see if I can try it out over the weekend.
So UI.openfile is the only way to execute a command without a console window flashing?
Because if we could execute the command with the system method in Ruby we could get the output returned as a string directly instead of writing to temp files.
-
@thomthom said:
I'll see if I can try it out over the weekend.
So UI.openfile is the only way to execute a command without a console window flashing?
Because if we could execute the command with the system method in Ruby we could get the output returned as a string directly instead of writing to temp files.
You can try using a system call base on my code... I know openURL works with a xxx.command file, I think it's silent, without a window opening. Using temp files etc is not ideal I know...If you get the system call working I be interested to see how yo get the fonts list on PC as well as on the MAC.
-
For Windows I used this: http://stackoverflow.com/a/6351414/486990
It's a javascript - so you have to rely on a Webdialog - which in my case was ok because I wanted to display the list in a webdialog.
But because I don't trust the methods I have fallback lists for both platforms.
Looks familiar?
-
If you want js then http://www.lalit.org/lab/javascript-css-font-detect/ selects installed fonts from a premade list - that way you can limit the 'daftness' of available fonts...
Have you seen this http://hasseg.org/blog/post/526/getting-a-list-of-installed-fonts-with-flash-and-javascript/
or this https://github.com/gabriel/font-detect-js -
@tig said:
Have you seen this http://hasseg.org/blog/post/526/getting-a-list-of-installed-fonts-with-flash-and-javascript/
or this https://github.com/gabriel/font-detect-jsYea - tried that. Unfortunately
ExternalInterface
in Flash doesn't work when run locally. It's sandboxed. (I don't quite get it though, if you run in on a website, then sure, have full access, but run it locally, NO! ... ??) -
If you want a list in ruby
fontList=(`osascript -e 'tell application "Font Book"' -e ' set fontList to name of every font family' -e 'end tell'`)
on my mac it returns these
> Abadi MT Condensed Extra Bold, Abadi MT Condensed Light, Academy Engraved LET, Al Bayan, American Typewriter, Andale Mono, Arial, Arial Black, Arial Hebrew, Arial Narrow, Arial Rounded MT Bold, Arial Unicode MS, Avenir, Avenir Next, Avenir Next Condensed, Ayuthaya, Baghdad, Bangla MN, Bangla Sangam MN, Bank Gothic, Baoli SC, Baskerville, Baskerville Old Face, Batang, Bauhaus 93, Bell MT, Bernard MT Condensed, BiauKai, Big Caslon, Blackmoor LET, BlairMdITC TT, Bodoni Ornaments ITC TT, Bodoni SvtyTwo ITC TT, Bodoni SvtyTwo OS ITC TT, Bodoni SvtyTwo SC ITC TT, Book Antiqua, Bookman Old Style, Bookshelf Symbol 7, Bordeaux Roman Bold LET, Bradley Hand ITC TT, Braggadocio, Britannic Bold, Brush Script MT, Calibri, Calisto MT, Cambria, Candara, Capitals, Casual, Century, Century Gothic, Century Schoolbook, Chalkboard, Chalkboard SE, Chalkduster, Charcoal CY, Cochin, Colonna MT, Comic Sans MS, Consolas, Constantia, Cooper Black, Copperplate, Copperplate Gothic Bold, Copperplate Gothic Light, Corbel, Corsiva Hebrew, Courier, Courier New, Cracked, Curlz MT, Damascus, DecoType Naskh, Desdemona, Devanagari MT, Devanagari Sangam MN, Didot, Edwardian Script ITC, Engravers MT, Euphemia UCAS, Eurostile, Footlight MT Light, Franklin Gothic Book, Franklin Gothic Medium, FreeMono, FreeSans, FreeSerif, Futura, Garamond, GB18030 Bitmap, Geeza Pro, Geneva, Geneva CY, Georgia, Gill Sans, Gill Sans MT, Gill Sans Ultra Bold, Gloucester MT Extra Condensed, Goudy Old Style, Gujarati MT, Gujarati Sangam MN, Gulim, GungSeo, Gurmukhi MN, Gurmukhi MT, Gurmukhi Sangam MN, Haettenschweiler, Handwriting - Dakota, Harrington, HeadLineA, Hei, Heiti SC, Heiti TC, Helvetica, Helvetica CY, Helvetica Neue, Herculanum, Hiragino Kaku Gothic Pro, Hiragino Kaku Gothic ProN, Hiragino Kaku Gothic Std, Hiragino Kaku Gothic StdN, Hiragino Maru Gothic Pro, Hiragino Maru Gothic ProN, Hiragino Mincho Pro, Hiragino Mincho ProN, Hiragino Sans GB, Hoefler Text, Impact, Imprint MT Shadow, Improv ICG, InaiMathi, Jazz LET, Kai, Kailasa, Kaiti SC, Kannada MN, Kannada Sangam MN, Kefa, Khmer MN, Khmer Sangam MN, Kino MT, Kokonor, Krungthep, KufiStandardGK, Lantinghei SC, Lantinghei TC, Lao MN, Lao Sangam MN, Libian SC, LiHei Pro, LiSong Pro, Lucida Blackletter, Lucida Bright, Lucida Calligraphy, Lucida Console, Lucida Fax, Lucida Grande, Lucida Handwriting, Lucida Sans, Lucida Sans Typewriter, Lucida Sans Unicode, Machine Tool Gothic, Machine Tool SanSerif, Malayalam MN, Malayalam Sangam MN, Marion, Marker Felt, Marlett, Matura MT Script Capitals, Meiryo, Menlo, Microsoft Sans Serif, Mistral, Modern No. 20, Momo, Mona Lisa Solid ITC TT, Monaco, MS Gothic, MS Mincho, MS PGothic, MS PMincho, MS Reference Sans Serif, MS Reference Specialty, Mshtakan, MT Extra, Myanmar MN, Myanmar Sangam MN, Nadeem, Nanum Brush Script, Nanum Gothic, Nanum Myeongjo, Nanum Pen Script, New Peninim MT, News Gothic MT, Noteworthy, Onyx, Optima, Oriya MN, Oriya Sangam MN, Osaka, Palatino, Papyrus, Party LET, PCMyungjo, Perpetua, Perpetua Titling MT, PilGi, Plantagenet Cherokee, Playbill, PMingLiU, PortagoITC TT, Princetown LET, PT Sans, PT Sans Caption, PT Sans Narrow, Raanana, Rockwell, Rockwell Extra Bold, Santa Fe LET, Sathu, Savoye LET, SchoolHouse Cursive B, SchoolHouse Printed A, SerpentineSansICG, Silom, SimSun, Sinhala MN, Sinhala Sangam MN, Skia, Snell Roundhand, Songti SC, Stencil, STFangsong, STHeiti, STIXGeneral, STIXIntegrals, STIXIntegralsD, STIXIntegralsSm, STIXIntegralsUp, STIXIntegralsUpD, STIXIntegralsUpSm, STIXNonUnicode, STIXSize1, STIXSize2, STIXSize3, STIXSize4, STIXSize5, STIXSizeFiveSym, STIXSizeFourSym, STIXSizeOneSym, STIXSizeThreeSym, STIXSizeTwoSym, STIXVariants, STKaiti, Stone Sans ITC TT, Stone Sans Sem ITC TT, STSong, Symbol, Synchro LET, Tahoma, Tamil MN, Tamil Sangam MN, Telugu MN, Telugu Sangam MN, Thonburi, Times, Times New Roman, Trebuchet MS, Trek, Tw Cen MT, Type Embellishments One LET, Verdana, Wawati SC, Wawati TC, Webdings, Weibei SC, Weibei TC, Wide Latin, Wingdings, Wingdings 2, Wingdings 3, Xingkai SC, Yuanti SC, Yuppy SC, Yuppy TC, Zapf Dingbats, Zapfino, Apple Braille, Apple Chancery, Apple Color Emoji, Apple LiGothic, Apple LiSung, Apple SD Gothic Neo, Apple Symbols, AppleGothic, AppleMyungjo, Monotype Corsiva, Monotype Sorts
or you can usetypeFacesList=(`osascript -e 'tell application "Font Book"' -e ' set fontList to name of typefaces' -e 'end tell'`)
to return more...
Abadi MT Condensed Extra Bold, Abadi MT Condensed Light, Academy Engraved LET Plain:1.0, Al Bayan Plain, Al Bayan Bold, American Typewriter Light, American Typewriter, American Typewriter Bold, American Typewriter Condensed, American Typewriter Condensed Light, American Typewriter Condensed Bold, Andale Mono, Andale Mono, Apple Braille Outline 6 Dot, Apple Braille Outline 8 Dot, Apple Braille Pinpoint 6 Dot, Apple Braille Pinpoint 8 Dot, Apple Braille, Apple Chancery, Apple Color Emoji, Apple LiGothic Medium, Apple LiSung Light, Apple SD Gothic Neo Light, Apple SD Gothic Neo Medium, Apple SD Gothic Neo Regular, Apple SD Gothic Neo Thin, Apple SD Gothic Neo UltraLight, Apple SD Gothic Neo Bold, Apple SD GothicNeo ExtraBold, Apple SD Gothic Neo Heavy, Apple SD Gothic Neo SemiBold, Apple Symbols, AppleGothic Regular, AppleMyungjo Regular, Arial, Arial, Arial, Arial Italic, Arial Italic, Arial Italic, Arial Bold, Arial Bold, Arial Bold, Arial Bold Italic, Arial Bold Italic, Arial Bold Italic, Arial Black, Arial Black, Arial Hebrew, Arial Hebrew Bold, Arial Narrow, Arial Narrow, Arial Narrow Italic, Arial Narrow Italic, Arial Narrow Bold, Arial Narrow Bold, Arial Narrow Bold Italic, Arial Narrow Bold Italic, Arial Rounded MT Bold, Arial Rounded MT Bold, Arial Unicode MS, Avenir Book, Avenir Light, Avenir Medium, Avenir Roman, Avenir Book Oblique, Avenir Light Oblique, Avenir Medium Oblique, Avenir Oblique, Avenir Black, Avenir Heavy, Avenir Black Oblique, Avenir Heavy Oblique, Avenir Next Medium, Avenir Next Regular, Avenir Next Ultra Light, Avenir Next Italic, Avenir Next Medium Italic, Avenir Next Ultra Light Italic, Avenir Next Bold, Avenir Next Demi Bold, Avenir Next Heavy, Avenir Next Bold Italic, Avenir Next Demi Bold Italic, Avenir Next Heavy Italic, Avenir Next Condensed Medium, Avenir Next Condensed Regular, Avenir Next Condensed Ultra Light, Avenir Next Condensed Italic, Avenir Next Condensed Medium Italic, Avenir Next Condensed Ultra Light Italic, Avenir Next Condensed Bold, Avenir Next Condensed Demi Bold, Avenir Next Condensed Heavy, Avenir Next Condensed Bold Italic, Avenir Next Condensed Demi Bold Italic, Avenir Next Condensed Heavy Italic, Ayuthaya, Baghdad, Bangla MN, Bangla MN Bold, Bangla Sangam MN, Bangla Sangam MN Bold, Bank Gothic Light, Bank Gothic Medium, Baskerville, Baskerville Italic, Baskerville Bold, Baskerville SemiBold, Baskerville Bold Italic, Baskerville SemiBold Italic, Baskerville Old Face, Batang, Bauhaus 93, Bell MT, Bell MT Italic, Bell MT Bold, Bernard MT Condensed, BiauKai, Big Caslon Medium, Blackmoor LET Plain:2.0, BlairMdITC TT Medium, Bodoni Ornaments ITC TT, Bodoni SvtyTwo ITC TT Book, Bodoni SvtyTwo ITC TT BookIta, Bodoni SvtyTwo ITC TT Bold, Bodoni SvtyTwo OS ITC TT Book, Bodoni SvtyTwo OS ITC TT BookIt, Bodoni SvtyTwo OS ITC TT Bold, Bodoni SvtyTwo SC ITC TT Book, Book Antiqua, Book Antiqua Italic, Book Antiqua Bold, Book Antiqua Bold Italic, Bookman Old Style, Bookman Old Style Italic, Bookman Old Style Bold, Bookman Old Style Bold Italic, Bookshelf Symbol 7, Bordeaux Roman Bold LET Plain:1.0, Bradley Hand ITC TT Bold, Braggadocio, Britannic Bold, Brush Script MT Italic, Brush Script MT Italic, Calibri, Calibri Italic, Calibri Bold, Calibri Bold Italic, Calisto MT, Calisto MT Italic, Calisto MT Bold, Calisto MT Bold Italic, Cambria, Cambria Italic, Cambria Bold, Cambria Bold Italic, Candara, Candara Italic, Candara Bold, Candara Bold Italic, Capitals, Apple Casual, Century, Century Gothic, Century Gothic Italic, Century Gothic Bold, Century Gothic Bold Italic, Century Schoolbook, Century Schoolbook Italic, Century Schoolbook Bold, Century Schoolbook Bold Italic, Chalkboard, Chalkboard Bold, Chalkboard SE Light, Chalkboard SE Regular, Chalkboard SE Bold, Chalkduster, Charcoal CY, Cochin, Cochin Italic, Cochin Bold, Cochin Bold Italic, Colonna MT, Comic Sans MS, Comic Sans MS, Comic Sans MS Bold, Comic Sans MS Bold, Consolas, Consolas Italic, Consolas Bold, Consolas Bold Italic, Constantia, Constantia Italic, Constantia Bold, Constantia Bold Italic, Cooper Black, Copperplate Light, Copperplate, Copperplate Bold, Copperplate Gothic Bold, Copperplate Gothic Light, Corbel, Corbel Italic, Corbel Bold, Corbel Bold Italic, Corsiva Hebrew, Corsiva Hebrew Bold, Courier, Courier Oblique, Courier Bold, Courier Bold Oblique, Courier New, Courier New Italic, Courier New Bold, Courier New Bold Italic, Cracked, Curlz MT, Damascus, Damascus Bold, DecoType Naskh, Desdemona, Devanagari MT, Devanagari MT Bold, Devanagari Sangam MN, Devanagari Sangam MN Bold, Didot, Didot Italic, Didot Bold, Edwardian Script ITC, Engravers MT, Engravers MT Bold, Euphemia UCAS, Euphemia UCAS Italic, Euphemia UCAS Bold, Eurostile, Eurostile Bold, Footlight MT Light, Franklin Gothic Book, Franklin Gothic Book Italic, Franklin Gothic Medium, Franklin Gothic Medium Italic, Free Monospaced, Free Monospaced Oblique, Free Monospaced Bold, Free Monospaced Bold Oblique, Free Sans, Free Sans Oblique, Free Sans Bold, Free Sans Bold Oblique, Free Serif, Free Serif Italic, Free Serif Bold, Free Serif Bold Italic, Futura Medium, Futura Medium Italic, Futura Condensed Medium, Futura Condensed ExtraBold, Garamond, Garamond Italic, Garamond Bold, GB18030 Bitmap, Geeza Pro, Geeza Pro Bold, Geneva, Geneva CY, Georgia, Georgia, Georgia Italic, Georgia Italic, Georgia Bold, Georgia Bold, Georgia Bold Italic, Georgia Bold Italic, Gill Sans Light, Gill Sans, Gill Sans Italic, Gill Sans Light Italic, Gill Sans Bold, Gill Sans Bold Italic, Gill Sans MT, Gill Sans MT Italic, Gill Sans MT Bold, Gill Sans MT Bold Italic, Gill Sans Ultra Bold, Gloucester MT Extra Condensed, Goudy Old Style, Goudy Old Style Italic, Goudy Old Style Bold, Gujarati MT Bold, Gujarati MT, Gujarati Sangam MN, Gujarati Sangam MN Bold, Gulim, GungSeo Regular, Gurmukhi MN, Gurmukhi MN Bold, Gurmukhi MT, Gurmukhi Sangam MN, Gurmukhi Sangam MN Bold, Haettenschweiler, Handwriting - Dakota, Harrington, HeadLineA Regular, Hei Regular, Heiti SC Light, Heiti SC Medium, Heiti TC Light, Heiti TC Medium, Helvetica Light, Helvetica, Helvetica Light Oblique, Helvetica Oblique, Helvetica Bold, Helvetica Bold Oblique, Helvetica CY Plain, Helvetica CY Oblique, Helvetica CY Bold, Helvetica CY BoldOblique, Helvetica Neue Light, Helvetica Neue Medium, Helvetica Neue, Helvetica Neue UltraLight, Helvetica Neue Italic, Helvetica Neue Light Italic, Helvetica Neue UltraLight Italic, Helvetica Neue Bold, Helvetica Neue Bold Italic, Helvetica Neue Condensed Black, Helvetica Neue Condensed Bold, Herculanum, Hiragino Kaku Gothic Pro W3, Hiragino Kaku Gothic Pro W6, Hiragino Kaku Gothic ProN W3, Hiragino Kaku Gothic ProN W6, Hiragino Kaku Gothic Std W8, Hiragino Kaku Gothic StdN W8, Hiragino Maru Gothic Pro W4, Hiragino Maru Gothic ProN W4, Hiragino Mincho Pro W3, Hiragino Mincho Pro W6, Hiragino Mincho ProN W3, Hiragino Mincho ProN W6, Hiragino Sans GB W3, Hiragino Sans GB W6, Hoefler Text Ornaments, Hoefler Text, Hoefler Text Italic, Hoefler Text Black, Hoefler Text Black Italic, Impact, Impact, Imprint MT Shadow, Improv ICG, InaiMathi, Jazz LET Plain:1.0, Kai Regular, Kailasa Regular, Kaiti SC Regular, Kaiti SC Black, Kaiti SC Bold, Kannada MN, Kannada MN Bold, Kannada Sangam MN, Kannada Sangam MN Bold, Kefa Regular, Kefa Bold, Khmer MN, Khmer MN Bold, Khmer Sangam MN, Kino MT, Kokonor Regular, Krungthep, KufiStandardGK, Lao MN, Lao MN Bold, Lao Sangam MN, LiHei Pro, LiSong Pro, Lucida Blackletter, Lucida Bright, Lucida Bright Demibold, Lucida Bright Demibold Italic, Lucida Calligraphy Italic, Lucida Console, Lucida Fax Regular, Lucida Fax Italic, Lucida Fax Demibold, Lucida Fax Demibold Italic, Lucida Grande, Lucida Grande Bold, Lucida Handwriting Italic, Lucida Sans Regular, Lucida Sans Italic, Lucida Sans Demibold Roman, Lucida Sans Typewriter Regular, Lucida Sans Typewriter Oblique, Lucida Sans Typewriter Bold, Lucida Sans Typewriter Bold Oblique, Lucida Sans Unicode, Machine Tool Gothic, Machine Tool SanSerif, Malayalam MN, Malayalam MN Bold, Malayalam Sangam MN, Malayalam Sangam MN Bold, Marion Regular, Marion Italic, Marion Bold, Marker Felt Thin, Marker Felt Wide, Marlett, Matura MT Script Capitals, Meiryo, Meiryo Italic, Meiryo Bold, Meiryo Bold Italic, Menlo Regular, Menlo Italic, Menlo Bold, Menlo Bold Italic, Microsoft Sans Serif, Mistral, Modern No. 20, Momo, Mona Lisa Solid ITC TT, Monotype Corsiva, Monotype Sorts, MS Gothic, MS Mincho, MS PMincho, MS Reference Specialty, Mshtakan, Mshtakan Oblique, Mshtakan Bold, Mshtakan BoldOblique, MT Extra, Myanmar MN, Myanmar MN Bold, Myanmar Sangam MN, Nadeem, Nanum Brush Script, NanumGothic, NanumGothic Bold, NanumGothic ExtraBold, NanumMyeongjo, NanumMyeongjo Bold, NanumMyeongjo ExtraBold, Nanum Pen Script, New Peninim MT, New Peninim MT Inclined, New Peninim MT Bold, New Peninim MT Bold Inclined, News Gothic MT Italic, News Gothic MT Bold, Noteworthy Light, Noteworthy Bold, Onyx, Optima Regular, Optima Italic, Optima Bold, Optima ExtraBlack, Oriya MN, Oriya MN Bold, Oriya Sangam MN, Oriya Sangam MN Bold, Osaka, Osaka-Mono, Palatino, Palatino, Palatino Italic, Palatino Bold, Palatino Bold, Palatino Bold Italic, Palatino Bold Italic, Papyrus, Papyrus Condensed, Party LET Plain:1.0, PCMyungjo Regular, Perpetua, Perpetua Italic, Perpetua Bold, Perpetua Bold Italic, Perpetua Titling MT Light, Perpetua Titling MT Bold, PilGi Regular, Plantagenet Cherokee, Playbill, PMingLiU, PortagoITC TT, Princetown LET, PT Sans, PT Sans Italic, PT Sans Bold, PT Sans Bold Italic, PT Sans Caption, PT Sans Caption Bold, PT Sans Narrow, PT Sans Narrow Bold, Raanana, Raanana Bold, Rockwell, Rockwell Italic, Rockwell Bold, Rockwell Extra Bold, Santa Fe LET Plain:1.0, Sathu, Savoye LET Plain:1.0, SchoolHouse Cursive B, SchoolHouse Printed A, SerpentineSansICG-BoldOblique, SerpentineSansICG-BoldOblique, Silom, SimSun, Sinhala MN, Sinhala MN Bold, Sinhala Sangam MN, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Skia Regular, Snell Roundhand, Snell Roundhand Black, Snell Roundhand Bold, Songti SC Light, Songti SC Regular, Songti SC Black, Songti SC Bold, Stencil, STXihei, STHeiti, STIXGeneral-Regular, STIXGeneral-Italic, STIXGeneral-Bold, STIXIntegralsSmall, STIXIntegralsUp, STIXIntegralsUpDisplay, STIXIntegralsUpSmall, STIXIntegralsDisplay-Bold, STIXIntegralsUpDisplay-Bold, STIXIntegralsD-Regular, STIXIntegralsD-Bold, STIXIntegralsSm-Regular, STIXIntegralsSm-Bold, STIXIntegralsUp-Regular, STIXIntegralsUp-Bold, STIXIntegralsUpD-Regular, STIXIntegralsUpD-Bold, STIXIntegralsUpSm-Regular, STIXIntegralsUpSm-Bold, STIXNonUnicode-Regular, STIXNonUnicode-Italic, STIXNonUnicode-Bold, STIXNonUnicode-BoldItalic, STIXSize1Symbols, STIXSize1Symbols-Bold, STIXSize2Symbols, STIXSize2Symbols-Bold, STIXSize3Symbols, STIXSize3Symbols-Bold, STIXSize4Symbols, STIXSize4Symbols-Bold, STIXSize5Symbols, STIXSizeFiveSym-Regular, STIXSizeFourSym-Regular, STIXSizeOneSym-Regular, STIXSizeOneSym-Bold, STIXSizeThreeSym-Regular, STIXSizeThreeSym-Bold, STIXSizeTwoSym-Regular, STIXVariants-Regular, STKaiti, Stone Sans ITC TT Bold, Stone Sans Sem ITC TT Semi, STSong, Symbol, Synchro LET, Tahoma, Tahoma Bold, Tahoma Negreta, Tamil MN, Tamil MN Bold, Tamil Sangam MN, Tamil Sangam MN Bold, Telugu MN, Telugu MN Bold, Telugu Sangam MN Bold, Thonburi, Thonburi Bold, Times Roman, Times Italic, Times Bold, Times Bold Italic, Times New Roman, Times New Roman Italic, Times New Roman Bold, Times New Roman Bold Italic, Times New Roman Bold Italic, Trebuchet MS, Trebuchet MS, Trebuchet MS Italic, Trebuchet MS Italic, Trebuchet MS Bold, Trebuchet MS Bold, Trebuchet MS Bold Italic, Trebuchet MS Bold Italic, Trek DS9 Credits Text, Tw Cen MT Italic, Tw Cen MT Bold, Type Embellishments One LET Embellishments One LET Plain:1.0, Verdana, Verdana, Verdana Italic, Verdana Italic, Verdana Bold, Verdana Bold Italic, Webdings, Weibei SC Bold, Wingdings, Wingdings, Wingdings 3, Yuanti SC Light, Xingkai SC Bold, Lantinghei TC Heavy, STIXIntegralsUpSmall-Bold, Times New Roman, Lantinghei SC Heavy, MS Reference Sans Serif, Sinhala Sangam MN Bold, STIXGeneral-BoldItalic, Telugu Sangam MN, Tw Cen MT Bold Italic, Xingkai SC Light, Yuppy SC Regular, Wawati TC Regular, Lantinghei TC Extralight, Monaco, MS PGothic, STIXIntegralsSmall-Bold, Tahoma, Lantinghei SC Extralight, Palatino Italic, STIXSizeFourSym-Bold, Wide Latin, Wingdings 2, Wingdings 2, Yuppy TC Regular, Lantinghei SC Demibold, Times New Roman Italic, Verdana Bold, Yuanti SC Bold, Lantinghei TC Demibold, STIXIntegralsDisplay, Tw Cen MT, Verdana Bold Italic, Wawati SC Regular, Yuanti SC Regular, Zapfino, Libian SC Regular, Lucida Bright Italic, News Gothic MT, Optima Bold Italic, Rockwell Bold Italic, STFangsong, STIXSizeTwoSym-Bold, STIXVariants-Bold, Stone Sans Sem ITC TT SemiIta, Times New Roman Bold, Weibei TC Bold, Wingdings 3, Zapf Dingbats, Baoli SC Regular, Lucida Sans Demibold Italic
I'll try it on another mac later in the week...you can be more specific
e.g.
tell application "Font Book"
set fontList to family name of typefaces of font collection "Traditional"
end tell--{"Fixed Width", "Fun", "Modern", "New-1", "PDF", "Traditional", "Web", "Windows Office Compatible"}
john -
Thanks 'driven' - I knew there had to be a simpler way !
-
I have a java program that runs on both Win and OSX if you want a copy.
-
John - and there is no flashing console windows when you perform that?
@unknownuser said:
I have a java program that runs on both Win and OSX if you want a copy.
I'm good with these solutions here - I prefer them over Flash and Java as then we don't have to rely on plugins to be installed. There's too many users with out of date versions which these days get blocked by browsers or they are locked down due to office policy.
-
@driven said:
If you want a list in ruby
fontList=(`osascript -e 'tell application "Font Book"' -e ' set fontList to name of every font family' -e 'end tell'`)
Tried it on my Mac Mini - I started this Font Book application which appeared in the dock (not something I'd really want.)
And it was also very slow. Took about 2-3 seconds.
-
Of course, running it a second time it's much faster. So it's the overhead of starting the Font Book app.
-
How about [MAC]:
fontList=system(
/usr/bin/fc-list : file family | grep /Library)
?? -
Returned
false
-
How about:
fontList=system(
"#!/bin/bash/usr/bin\n/fc-list : file family | grep /Library")
-
false
-
In normal Console:
/usr/bin/fc-list : file family | grep \/Library
Return:
-bash: /usr/bin/fc-list: No such file or directory
cd /usr/bin/ fc-list : family
Return:
List of just font names.fc-list : file family | grep \/Library
Returns:
NothingBut getting the result of system call under SketchUp, with the
system
method - all I get isfalse
. -
http://stackoverflow.com/a/3159997/486990
Either:
system('foobarCommand')
The latter will return the output - the former will output to standard output but return true/false.
` >> system('echo hi')
hi
=> trueecho hi
=> "hi\n"`(This was using IRB from a system console)
However, using Ruby Console:
but
-
System IRB console:
>> system 'echo hi' hi => true
SketchUp Console:
` > system 'echo hi'
truesystem 'fc-list'
false`What gives?
Advertisement