As a follow-up to bug 1547063, it turns on that a further dependency on Cairo's glyph extents was hidden inside Moz2D.
This replaces that dependency with direct calls to query glyph bounds from the relevant APIs, all of this on the gfxFonts inside thebes, so that we don't have to descend into Moz2D across the information-loss barrier there or construct new Moz2D objects to do things. In many cases, we already have some of the metrics information available inside the gfxFonts already, so we get to reuse that now.
It also turns out that we have a gfxGlyphExtents caching layer that duplicates Cairo's own glyph metrics caching, so this should be a win in terms of resource usage.
I have endeavored to just try to faithfully reproduce the behavior of Cairo under the hood by in most cases just reproducing the code flow that was in Cairo (primarily inside the mess that is gfxGDIFont).