font.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. * @fileoverview Represents a font to be used with a Renderer.
  16. * @author arv@google.com (Erik Arvidsson)
  17. * @see ../demos/graphics/basicelements.html
  18. */
  19. goog.provide('goog.graphics.Font');
  20. /**
  21. * This class represents a font to be used with a renderer.
  22. * @param {number} size The font size.
  23. * @param {string} family The font family.
  24. * @constructor
  25. * @deprecated goog.graphics is deprecated. It existed to abstract over browser
  26. * differences before the canvas tag was widely supported. See
  27. * http://en.wikipedia.org/wiki/Canvas_element for details.
  28. * @final
  29. */
  30. goog.graphics.Font = function(size, family) {
  31. /**
  32. * Font size.
  33. * @type {number}
  34. */
  35. this.size = size;
  36. // TODO(arv): Is this in pixels or drawing units based on the coord size?
  37. /**
  38. * The name of the font family to use, can be a comma separated string.
  39. * @type {string}
  40. */
  41. this.family = family;
  42. };
  43. /**
  44. * Indication if text should be bolded
  45. * @type {boolean}
  46. */
  47. goog.graphics.Font.prototype.bold = false;
  48. /**
  49. * Indication if text should be in italics
  50. * @type {boolean}
  51. */
  52. goog.graphics.Font.prototype.italic = false;