Mac -> Win problems
charles.hartman at conncoll.edu
Tue Jul 26 17:43:42 EDT 2005
On Jul 26, 2005, at 4:11 PM, Phil Davis wrote:
> Even if you use Courier New and you find the Win and Mac equivalent
> textSizes, you'll still encounter the issue of different text
> origin points in the field on the respective platforms. (By 'origin
> point' I mean the x:y coordinate within the field where you would
> find the bottomLeft pixel of the first character in the field.)
OK, thanks. But how _do_ I find the real text size? The textSize
property just gives it in points, and those are pretty clearly not
equivalent cross-platform. Is there a text-size-in-pixels function
I'm missing somewhere? (Especially text _length_ -- that's where I'm
getting into trouble.)
If I had that, I could -- per platform -- figure the size of a bit of
(Courier) text and adjust all the "hiding" fields accordingly, though
it would sure be a chore.
> You can manage the text origin issue a couple of ways:
> - you can apply one set of field margins for Mac and another for
> - you can position the field at different locs on the different
> - you can display a screenshot of the field and not the field
> itself. This is my current favorite, because it's air-tight as long
> as (1) you're only dealing with screen displays, not printing, and
> (2) the displayed text will never need to be selected or edited by
> the end user. This option also lets you use whatever font you like,
> without regard to cross-platform anything.
If I understand what you're suggesting there at the end, it has the
same problem as the other solution I thought of: having alternative
versions of the text field in question, and replacing the initial
version (hey, presto) with a new one each time a button is pressed.
But it runs into a problem combinatorial explosion. If one card has
(say) four "hiding" fields to be hidden (revealing the underlying
marks), I have no way to predict the order in which the user will
click the buttons to do each of them. So I would need, just for that
card, sixteen versions of the field. Same with screenshots, as far as
I can see. Since there are several dozen cards in this section of the
stack, that's beginning to look like drudgery on a scale I can't afford.
I hope my description of the situation makes sense.
The solution I was trying to instantiate is one that worked quite
simply in HyperCard (a thousand years ago). Of course that wasn't
More information about the Use-livecode