XFontSet fontSet = NS_STATIC_CAST(XFontSet, GDK_FONT_XFONT(theFont));
XFontSet fontSet = NS_REINTERPRET_CAST(XFontSet, GDK_FONT_XFONT(theFont));
nsSystemFontsGTK::GetSystemFontInfo(GdkFont* iFont, nsFont* aFont, float aPixelsToTwips) const{  GdkFont *theFont = iFont;  aFont->style       = NS_FONT_STYLE_NORMAL;  aFont->weight      = NS_FONT_WEIGHT_NORMAL;  aFont->decorations = NS_FONT_DECORATION_NONE;    // do we have the default_font defined by GTK/GDK then  // we use it, if not then we load helvetica, if not then  // we load fixed font else we error out.  if (!theFont)    theFont = default_font; // GTK default font    if (!theFont)    theFont = ::gdk_font_load( GDK_DEFAULT_FONT1 );    if (!theFont)    theFont = ::gdk_font_load( GDK_DEFAULT_FONT2 );    if (!theFont)    return NS_ERROR_FAILURE;  Display *fontDisplay = GDK_FONT_XDISPLAY(theFont);  if (theFont->type == GDK_FONT_FONT) {    XFontStruct *fontStruct =        NS_STATIC_CAST(XFontStruct*, GDK_FONT_XFONT(theFont));    aFont->name.Truncate();    AppendFontName(fontStruct, aFont->name, fontDisplay);    aFont->weight = GetFontWeight(fontStruct, fontDisplay);    aFont->size = GetFontSize(fontStruct, aPixelsToTwips);  } else {    NS_ASSERTION(theFont->type == GDK_FONT_FONTSET,                 "theFont->type can only have two values");    XFontSet fontSet = NS_STATIC_CAST(XFontSet, GDK_FONT_XFONT(theFont));    XFontStruct **fontStructs;    char **fontNames;    int numFonts = ::XFontsOfFontSet(fontSet, &fontStructs, &fontNames);    if (numFonts == 0)      return NS_ERROR_FAILURE;    // Use the weight and size from the first font, but append all    // the names.    aFont->weight = GetFontWeight(*fontStructs, fontDisplay);    aFont->size = GetFontSize(*fontStructs, aPixelsToTwips);    nsString& fontName = aFont->name;    fontName.Truncate();    for (;;) {      AppendFontName(*fontStructs, fontName, fontDisplay);      ++fontStructs;      --numFonts;      if (numFonts == 0)        break;      fontName.AppendWithConversion(",");    }  }  return NS_OK;}