How to set the font size of a text object by script?

pegasusroe shared this question 9 months ago
Answered

Is it possible either by GGBScript or JavaScript to set the font size of a text object?

Comments (6)

photo
1

ie:

create a point A

then type FormulaText("\huge" A) in input line

photo
1

If you want set the text-size dynamic with scripts:

For *textSize* exist no script command in GGB and not in JS (that's a pity).

But it's possible to change the font-sizeM in XML in a text-object (with JS).

Attached a sample including the global-script setTagXML and getTagXML, whit this you can read or write each value in the XML of an GGB-object.

photo
1

I have problem with uploading the posts

I wanted to say that it is posible change the view style changing the size using formulatext and latex like in the attached that is possible with script in similar way

see also https://wiki.geogebra.org/e...

Files: foro.ggb
photo
1

The solution of mathmagic is much more easy and works also with a numeric value (instead of boolean)

photo
1

Do you need a flexibel size? If you only want to have a bigger version as normal I would use for this two text objects with the same content but different sizes. And I would make the one or the other visible depending on the condition you like.

photo
1

puede ser útil?

può essere utile?

© 2018 International GeoGebra Institute