# Using serialized font as default font

**URL:** https://forum.juce.com/t/using-serialized-font-as-default-font/3878
**Category:** General JUCE discussion
**Created:** [May 2, 2009, 5:53pm UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878 "2009-05-02T17:53:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![skelman](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@skelman](https://forum.juce.com/u/skelman)
#### Post date: [May 2, 2009, 5:53pm UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/1 "2009-05-02T17:53:10Z")

</div>

Hello,

I’d like to use a serialized font as default font but I don’t known how to do it.

I managed to serialize a font and use it for specific component.

I also managed to set a default system font using the Font::setDefaultSansSerifFontName method.

But I don’t know how to use my serialized font as a default one. It seems the setDefaultSansSerifFontName can only be used for system fonts.

Note : I don’t want to install the font on the system.

Does anybody have an idea ?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [May 3, 2009, 9:55am UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/2 "2009-05-03T09:55:49Z")

</div>

You can use LookAndFeel::getTypefaceForFont, which is there for exactly this kind of purpose…

---

<div class="post-metadata">

### Author: ![skelman](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@skelman](https://forum.juce.com/u/skelman)
#### Post date: [May 3, 2009, 10:49am UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/3 "2009-05-03T10:49:05Z")

</div>

I didn’t find this method anywhere in the juce code :oops: . I found a Typeface::getTypefaceFor method that is not documented.  
I’m using the 1.46 juce version. Is this something knew ?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)
#### Post date: [May 3, 2009, 2:12pm UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/4 "2009-05-03T14:12:29Z")

</div>

Sorry, yes, it’s recent code, in the tip version.

---

<div class="post-metadata">

### Author: ![skelman](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@skelman](https://forum.juce.com/u/skelman)
#### Post date: [May 18, 2009, 5:27pm UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/5 "2009-05-18T17:27:12Z")

</div>

Took me a while to give you a feedback. It works fine. Thank you Jules.

---

<div class="post-metadata">

### Author: ![marvu](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marvu](https://forum.juce.com/u/marvu)
#### Post date: [November 13, 2014, 5:37pm UTC](https://forum.juce.com/t/using-serialized-font-as-default-font/3878/6 "2014-11-13T17:37:37Z")

</div>

I'm kind of stucked how to override this method.

I did the following:

```
Font f (Typeface::createSystemTypefaceFor (myfont\_otf, myfont\_otfSize));myLNF->getTypefaceForFont (f);
```

What do I exactly have to do in overriding the&nbsp;getTypefaceForFont method? Might be a stupid question, but I have my wires crossed.
