Browse Source

Added single quote string support to font parser

v1.x
Tj Holowaychuk 14 years ago
parent
commit
4538b9f5ca
  1. 2
      lib/context2d.js
  2. 2
      test/canvas.test.js

2
lib/context2d.js

@ -39,7 +39,7 @@ var baselines = ['alphabetic', 'top', 'bottom', 'middle', 'ideographic', 'hangin
var weights = 'normal|bold|bolder|lighter|[1-9]00'
, styles = 'normal|italic|oblique'
, units = 'px|pt|pc|in|cm|mm|%'
, string = '"([^"]+)"|[\\w-]+';
, string = '\'([^\']+)\'|"([^"]+)"|[\\w-]+';
/**
* Font parser RegExp;

2
test/canvas.test.js

@ -76,6 +76,8 @@ module.exports = {
, { size: 50, unit: 'px', family: '"Helvetica Nueue", sans-serif' }
, '50px "Helvetica Nueue", "foo bar baz" , sans-serif'
, { size: 50, unit: 'px', family: '"Helvetica Nueue", "foo bar baz" , sans-serif' }
, "50px 'Helvetica Nueue'"
, { size: 50, unit: 'px', family: "'Helvetica Nueue'" }
, 'italic 20px Arial'
, { size: 20, unit: 'px', style: 'italic', family: 'Arial' }
, 'oblique 20px Arial'

Loading…
Cancel
Save