Text tool can be used to add text of various fonts, colors and sizes to the photo.
var pixie = new Pixie({
onLoad: function() {
pixie.tools.text.add('my text');
}
});
Custom fonts can be added via text tool items
option.
If replaceDefault
is set to true
, all default fonts are replaced with specified ones. If it is set to false
, your additional fonts are appended.
var pixie = new Pixie({
tools: {
text: {
replaceDefault: false,
defaultCategory: 'handwriting',
items: [
{
family: 'Roboto',
src: 'fonts/open-sans-v27-latin-ext_latin-regular.woff2',
},
{
family: 'Fuzzy Bubbles',
src: 'fonts/fuzzy-bubbles-v3-latin-700.woff2',
descriptors: {weight: '700'},
}
]
}
}
})
Add specified text to canvas.
add(text?: string, providedConfig?: ITextOptions): void