Search code examples
iospixate

Does Pixate Freestyle support custom fonts?


I've added some custom fonts to my iOS app and tried applying them using Freestyle CSS like

label {
   font-family      : "Niconne-Regular";
   color            : #446620;
}

but it did not work (the colour attribute did get applied). I was able to set the new font using UIFont fontWithName, so it's only Freestyle which could not use the new font (also, the same CSS worked with a built-in font, like "Courier").


Solution

  • Your suspicion is exactly right. You have to use the root font name in your Pixate CSS, then use the font-weight property to specify a font variant.

    This article by Pixate walks you through how to do that: https://github.com/Pixate/pixate-freestyle-ios/wiki/Embedding-and-Selecting-Fonts

    Let me know if you have any additional trouble getting it to work.