Search This Site

Custom Search

Sunday, December 19, 2010

Re: [bloggerDev] Problem with Gadget Skins - FONT_FACE identified

Hey all, 

I believe we have fixed these issues. Can you guys confirm that the issues you were seeing are now fixed, and if not, give me the use cases that are failing?

brett

On Wed, Nov 10, 2010 at 4:23 PM, Aratina Cage <aratina.cag3@gmail.com> wrote:
I was just alerted to a problem where my gadget was not displaying the
font correctly, and I traced the problem down to a small but crucial
error in how the skin style for FONT_FACE is created on blogs that
have their main font modified through the Template Designer. What
happens is that a semicolon somehow gets attached to the end of the
FONT_FACE string. Normally the semicolon is not there, and unmodified
blogs have a FONT_FACE skin style that looks like this (\x27 is a
single quotation mark):

"normal normal 13px \x27Trebuchet MS\x27, Trebuchet, sans-serif"

But blogs that have their font-family or font-size changed through the
Template Designer get a FONT_FACE skin style with a semicolon tacked
to the end, like this:

"normal normal 13px \x27Trebuchet MS\x27, Trebuchet, sans-serif;"

The semicolon at the end renders the FONT_FACE style string unusable
when it is used to set the font style of an HTML element in
JavaScript. For example (you can test this in an HTML/JavaScript
gadget on your blog):

<div id="elementX">Test 123 Test</div>
<script>
var elementX = document.getElementById("elementX");

elementX.style.font = "normal normal 13px 'Trebuchet MS', Trebuchet,
sans-serif;"; // works in IE, does not work in Chrome, FF, Safari, or
Opera

elementX.style.font = "normal normal 13px 'Trebuchet MS', Trebuchet,
sans-serif"; // works in all major browsers
</script>


The workaround is, of course, to test the last character in the
FONT_FACE style string for a semicolon and delete it if found.

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.




--
Brett Morgan

Developer Programs Engineer, Blogger

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment