[Xerte] sub/super script?

John Horton John.Horton at nottingham.ac.uk
Fri Nov 13 09:15:52 GMT 2009


From: Tenney Julian 
Sent: 12 November 2009 21:44
To: Xerte discussion list
Cc: Horton John
Subject: RE: [Xerte] sub/super script?

 

That is an understatement.

 

The options (and drawbacks of each)

 

- use font symbols from fonts that have them using the unicode
characters. You can't rely on the user having the big unicode font, and
can't install it on their system. Even the *best* font doesn't have all
of the symbols you need for *everything*;

- Use the embedded subscript - superscript font. This works quite well
if you can control the font display. Embed the fonts by making a
resources.swf with them in, then use the embedded font on the learning
object or text icons. You can embed normal verdana and the sub / super
fonts, and then mix them in a text icon <font
face="verdana">H</font<font face="sub">2</font><font
face="verdana">O</font>. Drawbacks are i) this is a pain in the arse;
ii) there are good reaons not to embed fonts - in toolkits its the
accesibility stuff, there are others;

- Use latex. <tex src="H^2"> in the text icons, but you can't do it
inline as you get an image back, so have to reference graphics, ie
'Hydrogen(1) is a gas. When it reacts with Oxygen(2), water forms(3).'
Not appropriate in all situations.

- Parse the text and handle it yourself. We have done this and split all
the text into individual movie clips, one word for each. We use a
convenient <sub> , </sub> tag and when we find it, we position the
movieclip accordingly, and set the font size. We have to lay out each
row of text like this, measuring as we go. Major pain - not easy to find
general rules that will position the text in different fonts nicely.
Also, it is actually good for acccessibility and other stuff to have the
text in one icon, rather than split to clips - notably if it needs to be
changed at runtime. There is an engine funtion to iconID.splitToClips()
if you want to see what you can do with the results;

 

We have scratched our heads long and hard on this one. John is in a much
better position to chime in if I've missed anything. John?

 

Nothing - other than to emphasise what a pity it is that:

 

(a)    Subscripts and superscripts aren't dealt with properly in fonts
(1, 2 and 3 usually exist, 4 sometimes does but the rest often don't ...
and even when they do, they're often smaller than the other numbers);

(b)   The Flash player doesn't implement <sub> and <sup>.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20091113/ea07ef4c/attachment.html


More information about the Xerte mailing list