# Can the students use any other fonts?

**URL:** <https://forum.code.org/t/can-the-students-use-any-other-fonts/14021>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-4, csd-unit-4-lesson-12\
**Created:** [January 30, 2018, 9:41pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021 "2018-01-30T21:41:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 30, 2018, 9:41pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/1 "2018-01-30T21:41:13Z")

</div>

Are other fonts available in the App Lab?

---

<div class="post-metadata">

**Author:** ![kevinsukhoo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/kevinsukhoo/32/3617_2.png) [@kevinsukhoo](https://forum.code.org/u/kevinsukhoo)\
**Post date:** [January 31, 2018, 2:25am UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/2 "2018-01-31T02:25:33Z")

</div>

hi @jreynolds,

Great question, I never thought about doing that before, but I will get an answer for you!

cheers,  
Kevin

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/josh/32/868_2.png) [@josh](https://forum.code.org/u/josh)\
**Post date:** [January 31, 2018, 3:32am UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/3 "2018-01-31T03:32:40Z")

</div>

There’s no way to set the font in design mode, but we do have an advanced undocumented command called `setStyle` that allows you to assign a CSS style to your design mode elements (great callback to unit 2!). `setStyle` takes two parameters, the first is an ID of an element, and the second a string of CSS to apply to that element, for example:

`setStyle("myButton", "font-family: cursive; font-weight: bold;");`

Here’s a quick example app showing how `setStyle` works [https://studio.code.org/projects/applab/YzXR4wJXjGfrUSuFp9qzYA/edit](https://studio.code.org/projects/applab/YzXR4wJXjGfrUSuFp9qzYA/edit)

---

<div class="post-metadata">

**Author:** ![josh](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/josh/32/868_2.png) [@josh](https://forum.code.org/u/josh)\
**Post date:** [January 31, 2018, 5:14am UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/4 "2018-01-31T05:14:16Z")

</div>

Since I was playing around with this anyway, and it may be of more interest to students in CSD who have already learned some CSS, I put up a quick documentation page for `setStyle` [https://docs.code.org/applab/setStyle/](https://docs.code.org/applab/setStyle/)

---

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 31, 2018, 5:26pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/5 "2018-01-31T17:26:28Z")

</div>

Thanks! I will play around with it today.

---

<div class="post-metadata">

**Author:** ![jreynolds](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jreynolds](https://forum.code.org/u/jreynolds)\
**Post date:** [January 31, 2018, 9:39pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/6 "2018-01-31T21:39:15Z")

</div>

Where exactly do we put the CSS setStyle code? In the workspace window with the onEvents?  
Nevermind - I realized the change in font doesn’t take effect until the app is running.

---

<div class="post-metadata">

**Author:** ![jkeays](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/jkeays/32/5313_2.png) [@jkeays](https://forum.code.org/u/jkeays)\
**Post date:** [February 1, 2018, 6:31am UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/7 "2018-02-01T06:31:41Z")

</div>

Thanks so much! I love this!

---

<div class="post-metadata">

**Author:** ![jpauley](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jpauley](https://forum.code.org/u/jpauley)\
**Post date:** [April 28, 2018, 4:43pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/8 "2018-04-28T16:43:06Z")

</div>

Fabulous update. Great callback indeed. Thank you!

---

<div class="post-metadata">

**Author:** ![kaitie\_o\_bryan](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/kaitie_o_bryan/32/2278_2.png) [@kaitie\_o\_bryan](https://forum.code.org/u/kaitie_o_bryan)\
**Post date:** [December 5, 2018, 3:35pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/9 "2018-12-05T15:35:58Z")

</div>

Thanks Josh! My students were in AppLab and wanted to make some text bold and I used this to help them do it. It is good to know that CSD’s environment for CSS allows us to use the same commands for JavaScript. Thanks Josh!

---

<div class="post-metadata">

**Author:** ![ltoal](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/ltoal/32/5449_2.png) [@ltoal](https://forum.code.org/u/ltoal)\
**Post date:** [February 26, 2019, 4:14pm UTC](https://forum.code.org/t/can-the-students-use-any-other-fonts/14021/10 "2019-02-26T16:14:45Z")

</div>

Hi Josh,  
Sorry for the thread necromancy, but does `setStyle` also allow students to import from e.g. Google Fonts (they loved that during Unit 2), or is there any other way to do so?  
Thanks,  
Laurence
