cairo_text_extents_t extent;
cairo_text_extents_t preceding_extent, charnum_extent;
nsSVGCairoGlyphMetrics::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval){  *_retval = nsnull;  cairo_text_extents_t extent;  nsAutoString text;  mSource->GetCharacterData(text);  SelectFont(mCT);  cairo_text_extents(mCT,                     NS_ConvertUCS2toUTF8(Substring(text, charnum, 1)).get(),                     &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;}