[Tutor] small graphics question

Alan Gauld alan.gauld at yahoo.co.uk
Tue Feb 9 20:41:54 EST 2021


On 10/02/2021 01:01, nathan tech wrote:

> 2. Yes, what I am actually asking is, how do I go about displaying 
> formulae styled strings in something such as the print function.
> 
> that is to say, for instance, print("2/3") should come out as 2, with a 
> line and the 3 under it.

For fractions there are some fonts with characters that represent the
common fractions. But they are very limited - half,third,quarters etc.

> Similarly 2 to the power of 3, should come out as 2 superscript 3.

Again some fonts offer squared and possibly cubed but you won;t get a
simple general solution that way, you really need to look at switching
font settings on a character by character basis.

I still think the HTMLtext widget may be he easiest way to go.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list