# Seeking ControlP5's Fonts in text()

**URL:** <https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575>\
**Category:** Libraries\
**Created:** [February 6, 2020, 12:49am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575 "2020-02-06T00:49:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spflanze](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@spflanze](https://discourse.processing.org/u/spflanze)\
**Post date:** [February 6, 2020, 12:49am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575/1 "2020-02-06T00:49:36Z")

</div>

I seek to know what font is used in ControlP5 library’s button labels. I desire to use the same for text placed on screen using the text() function. No font I have chosen so far looks as good.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 6, 2020, 2:04am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575/2 "2020-02-06T02:04:09Z")

</div>

example to use same font

- in CP5 label
- with text() function

```auto
/** ControlP5 Button * by Andreas Schlegel, 2012 * www.sojamo.de/libraries/controlp5 */

import controlP5.*;
ControlP5 cp5;
PFont font;

void setup() {
  size(400,200);
  printArray( PFont.list() ); // _______ list all available fonts
  cp5 = new ControlP5(this);
  font = createFont("Verdana Bold Italic",15); //_ select a font
  textFont(font); // ___________________ set font for text function
  cp5.addButton("button")
     .setValue(0)
     .setPosition(100,100)
     .setSize(200,19)
     .setFont(font)
     .setLabel("") 
     ;

  cp5.addLabel("my Button text as label")
     .setPosition(100,100)
     .setSize(200,19)
     .setFont(font) // _________________ set font for CP5
     ;
     
     
  // ControlP5.printPublicMethodsFor(Button.class);
}

void draw() {
  background(200,200,0);
  text("text() function",10,height-20);
}

public void button(int theValue) {
  println("a 'button' event : "+theValue);
}

```

hope it helps.

---

<div class="post-metadata">

**Author:** ![spflanze](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@spflanze](https://discourse.processing.org/u/spflanze)\
**Post date:** [February 6, 2020, 4:32am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575/3 "2020-02-06T04:32:53Z")

</div>

It does not help. I seek to know the default font used in the ControlP5 library. In your code example you are setting the font to one you selected.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [February 6, 2020, 11:26am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575/4 "2020-02-06T11:26:56Z")

</div>

yes, as you will probably find no way to use the CP5 internal bitmap font  
but still want to use one unique font for your app.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [February 12, 2020, 2:26am UTC](https://discourse.processing.org/t/seeking-controlp5s-fonts-in-text/17575/5 "2020-02-12T02:26:07Z")

</div>

> [@spflanze](#):
>
> I seek to know the default font used in the ControlP5 library.

It is:

```auto
import controlP5.BitFont;

```

> <https://github.com/sojamo/controlp5/blob/1f7cb649865eb8657495b5cfeddd0dbe85d70cac/src/controlP5/BitFont.java>

You can browse the source code to see how it is used internally. It extends PFont.
