By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,782 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

a very small js library to include GRAPH COMMAND (lines,points, circle etc) and MATHsimbols

P: n/a
I developed a little javascript library for implement instruction like
LINE (x0,y0,x1,y1) or drawImage(x,y) and, to make it short, the graph
commands of JAVA. It is based on the <span> tag.

Also, based on the 'symbol' font and some trick with tables, i
developed a library to make maths on a web page (dinamically so to
have exercises always news for my students) for example the
instruction ww(frac(intrnd(1/10),intrnd(1/10)) prints a casual
fraction on the page and ww(exists,x,inset,A) prints the two
mathematical symbols and 'x' and 'A'.

This libraries have the very usefull property to work off-line (client
side), so students can change the code and make esperiments at their
home (and eventually re-put them on their own sites). It is also a way
to make students work with programmation (they love graphics)

You can see them at
www.giovanninicco.com/gnzip

or take them up at
www.giovanninicco.com/gnlib.zip.

If you are interested to use them or to develop some other
libraries,or just give a comment (good or bad) i would be very
pleased: wr***@giovanninicco.com

Giovanni Nicco
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
wr***@giovanninicco.com (Giovanni Nicco) writes:
Also, based on the 'symbol' font .... for example the instruction ww(frac(intrnd(1/10),intrnd(1/10))
prints a casual fraction on the page and ww(exists,x,inset,A) prints
the two mathematical symbols and 'x' and 'A'.


For this, you should not rely on the symbol font. From the example
page, I get:
---
ww(exists_,"x",inset,"A",_bar_,"x",leq,"1"); produces:
$ xA x1
---
I guess the character with the same number as the "$" sign comes out as
an "exists"-symbol in the symbol font, but that is not how fonts are
supposed to work.

My browser (Opera in this case) sees a "$" and thinks:
"a byte with the value 36 ... the page encoding is assumed to be
windows-1252 (that's a guess, the file contains not encoding
information and the server didn't send any), so that byte represents
Unicode code point 36 - the dollar sign. Does the currently selected
font, Symbol, have a glyph for code point 36? No. Bummer, then let's use
the default font."

It doesn't, as IE does, decide to arbitrarily show the 36th glyph
in the font file, a glyph that has the assiciated Unicode code
point 8707, not 36.

The code point for the "exists" symbol is 8707 (hexadecimal
0x2203). You can use it in a Javascript string as, e.g., "\u2203"
or in HTML as

or
&exist;

Ditto for the other Symbol glyphs, including greek letters.

Otherwise it looks fine in IE :)
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2

P: n/a
[...]
For this, you should not rely on the symbol font

You can use it in a Javascript string as, e.g., "\u2203"...

[...]

thanks, i will rebuild my library in that sense.
Bye
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.