made minor changes so it would compile and also added the neccessary font logic so that the correct measureText works for canvas