Thread font load errors from platform font loading code to
FontContext::get_layout_font_group_for_style, and cache the failure
result, instead of panicing the thread when a font fails to load.
Before this patch, a failed font load would panic a LayoutTask,
causing a cascade of panics, eventually aborting the whole engine
during a panic within panic.
This used to conflict with the util crate from the standard library, which
has long since been removed.
The import in layout has not been changed because of a conflict with the
util mod there.
'oblique' font-style is not supported now.
When I checked freetype.h, same macro is used for italic and oblique.
/* FT_STYLE_FLAG_ITALIC :: */
/* Indicates that a given face style is italic or oblique. */
So, when font style is 'oblique', enable flag for italic.
With tests/html/test_italic_bold.html, it works well.
Previously, any font template that could not be found would return
an item from the last resort font family. Now, the last resort font
family is only searched if the entire list of supplied font families
is empty.
The font cache previously kept weak references to the fonts,
however in layout these fonts are dropped before they are
referenced again, so no caching was being used.
For now, just hold a strong reference in the cache, which means
that fonts will never be thrown out (this will need to be fixed
in the future).