An attempt for task T51368
Basically, the draw_em_measure_stats function was copied from drawobject.c to edit_mesh_mode.c with a few minor changes:
- All references to DerivedMesh have been deleted;
- The functions and enums of view3d_intern.h have been replaced by those of draw_maganer_text.h;
I had to call ED_view3d_init_mats_rv3d(ob, rv3d) to calculate rv3d->persmatob and use it in DRW_text_cache_draw. (This function seems unreliable because if it is called later with another object it can mess up the drawing).
I'm not sure which functions/headers will be removed in 2.8. So feel free to review or edit and/or commit.
*Some doubts are in the code comments