function trimString(str)
        {
            return str.replace(new RegExp("^[\\s\"']+", "g"), "").replace(new RegExp("[\\s\"']+$", "g"), "");
        }
For the fonts in CSS to be applied when rendering images on canvas, the actual
font data must be made available via a data URI encoding of the file.