e5474f0f4662729d9ddb88f39334722db1741f8f.svn-base 343 B

1234567891011121314
  1. var Font = require('./font');
  2. function FontMetrics() {
  3. this.data = {};
  4. }
  5. FontMetrics.prototype.getMetrics = function(family, size) {
  6. if (this.data[family + "-" + size] === undefined) {
  7. this.data[family + "-" + size] = new Font(family, size);
  8. }
  9. return this.data[family + "-" + size];
  10. };
  11. module.exports = FontMetrics;