font_param(const ref * pfdict, gs_font ** ppfont)
{	/*
         * Check that pfdict is a read-only dictionary, that it has a FID
         * entry whose value is a fontID, and that the fontID points to a
         * gs_font structure whose associated PostScript dictionary is
         * pfdict.
         */
    ref *pid;
    gs_font *pfont;
    const font_data *pdata;

    check_type(*pfdict, t_dictionary);
    if (dict_find_string(pfdict, "FID", &pid) <= 0 ||
        !r_has_type(pid, t_fontID)
        )
        return_error(gs_error_invalidfont);
    pfont = r_ptr(pid, gs_font);
    if (pfont == 0)
        return_error(gs_error_invalidfont);	/* unregistered font */
    pdata = pfont->client_data;
    if (!obj_eq(pfont->memory, &pdata->dict, pfdict))
        return_error(gs_error_invalidfont);
    *ppfont = pfont;
    return 0;
}
font_param(const ref * pfdict, gs_font ** ppfont)
{	 
    ref *pid;
    gs_font *pfont;
    const font_data *pdata;

    check_type(*pfdict, t_dictionary);
    if (dict_find_string(pfdict, "FID", &pid) <= 0 ||
        !r_has_type(pid, t_fontID)
        )
        return_error(gs_error_invalidfont);
    pfont = r_ptr(pid, gs_font);
    if (pfont == 0)
        return_error(gs_error_invalidfont);	 
    pdata = pfont->client_data;
    if (!obj_eq(pfont->memory, &pdata->dict, pfdict))
        return_error(gs_error_invalidfont);
    *ppfont = pfont;
    return 0;
}