mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 14:22:08 -05:00
Add ParagraphStyle documentation.
This commit is contained in:
parent
50e996aa43
commit
de76b063b9
1 changed files with 33 additions and 0 deletions
|
@ -15,12 +15,45 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var ParagraphStyle = this.ParagraphStyle = Base.extend({
|
var ParagraphStyle = this.ParagraphStyle = Base.extend({
|
||||||
|
/** @lends ParagraphStyle# */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ParagraphStyle objects don't need to be created directly. Just pass an
|
||||||
|
* object to {@link TextItem#paragraphStyle}, it will be converted to a
|
||||||
|
* ParagraphStyle object internally.
|
||||||
|
*
|
||||||
|
* Currently, the ParagraphStyle object may seem a bit empty, with just the
|
||||||
|
* {@link #justification} property. Yet, we have lots in store for Paper.js
|
||||||
|
* when it comes to typography. Please stay tuned.
|
||||||
|
*
|
||||||
|
* @constructs ParagraphStyle
|
||||||
|
* @param {object} style
|
||||||
|
*
|
||||||
|
* @constructs ParagraphStyle
|
||||||
|
*
|
||||||
|
* @class The ParagraphStyle object represents the paragraph style of a text
|
||||||
|
* item ({@link TextItem#paragraphStyle})
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* var text = new PointText(new Point(0,0));
|
||||||
|
* text.fillColor = 'black';
|
||||||
|
* text.content = 'Hello world.';
|
||||||
|
* text.paragraphStyle.justification = 'center';
|
||||||
|
*/
|
||||||
initialize: function(style) {
|
initialize: function(style) {
|
||||||
Base.initialize(this, style, {
|
Base.initialize(this, style, {
|
||||||
justification: 'left'
|
justification: 'left'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The justification of the paragraph.
|
||||||
|
*
|
||||||
|
* @name ParagraphStyle#justification
|
||||||
|
* @default 'left'
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
|
||||||
statics: {
|
statics: {
|
||||||
create: function(item) {
|
create: function(item) {
|
||||||
var style = new ParagraphStyle(ParagraphStyle.dont);
|
var style = new ParagraphStyle(ParagraphStyle.dont);
|
||||||
|
|
Loading…
Reference in a new issue