Debian Codegraph @

closure-library/closure/goog/graphics/font.js

raw
1 // Copyright 2007 The Closure Library Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS-IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15
16 /**
17 * @fileoverview Represents a font to be used with a Renderer.
18 * @author [email protected] (Erik Arvidsson)
19 * @see ../demos/graphics/basicelements.html
20 */
21
22
23 goog.provide('goog.graphics.Font');
24
25
26
27 /**
28 * This class represents a font to be used with a renderer.
29 * @param {number} size The font size.
30 * @param {string} family The font family.
31 * @constructor
32 * @deprecated goog.graphics is deprecated. It existed to abstract over browser
33 * differences before the canvas tag was widely supported. See
34 * http://en.wikipedia.org/wiki/Canvas_element for details.
35 * @final
36 */
37 goog.graphics.Font = function(size, family) {
38 /**
39 * Font size.
40 * @type {number}
41 */
42 this.size = size;
43 // TODO(arv): Is this in pixels or drawing units based on the coord size?
44
45 /**
46 * The name of the font family to use, can be a comma separated string.
47 * @type {string}
48 */
49 this.family = family;
50 };
51
52
53 /**
54 * Indication if text should be bolded
55 * @type {boolean}
56 */
57 goog.graphics.Font.prototype.bold = false;
58
59
60 /**
61 * Indication if text should be in italics
62 * @type {boolean}
63 */
64 goog.graphics.Font.prototype.italic = false;