Functions / text baseline
baseline(baseline)
baseline( )
baseline(string baseline)

Allows to set or check baseline of jCanvaScript text. By default it is 'alphabetic'.

Possible values: 'top' - The text baseline is the top of the em square, 'hanging' - The text baseline is the hanging baseline. Currently unsupported; this will act like alphabetic, 'middle' - The text baseline is the middle of the em square, 'alphabetic' - The text baseline is the normal alphabetic baseline, 'ideographic' - The text baseline is the ideographic baseline; this is the bottom of the body of the characters, if the main body of characters protrudes beneath the alphabetic baseline. Currently unsupported; this will act like alphabetic, 'bottom'

baseline( )
return: string baseline
Code
<script type="text/javascript">
	function start_1(idCanvas)
	{
		alert(jc('#myText_1').baseline());
	}
	function stop_1(idCanvas)
	{
		jc('#myText_1')
			.baseline('top');
		jc.start(idCanvas);
	}
	function onload_1(idCanvas)
	{
		jc.start(idCanvas);
		jc.text("Text example",90,130)
			.id('myText_1');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px"></canvas>
View
baseline(string baseline)
return: object
Code
<script type="text/javascript">
	function start_2(idCanvas)
	{
		jc('#myText_2')
			.baseline('top');
		jc.start(idCanvas);
	}
	function stop_2(idCanvas)
	{
		jc('#myText_2')
			.baseline('alphabetic');
		jc.start(idCanvas);
	}
	function onload_2(idCanvas)
	{
		jc.start(idCanvas);
		jc.text("Text example",90,130)
			.id('myText_2');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px"></canvas>
View