so it seems that if I assign a font family ending with a number it doesn't stick
a = document.createElement("div")
a.style.fontFamily = "Arial"
and a is then
<div style="font-family: Arial; "></div>
BUT
a = document.createElement("div")
a.style.fontFamily = "Goudy Bookletter 1911"
and a is then
<div></div>
I'm pretty sure its the ending number that is the problem. Since
a = document.createElement("div")
a.style.fontFamily = "Goudy Bookletter blablabla"
and a is then
<div style="font-family: 'Goudy Bookletter blablabla'; "></div>
Is this a bug? I'm doing this in chrome 16
Something about the spaces and numbers causes a problem when setting font-family. Enclosing the font-family name in single quotes allowed it to work in Chrome 16 for me.
http://jsfiddle.net/ZMxS4/1/
a.style.fontFamily = "'Goudy Bookletter 12'";
Without the quotes I saw the following odd behavior
a.style.fontFamily = "Goudy Bookletter12"; //works
a.style.fontFamily = "Goudy 12Bookletter"; //works
a.style.fontFamily = "Goudy 12 Bookletter"; //does not work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With