* registerFont is now implemented as a static member function of the
Canvas class itself. there is a static list of fonts registered
on the class, which are picked up by setting the font when necessary.
* register_font will fill in its second arg with a PangoFontDescription
that should resolve to the file specified
* to do that, freetype is now required again
this has the benefit of really simplifying the code, since we can use
pango_font_description_copy and remove the need for a couple helpers.
there is also no more need for setFontFromState since doing that becomes
a one-liner
the behavior of ctx.font should be unchanged, I tested the default font
as well as save and restore, of course
issue was limited to osx and windows
before this, if you create a canvas and get its context, the fonts would
freeze - you cannot add any fonts after getContext is called once, even
if you set up a new canvas. i fixed this by refreshing the Pango FontMap
(the component that does font lookups)
after you create a canvas+context, that canvas+context will not be able
to use new fonts, but that is less of a problem
this is implemented differently depending on the operating system. for
MacOS, CTFontManagerRegisterFontsForURL is the call to add a temporary
font. for Linux we use FontConfig, and for Windows use
AddFontResourceEx. all have been tested successfully
updated README and examples/font.js
* this commit gets rid of the HAVE_PANGO pragma and HAVE_FREETYPE,
preferring the Pango sections of HAVE_PANGO. using Cairo methods for
fonts is discouraged (http://cairographics.org/FAQ/#using_pango),
and freetype was only ever needed for cairo font rendering, so that
code was running in the Pango build for no reason at all.
* it also gets rid of context2d's `addFont`, which was never compatible
with the Pango build. `FontFace` is completely removed since it was
never used by the Pango build either, and instead of parsing the fonts
with FreeType we will instead prefer to let the OS do that in
succeeding commits
* the Windows build has been updated to work with Pango, which it did
not before
TL;DR - Pango is now required and and as of this commit custom fonts are
removed