# CreateFont() doesn't work

**URL:** <https://discourse.processing.org/t/createfont-doesnt-work/42942>\
**Category:** Processing for Android\
**Created:** [October 11, 2023, 11:26am UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942 "2023-10-11T11:26:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AniManOtaku](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/animanotaku/32/18733_2.png) [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Post date:** [October 11, 2023, 11:26am UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/1 "2023-10-11T11:26:20Z")

</div>

Hello, I tried to use the createFont() function, but when I use it, the app just closes.

code:

```auto
PFont font;

void setup(){
  font=createFont("FieldGuide.ttf",100);
  textFont(font,100);
}

void draw() {
  background(255);
  fill(0);
  text("just text",50,500);
}

```

Did I do something wrong? How is there any way to fix this?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [October 11, 2023, 1:37pm UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/2 "2023-10-11T13:37:41Z")

</div>

Hi @AniManOtaku,

You can checkout this previous thread:

> [@How do I createFont from .ttf files in apde?](https://discourse.processing.org/t/how-do-i-createfont-from-ttf-files-in-apde/22079):
>
> I know that there is a createFont option in processing’s pc version and that does the conversion of .ttf files to .vlw files. But while using apde I cant even use any external font files and only use the system built it fonts of android. Please help…!!

Also do you have any error logs or ways to see debug information?  
Is your `.ttf` file accessible and valid for a font file? Did you try to load it in Processing Java?

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 11, 2023, 4:50pm UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/3 "2023-10-11T16:50:22Z")

</div>

Hi

[![](https://img.youtube.com/vi/_gGljGNIUF0/maxresdefault.jpg "Using .ttf Font Files in Processing") ](https://www.youtube.com/watch?v=_gGljGNIUF0)

---

<div class="post-metadata">

**Author:** ![AniManOtaku](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/animanotaku/32/18733_2.png) [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Post date:** [October 11, 2023, 6:44pm UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/4 "2023-10-11T18:44:25Z")

</div>

Well i tried that and i edited the code so that it shows the error

the code:

```auto
PFont myFont; 

void setup() { 
  size(200, 200); 
  background(255); 
  try{
    myFont = createFont("CYRIL1.TTF", 28); 
    fill(0);
    textFont(myFont); 
  }
  catch(Exception e){
    println(e);
  }
  textAlign(CENTER);
  println("Привет мир");
} 

void draw() { 
  text("Привет мир", width/2, height/2);
}

```

And this is what it shows:

 ![Screenshot_2023-10-11-21-22-05-010_com.calsignlabs.apde](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/3/a/3aa18ff087de164c3804deeb7a5d5f247ab775ab.png)

And yeah i put the font in the data folder.

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [October 12, 2023, 4:40am UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/5 "2023-10-12T04:40:40Z")

</div>

Hi  
On APDE it’s hard to work but with processing android mode works

---

<div class="post-metadata">

**Author:** ![AniManOtaku](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/animanotaku/32/18733_2.png) [@AniManOtaku](https://discourse.processing.org/u/AniManOtaku)\
**Post date:** [October 12, 2023, 10:31am UTC](https://discourse.processing.org/t/createfont-doesnt-work/42942/6 "2023-10-12T10:31:23Z")

</div>

Unfortunately, i dont have PC.
