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'
How do I get 'HelveticaNeue-Light' (like the one on the left in the screenshot above) using Pixate CSS ?
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
You found a bug in Pixate and it has been fixed for Pixate Framework 2.1.
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