diff --git a/src/text/ParagraphStyle.js b/src/text/ParagraphStyle.js index 6fcff771..c598a9c4 100644 --- a/src/text/ParagraphStyle.js +++ b/src/text/ParagraphStyle.js @@ -15,12 +15,45 @@ */ 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) { Base.initialize(this, style, { justification: 'left' }); }, + /** + * The justification of the paragraph. + * + * @name ParagraphStyle#justification + * @default 'left' + * @type string + */ + statics: { create: function(item) { var style = new ParagraphStyle(ParagraphStyle.dont);