An ink signature image generator that generates image data url from specific text content and font. This class provides importFontFamily API to import thirdparty fonts globally from remote what you needed.
More...
An ink signature image generator that generates image data url from specific text content and font. This class provides importFontFamily API to import thirdparty fonts globally from remote what you needed.
◆ constructor()
TypingInkSignImageGenerator::constructor |
( |
|
content = '' | ) |
|
|
inline |
◆ generateImage()
TypingInkSignImageGenerator::generateImage |
( |
|
width = 114 , |
|
|
|
height = 57 |
|
) |
| |
|
inline |
Generate typing ink signature image and transfromed into data url.
- Parameters
-
width | number Define image width |
height | number Define image height |
- Returns
- string - base64 data url of the image.
◆ getFontFamily()
TypingInkSignImageGenerator::getFontFamily |
( |
| ) |
|
|
inline |
Returns current font name.
- Returns
- string - the fon name.
◆ getFontSize()
TypingInkSignImageGenerator::getFontSize |
( |
| ) |
|
|
inline |
Returns current font size.
- Returns
- number - font size in pixel unit.
◆ importFontFamily()
TypingInkSignImageGenerator::importFontFamily |
( |
|
fontFamily, |
|
|
|
uri |
|
) |
| |
|
inline |
Import thirdparty font from specific url globally via -face rule in css.
- Parameters
-
fontFamily | String - The name of the font. |
uri | String - specify the font file URL where should be download from. |
◆ setContent()
TypingInkSignImageGenerator::setContent |
( |
|
content | ) |
|
|
inline |
Update the text content, it takes effect while calling the generateImage method next time.
- Parameters
-
◆ setFontFamily()
TypingInkSignImageGenerator::setFontFamily |
( |
|
fontFamily | ) |
|
|
inline |
Update the font name, it takes effect while calling the generateImage method next time.
- Parameters
-
fontFamily | string - the font name |
◆ setFontSize()
TypingInkSignImageGenerator::setFontSize |
( |
|
fontSize | ) |
|
|
inline |
Update the font size, it takes effect while calling the generateImage method next time.
- Parameters
-
fontSize | number - font size in pixel unit |