Re: Inherited properties in MetaCard

Earle Lowe (starnet!apple!cpsc.ucalgary.ca!lowee)
Mon, 7 Jun 93 14:00:10 -0600

>In the 1.2 and earlier releases of MetaCard, when you get a
>display-attribute property (colors and fonts) that hasn't been set for
>a particular object, empty is returned. When the object is actually
>drawn, however, it uses the attributes of its parent (which in turn
>may be inherited).
>
>The question: should the object return empty in these cases, or go and
>fetch its parent's attributes?
>
>("inherited" is not a good word for this behavior, as it may be
>confused with the OO concept whereby derived objects inherit the
>members of their base classes. It could be be argued however that
>this earlier use is actually inaccurate since it mixes the
>parent-child metaphor with the base-derived metaphor. Any suggestions
>for a better term for the MetaCard behavior?)
>
>--
>***********************************************************************
>* Scott Raney 303-447-3936 Remember: the better you look, *
>* raney@metacard.com the more you'll see -- Lidia *
>***********************************************************************

I think the answer should definitely be YES! If I'm looking at a piece
of text, it is obvious to me that it has some font. I KNOW it has a
font and colour, it's obvious, I'm looking at it. If I ask MetaCard
for it's font, however, it tries to tell me that it has NO font.
Huh??? That's just impossible, since it must have a font to be
visible. I want the font it is being drawn in, which for all purposes
IS the font of the text, regardless if, to MetaCard, it is the font of
the stack and the text has no font. To me, the font it is drawn in is
it's font.

Concrete example:

Let's say I'm trying to implement subscripts. Normally a subscript is
in a slightly smaller font than the preceding character. (This is the
way TeX does it so it must be right ;-). Now I want to code something like
this: (pseudocode)

size := the fontsize of the preceding character of the selected text.
set the fontsize of the selected text to size - 2.
set the textshift of the selected text to -4

BUT, metacard makes me do something like this:

size := the fontsize of the preceding character
if size isempty then
size := the fontsize of the field
if size isempty then
size := the fontsize of the card
if size isempty then
size := the fontsize of the stack

etc.

UGH... This is something that I shouldn't have to worry about, it's
something that MetaCard should just do.

-Earle