# How to use custom fonts in attributed text in labels in Storyboard?

**URL:** <https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807>\
**Category:** Question & Answer\
**Tags:** xamarin, ios\
**Created:** [May 22, 2017, 1:56pm UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807 "2017-05-22T13:56:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoostOuweland](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/joostouweland/32/181_2.png) [@JoostOuweland](https://discuss.bitrise.io/u/JoostOuweland)\
**Post date:** [May 22, 2017, 1:56pm UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807/1 "2017-05-22T13:56:43Z")

</div>

I am doing Xamarin native iOS (and Android) development, but the same question might be true for native iOS development without Xamarin.

I am using a custom font in my Xcode Storyboard in attributed text labels. This works fine with builds coming from my development machine, but the builds from Bitrise are using the default iOS font (although the coloring and text style (bold/italic) is applied).

Simple plain text labels that use a custom font work fine. Attributed text from code (NSAttributedString) also work fine.

I have installed the custom font on my development machine, but the Bitrise environment doesn’t have these fonts installed. When I remove the custom font from my development machine, I get the same behavior as the builds from Bitrise.

Could the fact that these fonts are not installed on the Bitrise build host be the cause of my problem? And how do I get these fonts available during build time on Bitrise?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [May 22, 2017, 2:02pm UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807/2 "2017-05-22T14:02:52Z")

</div>

Hi @JoostOuweland,

Thanks for asking this here! 😉

> [@JoostOuweland](#):
>
> Could the fact that these fonts are not installed on the Bitrise build host be the cause of my problem?

Based on

> [@JoostOuweland](#):
>
> When I remove the custom font from my development machine, I get the same behavior as the builds from Bitrise.

I’d say yes, definitely. There’s absolutely no magic in the [bitrise.io](http://bitrise.io) VMs, these are clean macOS installs with a couple of preinstalled tools, that’s all.

> [@JoostOuweland](#):
>
> And how do I get these fonts available during build time on Bitrise?

Well, how do you make it available on your Mac? 😉

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [May 22, 2017, 2:31pm UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807/3 "2017-05-22T14:31:21Z")

</div>

> [@viktorbenei](#):
>
> Well, how do you make it available on your Mac? 😉

To answer this question, you can install the font the same way you would on your Mac **using the Terminal**. This is true for any install/command; you can do the same what you would in your Mac Terminal, using a **Script** step.

Related docs: [Installing tools during a build - Bitrise Docs](http://devcenter.bitrise.io/tips-and-tricks/install-additional-tools/)

* * *

In case of Font files, it seems it’s as simple as copying the font files into the `/Library/Fonts` or `~/Library/Fonts` dirs (source: [command line - Installing fonts from terminal instead of Font Book? - Ask Different](https://apple.stackexchange.com/questions/240381/installing-fonts-from-terminal-instead-of-font-book))

If you’d have any questions just let us know!

---

<div class="post-metadata">

**Author:** ![JoostOuweland](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/joostouweland/32/181_2.png) [@JoostOuweland](https://discuss.bitrise.io/u/JoostOuweland)\
**Post date:** [May 23, 2017, 8:25am UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807/4 "2017-05-23T08:25:56Z")

</div>

Yes this seems to resolve the problem. Thanks for your quick response @viktorbenei!

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [May 23, 2017, 10:05am UTC](https://discuss.bitrise.io/t/how-to-use-custom-fonts-in-attributed-text-in-labels-in-storyboard/1807/5 "2017-05-23T10:05:38Z")

</div>

No problem at all, we’re always happy to help, thanks for creating the thread here, I’m sure this will help others in the future! 🙂
