DEMO || DOCUMENTATION
Description
This is a javascript based tool that uses the canvas object to draw symbols. Each symbol is defined using multiple curves and each curve consists of start, end and control point. The tool comes with two sets of curves with limited number of symbols, but more symbols and more sets can be created and added to the tool in the future. The tool allows decoration of the curves with images defined by user. While the tool features more than 20 options to customize it can be used in a simple configuration like this:
jQuery('#yourDivID').HandWriting();
Basic Usage
<script src="http://code.jquery.com/jquery-1.8.0.js"></script> <script src="jquery.handwriting.js"></script> <script> jQuery(document).ready(function($){ jQuery('#hello_world').HandWriting(); }); </script>
The tool gives errors when working with jquery versions lower than 1.8.0, because the absence of parseHTML method. All testing during development was performed with jquery 1.9.1.
<div id="hello_world" style="font-size: 16px; color: #888; position: relative; width: 580px; height: 280px;">Hello <span style="color:#fff">World</span></div>
The tool uses some absolute positioned canvas element in the targeted div, so it is a must that the div is with relative or absolute position. The font size and color of the targeted div are only used to display its content if javascript is disabled, thus these properties are not used in the actual animation. The text content can be styled with spans though, where color and few other options can be set.
Features
- two sets of symbols
The tool features two sets of symbols – one similar to Verdana font, and another one with more calligraphic look. - 85 symbols in each set
These are A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 0 . , ! ? ( ) [ ] ; : @ $ % & * = + – / ’ ” > < - size of animated symbols
Can be set using a scale parameter. Must be tuned manually to user’s needs, because different sets of symbols have different basic sizes. It is a float number where 1 means 100%. This parameter affects many aspects of the animation – space between letters, line height, padding, etc. - size of line height
This parameter is used when the text must be laid out on more than one line. It is set in pixels and is affected by the scale parameter. - color of text
Color can be set for all targeted objects with parameter, or can be set for individual parts of texts. Spans with inline color value can define that parameter. - stroke width
Line width can be set with parameter for all selected objects, or selectively for parts of text in span elements using data-width parameter. Line width is not affected by the scale parameter. - top/left offset
Two options allow the setting of offset from the top and side borders of the selected div. If the div has padding it will not be used for animation, but only to display content when javascript is not available. These parameters are in pixels and are affected by the scale parameter. - text alignment
It is possible to set left, right and center alignment for the text, which applies on all text. Text align can be set with inline style for the selected div objects, or with parameter. - curves speed drawing
Integer numbers that define in how many steps each curve of each symbol will be animated. One parameter is used for visible curves and another for the invisible curves between letters and words. These numbers are also used when images are place to decorate the curves. More parts mean more images over the curve. - pen
Pen can use different image set by user. Pen ball must be in top/left corner of pen image. Pen can be hidden. - images
Images can be used in the animation and are managed with several parameters. One of the parameters is an array of paths to images that the user intends to use. Another parameter is array of floats that each image will use to scale its size.
One method to use images is to put them zoomed out on each defined point on the curve. Then gradually zoom out the image to the scale defined. Images can be placed exactly on the curves or slightly offset which can defined with another parameters. Images can gradually rotate starting from random direction, or use fixed direction. The amount of frames to animate this behavior can be set. Very interesting results can be achieved depending on type of images used.
Another method of using images is to do short animations – for example blooming flower. Then store the animation in png files. There is a parameter that can force the tool to alternate the images and as a result the animation shows on all curves it is set for. - stroke above image
It is possible to define if the stroke will draw above or below the canvas that animates images. - pause
It is possible to pause and continue animation using public method - replay
A parameter can define if animation will play again after it is finished. - finish effect
When animation is done it can either fade or stay. If it is going to fade an interval can be set for duration of fade. If it is going to fade a wait interval can set, so text can be read before it fades. - overall speed
Speed can be set in milliseconds. It affects each frame animated. - complete
User can define a function that will execute when animation is complete.
Kindly Note: We update new contents like WordPress Themes, Plugins, PHP Scripts everyday. But remember that you should never use this items in a commercial website. All the contents posted here for development & testing purpose only. We’re not responsible for any damage, use at your own RISK! We highly recommend to buy jQuery Handwriting from the The Developer ( digitalplant ) website. Thank you.
Download = jQuery Handwriting-[Updated].zip