require 2nd arg to registerFont, match CSS spec better
* Canvas.registerFont is now implemented entirely in C++
* second arg is required and must have at least `family`.
the others default to 'normal' per w3 fonts specification
* when there is a family match for registered fonts, it
should be chosen even if weight/style are wrong. this is
also in the spec
* update example and documentation
canvas.toDataURL('image/jpeg', quality, function(err, jpeg){ }); // spec-following; quality from 0 to 1
canvas.toDataURL('image/jpeg', quality, function(err, jpeg){ }); // spec-following; quality from 0 to 1
```
```
### Canvas#registerFont for bundled fonts
### Canvas.registerFont for bundled fonts
It can be useful to use a custom font file if you are distributing code that uses node-canvas and a specific font. Or perhaps you are using it to do automated tests and you want the renderings to be the same across operating systems regardless of what fonts they have installed.
It can be useful to use a custom font file if you are distributing code that uses node-canvas and a specific font. Or perhaps you are using it to do automated tests and you want the renderings to be the same across operating systems regardless of what fonts are installed.
To do that, you should use `Canvas#registerFont`.
To do that, you should use `Canvas.registerFont`.
**You need to call it before the Canvas is created**
**You need to call it before the Canvas is created**
ctx.fillText(250, 10, 'Everyone hates this font :(');
ctx.fillText(250, 10, 'Everyone hates this font :(');
```
```
The second argument is an object with properties that resemble the CSS properties that are specified in `@font-face` rules. You must specify at least `family`. `weight`, and `style` are optional (and default to "normal").
### CanvasRenderingContext2D#patternQuality
### CanvasRenderingContext2D#patternQuality
Given one of the values below will alter pattern (gradients, images, etc) render quality, defaults to _good_.
Given one of the values below will alter pattern (gradients, images, etc) render quality, defaults to _good_.