CGDataProviderCreateWithData just wraps the underlying buffer. The
underlying buffer needs to be kept around until the data provider is
freed. Adding the buffer to the FontTemplateData struct ensures it
sticks around.
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.
The freetype hinting only works on integer pixel sizes. For this
reason, the advance width metrics for a font of size 12.99 are
the same as the advance metrics for a font of size 12.0. This
results in small fonts appearing to overlap slightly, which is
particularly noticeable on parts of Wikipedia. Round the font
size up to a pixel boundary inside the freetype system.
Also fetch the system default fonts for the generic font families
rather than hard coding them.
These two changes make the font rendering on Linux very close
to the Firefox font rendering on Wikipedia.