paper.js/src/style/CharacterStyle.js

68 lines
1.5 KiB
JavaScript
Raw Normal View History

/*
* Paper.js
*
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
* based on Scriptographer.org and designed to be largely API compatible.
* http://paperjs.org/
* http://scriptographer.org/
*
* Distributed under the MIT license. See LICENSE file for details.
*
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
* http://lehni.org/ & http://jonathanpuckey.com/
*
* All rights reserved.
*/
var CharacterStyle = this.CharacterStyle = PathStyle.extend({
2011-05-23 19:28:55 +02:00
/** @lends CharacterStyle# */
_defaults: Base.merge({
fontSize: 10,
font: 'sans-serif'
}, PathStyle.prototype._defaults),
_owner: TextItem,
_style: '_characterStyle'
2011-05-23 19:28:55 +02:00
/**
* CharacterStyle objects don't need to be created directly. Just pass an
* object to {@link TextItem#characterStyle}, it will be converted to a
* CharacterStyle object internally.
2011-06-14 22:59:45 +01:00
*
* @name CharacterStyle
* @constructor
2011-05-23 19:28:55 +02:00
* @param {object} style
*
* @class The CharacterStyle object represents the character style of a text
* item ({@link TextItem#characterStyle})
*
* Example:
* <code>
2011-05-23 19:28:55 +02:00
* var text = new PointText(new Point(50, 50));
* text.content = 'Hello world.';
* text.characterStyle = {
* fontSize: 50,
* fillColor: 'black',
* };
* </code>
2011-05-27 13:54:27 +02:00
*
* @extends PathStyle
2011-05-23 19:28:55 +02:00
*/
2011-05-23 19:28:55 +02:00
/**
* The font of the character style.
2011-06-14 22:59:45 +01:00
*
2011-05-23 19:28:55 +02:00
* @name CharacterStyle#font
* @default 'sans-serif'
* @type String
2011-05-23 19:28:55 +02:00
*/
/**
* The font size of the character style in points.
2011-06-14 22:59:45 +01:00
*
2011-05-23 19:28:55 +02:00
* @name CharacterStyle#fontSize
* @default 10
* @type Number
2011-05-23 19:28:55 +02:00
*/
});