Text: have an option to specify anchor position of text box
I wondered how to label an axis-like object, and rami kindly showed me a solution:
Two significant downsides with this is the complexity of the labelling method and that the text has to be rendered via LaTeX; this makes the minus signs unfortunately look fuzzy (something perhaps to do with using image fonts or something like that?). And even with this, getting the alignment correct is a bit of a game - I've figured that on my screen, I have to shift the box 3 pixels to the right from centre because of the way that Geogebra places a Text when the content is a TableText.
Far simpler and more general would be to have an option for the Text function which specifies where the anchor is. At present, Text["x", (1,2)] places the text box so that the left end of the baseline is at (1,2); similarly, Text["jx",(1,2)] has the descender of the "j" going below y=2. What I would suggest/request is an extension of the Text command to offer something like the following if a fifth parameter is given (so that it does not break any existing geogebra files):
Text[ <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula>, <Anchor location> ]
where <Anchor location> specifies where the text box is in relation to <Point> as a two-letter string: the first letter is "l", "c", "r" specifying the left, centre or right of the text box; the second letter is "b", "l", "c", "t" specifying the baseline, lower edge, centre or top edge of the the text box. For example:
"lb" = <Point> is at left end of baseline (default)
"ll" = <Point> is at left lower corner of the text box
"ct" = <Point> is at centre top of the text box
"cc" = <Point> is at the centre of the text box
In that way, specifying that a label should be centred immediately below the point (1,2) would be:
Text["x", (1,2), false, false, "ct"]
The current solution, as demonstrated in that thread, involves setting up a sample text box using a TableText, measuring its size, and then placing the label at a position relative to (1,2) calculated from this sample text box.
What are people's thoughts on this?
Thanks for listening,