 |
 |
App idea: Seamless font viewer?
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
I was thinking on the feasibility of recreating the functionality of viewing a font in OS 9. It's really useful being able to double click on a font anywhere on your computer and seeing what it looks like. Currently the only thing you can do is drag to the Fonts folder and then launch an app and try it out.
Could a background app run that's registered to open font type files and simply pop up a window in the Finder like in OS 9 with a simple preview of the font? Would be nice
If nobody's interested, is there at least some info on reading a font from anywhere on a computer (i.e. not just in the fonts folder?)
Thanks!
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2001
Location: Sweden
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
It probably wouldn't need to run in the background.. just make it a standard document-based application, register it to handle fonts, and make it an LSUIElement.
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status:
Offline
|
|
This would be a nice thing to have. I've sent Apple feedback on this, hoping they'd combine it with the Character Palette, but you know, it's like talking to a wall...
J
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
That above doc was for Carbon... not really my area of expertise (if you can even call my limited Obj-C knowledge an expertise...) Is anyone interested in tackling this?... It would be greatly appreciated.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
The Font Manager and ATS calls for activating and deactivating fonts (they're mostly equivalent) work just fine in a Cocoa app. We use FMActivateFonts to make any OmniAppKit-based application automatically load fonts from AppWrapper.app/Contents/Fonts... here's a snippet:
Code:
if (FSPathMakeRef([fontsDirectory fileSystemRepresentation], &myFSRef, NULL) == noErr)
if (FSGetCatalogInfo(&myFSRef, kFSCatInfoNone, NULL, NULL, &myFSSpec, NULL) == noErr)
FMActivateFonts(&myFSSpec, NULL, NULL, kFMLocalActivationContext);
Given fontsDirectory, an NSString containing the path to the fonts folder (could be a path to a font file, too), this snippet 1) gets an FSRef for the path, 2) gets an FFSpec from the FSRef, 3) activates any fonts at that file system location. kFMLocalActivationContext is used to activate the fonts only within the current application.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Okay, this caught my interest. Enjoy.
Ended up using ATSFontActivateFromFileSpecification instead of FMActivateFonts, since the latter doesn't tell you which fonts were activated... kind of important if you want to show a preview of them. 
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Rickster:
Okay, this caught my interest. Enjoy.
Ended up using ATSFontActivateFromFileSpecification instead of FMActivateFonts, since the latter doesn't tell you which fonts were activated... kind of important if you want to show a preview of them.
In case you're curious to know, it doesn't work at all on my machine. It murders the Finder if I try to open it from there, and the Terminal gives the following output if I just run the executable there:
2003-01-17 21:31:22.658 FontViewer[820] *** _NSAutoreleaseNoPool(): Object 0xa1980 of class NSCFString autoreleased with no pool in place - just leaking
2003-01-17 21:31:22.660 FontViewer[820] *** -[NSCFBoolean length]: selector not recognized
2003-01-17 21:31:22.660 FontViewer[820] *** _NSAutoreleaseNoPool(): Object 0xa3100 of class NSCFString autoreleased with no pool in place - just leaking
2003-01-17 21:31:22.663 FontViewer[820] *** _NSAutoreleaseNoPool(): Object 0xa31c0 of class NSCFString autoreleased with no pool in place - just leaking
2003-01-17 21:31:22.665 FontViewer[820] *** _NSAutoreleaseNoPool(): Object 0xa31a0 of class NSException autoreleased with no pool in place - just leaking
2003-01-17 21:31:22.668 FontViewer[820] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSCFBoolean length]: selector not recognized
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Hrm... works on all three machines I tested it on. They're all 10.2.3. I don't think I used any API specific to 10.2, though...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
Works fine for me. One question, Rickster - how did you solve the problem I had when I tried to do this, that LaunchServices refused to allow an application with an LSUIElement of 1 to be a document handler?
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: NYC
Status:
Offline
|
|
Neat.
X Font Info, another freeware app, does the same thing.
Why Apple didn't build this into OS X itself is odd. Guess it fell to the bottom of the to-do list.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|