Question

Clearification! This question is about the iOS framework Pixate (http://www.pixate.com), and not regular CSS inside of a UIWebView.

Code in default.css :

.title {
 font-family: 'Helvetica Neue';
 font-weight: light;
 font-size: 30px;
 color: #005284;

}

Code in view:

UILabel *label = [UILabel new];
label.styleClass = @"title";

Result when logging:

<UICTFont: 0x10d09e210> font-family: "HelveticaNeue-UltraLight"; font-weight: normal; font-style: normal; font-size: 30.00pt

When I try font-weight: medium; I get HelveticaNeue-Medium
When I try font-weight: 300; I get HelveticaNeue-UltraLight
When I try font-weight: 400; I get Helvetica Neue
When I try font-family: 'HelveticaNeue-Light'; I get .HelveticaNeueInterface-M3 ??? (I guess this is the default system font)

If I set the font through code with

label.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:30];

It looks as it should, (and the log says HelveticaNeue-Light)

Here a screenshot. The one of the left is when using code, and the one on the right is when using Pixate with `font-family: 'HelveticaNeue-Light'

enter image description here

How do I get 'HelveticaNeue-Light' (like the one on the left in the screenshot above) using Pixate CSS ?

Was it helpful?

Solution 2

You found a bug in Pixate and it has been fixed for Pixate Framework 2.1.

OTHER TIPS

This works on Mavericks and my iOS 7 simulator. Don't know about others.

.title {
    font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
    font-size: 30px;
    color: #005284;
}

Here is my test code:

<html>
<head>
<style>
.first {
    font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
    font-size: 30px;
    color: #005284;
}
.second {
    font-family: 'Helvetica';
    font-size: 30px;
    color: #005284;
}
</style>
</head>
<div class="first">Hello, World!</div>
<div class="second">Hello, World!</div>
</html>

And the result in Safari http://s.swic.name/TpEP

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top