diff --git a/lib/context2d.js b/lib/context2d.js index c25338e..a8e1a47 100644 --- a/lib/context2d.js +++ b/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; diff --git a/test/canvas.test.js b/test/canvas.test.js index 67bdb46..9c35359 100644 --- a/test/canvas.test.js +++ b/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'