[Oberon] Display patterns [WAS Re: ORD for typecasting Pointers]

Paul Reed paulreed at paddedcell.com
Mon Sep 14 11:57:18 CEST 2020


>> Fonts should import Display!
>     > The type Pattern should be in Display, as only Display knows the
> bit layout if you add colors to the system.
>     > br
>     > Jörg
> 
> Agreed (and done in EO).

I don't disagree, certainly that was the way it was originally; but I 
thought of this pattern as a sort of device-independent bitmap, 
specifying which pixels should be some foreground colour (or inverted, 
whatever that means in >1bpp) and which should be left at background, 
but of course all of this is quite messy as it meets varied real 
hardware.

Also I always like the removal of a dependency, ceteris paribus. Maybe 
that clouded my judgement. :)

Certainly loading the font is probably a good time to map this 
device-independent pattern to some sort of device-dependent bitmap, 
assuming lots of memory and a rich set of raster operations - and I 
agree that needs to be done by Display. OTOH, Display could perhaps 
maintain a hash table of patterns which are passed to it to keep the 
mapping private.

Yet another example of how an apparently simple and desirable feature, 
colour, can have a huge and unexpected cost.

It's the philosophy of Oberon to force an evaluation of what could 
possibly be worth the cost, looking from the point of view of those who 
have to design, implement and document, and later, understand again.

Cheers
Paul


More information about the Oberon mailing list