cairo_set_font(mCT, mFont);
SelectFont(mCT);
nsSVGCairoGlyphMetrics::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval){  *_retval = nsnull;  cairo_glyph_t glyph;  cairo_text_extents_t extent;  glyph.x = glyph.y = 0;  nsAutoString text;  mSource->GetCharacterData(text);  glyph.index = text[charnum];  cairo_set_font(mCT, mFont);  cairo_glyph_extents(mCT, &glyph, 1, &extent);  nsCOMPtr<nsIDOMSVGRect> rect = do_CreateInstance(NS_SVGRECT_CONTRACTID);  NS_ASSERTION(rect, "could not create rect");  if (!rect) return NS_ERROR_FAILURE;    rect->SetX(extent.x_bearing);  rect->SetY(extent.y_bearing);  rect->SetWidth(extent.width);  rect->SetHeight(extent.height);  *_retval = rect;  NS_ADDREF(*_retval);    return NS_OK;}