[lcd] font ID

Apr 21, 2006 at 11:15pm

[lcd] font ID

is there a way how i can make sure that font IDs
work on all (three) platforms?

where do i find information about font IDs?
until now i was only using 2 fonts because
i did not know what font has what ID.

-IIO

#25585
Apr 22, 2006 at 6:33pm

On 22-Apr-2006, at 1:15, Roman Thilenius wrote:
> is there a way how i can make sure that font IDs
> work on all (three) platforms?

Schwierig.

> where do i find information about font IDs?
> until now i was only using 2 fonts because
> i did not know what font has what ID.

On Classic Mac OS, font IDs were assigned dynamically by the OS when
the font was installed. So, aside from standard fonts, the same font
would almost always have a different ID on a different machine. The
IDs used for standard fonts are documented in Inside Macintosh.
Available online at http://developer.apple.com.

IM recommended, since about 1985, not to store fonts by ID but rather
by name. Max’ insistence on storing fonts by ID has essentially made
it impossible to use anything other than standard fonts in patches.

Don’t blame me, it wasn’t my idea.

I haven’t read all the documentation for Carbon, but when using
QuickDraw the above will presumably apply equally. I really haven’t
studied Quartz much yet at all (even if that’s what we’re all
supposed to be using now); it wouldn’t surprise me if Quartz doesn’t
support font IDs at all. The whole font ID concept dates from a time
when Apple believed “no one will ever need more than 256 fonts.”

As for Windows… others here can give more detail than I can.

I think there as an object around that will convert a font name to
its font number (as defined on the machine). Maybe by Peter Swinnen?
It ought to turn up on maxobjects.com.

Even with names, the number of fonts you can safely use across all
three supported platforms is pretty limited.

– P.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +—> Litter Power & Litter Bundle for Jitter
Heavy-Duty Mathematics for Everyday Use
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#75448
Apr 22, 2006 at 7:10pm

#75449
Apr 23, 2006 at 10:53pm

> i wouldnt mind messaging “… chicago 12 …” to the
> lcd object (but it seems it does not work this way.
> how do you do it?).

#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P message 35 52 248 196617 clear , moveto 5 30 , font Courier 12 , write “Courier 12 point” , font Arial 16 , write “Arial 16 point”;
#P user lcd 35 99 311 49 1 1 0 0 0;
#P connect 1 0 0 0;
#P window clipboard copycount 2;

Works for me. This should presumably work crossplatform, assuming the fonts are available. But beware that the same-named font may not be identical across platforms, nor the font spacing.

#75450
Apr 24, 2006 at 2:42am

> #P message 35 52 248 196617 clear , moveto 5 30 , font Courier 12 , write “Courier 12 point” , font Arial 16 , write “Arial 16 point”;

weird, i could swear it did not work
when i tried it last time, but now it does.

#75451
Apr 24, 2006 at 12:04pm

The fontlist object does this (standard object).

jb

#75452
Apr 24, 2006 at 1:13pm

On 24-Apr-2006, at 14:04, Jeremy Bernstein wrote:
> The fontlist object does this (standard object).

Good point.

There’s something in fontlist.help about the mode message (and Font
family IDs) being Mac-only. Is there anything to elaborate on that?

On 24-Apr-2006, at 4:42, Roman Thilenius wrote:
> weird, i could swear it did not work
> when i tried it last time, but now it does.

lcd.help indicates that ‘font ‘ is a younger addition
to the syntax understood by lcd.

As Yogi Berra said, it’s amazin’ what you can observe just by
lookin’ (an admonishment to myself as much as to anyone else).

– P.

#75453

You must be logged in to reply to this topic.