Patch is now ok, but I am perplexed by this line
 
-                run_callback(callback_id, "ddd->L", tex_font, g->gd[i].gid, streamprovider, &result);
+                run_callback(callback_id, "ddd->L", tex_font, g->gd[i].gid, 2, &result);

It's not clear why now we use 2.
Perhaps it's better to introduce another variable, i.e.
int actual_streamprovider ;
if actual_streamprovider>2 {
  actual_streamprovider=2;
}
run_callback(callback_id, "ddd->L", tex_font, g->gd[i].gid, actual_streamprovider, &result);

Or add a comment  before , something like
/* The streamprovider here is always 2 because... */

--
luigi