This is often done in javascript to calculate the width of an item, but for various reasons, I need to give this width to the javascript. The module that I'm using is in C++ (compiled via emscripten), and I was wondering if there are any C++ (or C) libraries that are able to calculate the width of text based on a string of text, font-size, and font-family. For example:
int get_pixel_width(char * str, float font_size, char * font_family);
I know there is something to do this in .net but haven't been able to locate anything in C/C++