unify / unify

Unify Project
http://www.unifyjs.com
Other
152 stars 16 forks source link

font size problems #73

Closed mojoaxel closed 12 years ago

mojoaxel commented 12 years ago

There seams to be a problem with the "fontSize" value in the appearance. Relative values like "medium" or "large" are recognized correctly while absolute values like "19px" seamed to be ignored.

The following code is not working. There is always a fontsize of 16px set.

var style = {
    fontSize: "19px"
};

The following examples are working like expected:

var style = {
    font: "19px"
};
var style = {
    fontSize: "large"
};
dominikg commented 12 years ago

quickfix: use fontSize:19 and it works.

The problem is, that fontSize values with typeof string are all passed to unify.bom.Font#resolveRelativeSize in unify.ui.core.Widget#1402.

If you want to be able to pass in string values with px, you'd have to update line 1402 of widget like this:

or change unify.bom.Font#resolveRelativeSize to check for "px"