<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with textfont() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=textfont%28%29</link>
      <pubDate>Sun, 08 Aug 2021 16:42:52 +0000</pubDate>
         <description>Tagged with textfont() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedtextfont%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Using fonts</title>
      <link>https://forum.processing.org/two/discussion/28103/using-fonts</link>
      <pubDate>Sun, 26 Aug 2018 04:36:46 +0000</pubDate>
      <dc:creator>h314</dc:creator>
      <guid isPermaLink="false">28103@/two/discussions</guid>
      <description><![CDATA[<p>I've just started trying python mode, so I'm probably missing something very obvious, but essentially, my problem is that I can't seem to set the font. The code that pertains to my font looks something like this:</p>

<p>def setup ():
    font = createFont ("Numbers.ttf", width / 62)</p>

<p>def draw ():
    textFont (font, width / 62)</p>

<p>However, this gives me an error saying that font is not defined. I assumed that I couldn't use font outside of setup, so I tried putting "font = None" at the beginning, so that it would be a global variable, but then it just says that a null font was passed to textFont. I also can't put "font = createFont ("Numbers.ttf", width / 62)" at the beginning, because it must be in setup, and putting textFont in setup doesn't seem to work either. What am I doing wrong?</p>
]]></description>
   </item>
   <item>
      <title>OpenSansEmoji.ttf not working in P3D?</title>
      <link>https://forum.processing.org/two/discussion/27835/opensansemoji-ttf-not-working-in-p3d</link>
      <pubDate>Mon, 23 Apr 2018 23:36:07 +0000</pubDate>
      <dc:creator>sjespers</dc:creator>
      <guid isPermaLink="false">27835@/two/discussions</guid>
      <description><![CDATA[<p>So this has been driving me nuts all day. I was using OpenSansEmoji.ttf in a project and the emojis weren't showing up. Fast forward 6 hours later... I couldn't figure out why it was working in another test project until I saw that my main project needs the P3D in order to be able to use Syphon. My test project was not using the P3D renderer and it works there.</p>

<p>So now that I figured out why it wouldn't work, does anyone have any ideas on how to use this font AND Syphon? Or why this font won't render the emojis in P3D?</p>
]]></description>
   </item>
   <item>
      <title>Bold text in text function</title>
      <link>https://forum.processing.org/two/discussion/19515/bold-text-in-text-function</link>
      <pubDate>Sun, 04 Dec 2016 21:54:20 +0000</pubDate>
      <dc:creator>kfrajer</dc:creator>
      <guid isPermaLink="false">19515@/two/discussions</guid>
      <description><![CDATA[<p>How would you do to write bold text when using <code>text(String,int,int)</code>?<br />
Would I need to change the font to get the effect? And is it possible to know what is the current font being used by Processing?</p>

<p>Kf</p>
]]></description>
   </item>
   <item>
      <title>Changing font color when mouse pressed</title>
      <link>https://forum.processing.org/two/discussion/26876/changing-font-color-when-mouse-pressed</link>
      <pubDate>Fri, 16 Mar 2018 09:38:58 +0000</pubDate>
      <dc:creator>abigailvjacinto</dc:creator>
      <guid isPermaLink="false">26876@/two/discussions</guid>
      <description><![CDATA[<p>Hi! 
1. I've been trying to add a code such that the font color changes when the mouse clicks on the text. However, nothing's happening.
2. I want to change the font style from Arial, but nothing happens also when I substitute another font name.</p>

<p>This is the link I got the code from (<a href="http://learningprocessing.com/examples/chp17/example-17-06-textbreakingup" target="_blank" rel="nofollow">http://learningprocessing.com/examples/chp17/example-17-06-textbreakingup</a>) Here's the code:</p>

<pre><code>// Example 17-6: Text breaking up 

PFont f;
String message = "click mouse to shake it up";

// An array of Letter objects
Letter[] letters;

void setup() {
  size(480, 270);

  // Load the font
  f = createFont("Arial", 20);
  textFont(f);

  // Create the array the same size as the String
  letters = new Letter[message.length()];

  // Initialize Letters at the correct x location
  int x = 125;
  for (int i = 0; i &lt; message.length (); i ++ ) {
    // Letter objects are initialized with their location within the String as well as what character they should display.
    letters[i] = new Letter(x, 140, message.charAt(i)); 
    x += textWidth(message.charAt(i));
  }
}

void draw() {
  background(255);
  for (int i = 0; i &lt; letters.length; i ++ ) {

    // Display all letters
    letters[i].display();

    // If the mouse is pressed the letters shake
    // If not, they return to their original location
    if (mousePressed) {
      letters[i].shake();
    } else {
      letters[i].home();
    }
  }
}

// A class to describe a single Letter
class Letter {
  char letter;

  // The object knows its original " home " location
  float homex,homey;

  // As well as its current location
  float x,y;

  Letter(float x_, float y_, char letter_) {
    homex = x = x_;
    homey = y = y_;
    letter = letter_;
  }

  // Display the letter
  void display() {
    fill(0);
    textAlign(LEFT);
    text(letter,x,y);
  }

  // Move the letter randomly
  void shake() {
    x += random(-2,2);
    y += random(-2,2);
  }

  // At any point, the current location can be set back to the home location by calling the home() function.
  void home() { 
    x = homex;
    y = homey;
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Writing Text without line/word breaks ... but in Javascript</title>
      <link>https://forum.processing.org/two/discussion/25852/writing-text-without-line-word-breaks-but-in-javascript</link>
      <pubDate>Sat, 06 Jan 2018 20:52:55 +0000</pubDate>
      <dc:creator>nippotam</dc:creator>
      <guid isPermaLink="false">25852@/two/discussions</guid>
      <description><![CDATA[<p>Hello</p>

<p>I found a very uselful program to justify text as I wanted here : <a rel="nofollow" href="https://forum.processing.org/one/topic/writing-text-without-line-word-breaks.html">https://forum.processing.org/one/topic/writing-text-without-line-word-breaks.html</a>. The code is in Java (processing) thanks to <a href="/two/profile/calsign">@calsign</a>.</p>

<p>It is in perfect java, I need to translate into javascript with p5.js. I use this <a rel="nofollow" href="https://github.com/processing/p5.js/wiki/Processing-transition">resource </a>that helps me a lot.</p>

<p>I cannot figure out the good way to write it in Javascript, especially with the array (the var tokens for instance) I put modification I am not sure in bold (or with ** and **).</p>

<p>I think I am close but I miss something. Thank you in advance.</p>

<p>_Here is my attempt:
_</p>

<pre><code>            // justify one line of text
            function linejustify(s, x, y, w) {

              // how long is the text?
              var tw = textWidth(s);

              // is it longer than expected width? if so, return
              if (tw &gt; w) {
                print("Text is too long.");
                return;
              }

              // does it match perfectly? if so, print it
              if (tw == w) {
                text(s, x, y);
                return;
              }

              // if not, how much pixels shall we add to reach expected length?
              var gap = w - tw;

              // split the text into words
            **  var tokens = split(s, " "); **

              // is there only one word - or no word at all? if so, print it
              if (tokens.length &lt;= 1) {
                text(s, x, y);
                return;
              }
              // otherwise,
              // we will distribute the missing pixels after each word, in the spaces
              var spaces = tokens.length - 1;

            **  var pixelsToAddAfterToken = new [tokens.length];
              //int[] pixelsToAddAfterToken = new int[tokens.length];   ** 

            for (var i = 0; i &lt; spaces; i++) {
                pixelsToAddAfterToken[i] = floor(gap/spaces);
                if (i &lt;= gap%spaces) pixelsToAddAfterToken[i]++;
              }

              for (var i = 0; i &lt; tokens.length; i++) {
                text(tokens[i], x, y);
                x += textWidth(tokens[i]) + textWidth(" ") + pixelsToAddAfterToken[i];
              }
            }

            //All should be self-explanatory except leading...
            //leading is how much room should be in-between each line of text.

            function textJustify(input, x, y, w, leading) {
              push();

              ** var seperatedStrings = [0]; **
              var lastSeperation = 0;

              for(var i = 0; i &lt; input.length(); i ++) {
                if(textWidth(input.substring(0, i - lastSeperation)) &gt; w * .99) {
                  seperatedStrings = append(seperatedStrings, input.substring(lastSeperation, i));
                  lastSeperation = i;
                }

              }

              if(lastSeperation &lt; input.length()) seperatedStrings = append(seperatedStrings, input.substring(lastSeperation, input.length()));


              for(var i = 0; i &lt; seperatedStrings.length; i ++) {
                linejustify(seperatedStrings[i], x, y + leading * i, w);
              }


              pop();
            }


            function setup() {
              size(250, 150);
              background(255);
              fill(0);
              textFont(createFont("", 12), 12);
              textJustify("This text should be perfectly justified. Even with two lines! You can add more text... And it still works, as far as I can tell.", 0, 40, width, 14);

            }
</code></pre>
]]></description>
   </item>
   <item>
      <title>Subclass won't display or move -- Help!</title>
      <link>https://forum.processing.org/two/discussion/23862/subclass-won-t-display-or-move-help</link>
      <pubDate>Sat, 19 Aug 2017 14:59:46 +0000</pubDate>
      <dc:creator>gleister</dc:creator>
      <guid isPermaLink="false">23862@/two/discussions</guid>
      <description><![CDATA[<p>Back again with another class issue, this time after three days of troubleshooting, I am still stuck on why my paddle won't display. I would appreciate any help I can get. Thanks!</p>

<p>Main Tab 
    //Gwendolyn Leister - Pong Game</p>

<pre><code>GamePiece Paddle;
GamePiece Ball;

boolean gameStart = false;
boolean restart = false;
boolean endgame = false;
//Declare Fonts
PFont myFont;
PFont myFont2;

//for Ball 
int rad = 15;
float xPos=width/2;
float yPos=height/2;
float Speed = 3;

int xDirection = 1;
int yDirection = 1;
int SPD = 5;

int score = 0;


final GamePiece ball = new Ball();

final GamePiece paddle = new Paddle();

void setup () {
  size(800, 800);
  smooth();
  background(0);
  myFont = loadFont("AnonymousPro-30.vlw");
  myFont2 = loadFont("AnonymousPro-80.vlw");
  Ball = new Ball();
}

void draw() {
  //table


  background (0);

  //Layout
  fill(#CBFEFF);
  noStroke();
  rect(0, 640, 800, 260);
  stroke(255);
  fill(#CBFEFF);
  strokeWeight(10);
  line(0, 640, 800, 640);
  fill(#EAFFFF);
  rect(200, 700, 400, 160);
  //text

  //score text
  textFont(myFont);
  textAlign(RIGHT);
  textSize(20);
  text("Score:", 70, 25);

  Ball.display();
  //Paddle.display();

  if (gameStart) {
    Ball.move();
    Ball.bounce();
    //Paddle.move();
  } else {
    textAlign(CENTER);
    textFont(myFont2);
    textSize(80);
    text("P O N G", 400, 100);
    textSize(20);
    text("press enter to start", 400, 600);
    text("move mouse horizontally to control the", 400, 140);
    text("paddle and to bounce the ball off of", 400, 162);
  }
  //if (keyPressed) {
  //  restart = !restart;
  //}
}

//if (Ball.checkScore) {
//  score = score+1;
//  textSize(20);
//  textAlign(LEFT);
//  text("

void checkScore() {
  if (yPos&gt;700) {
    score=score+1;
  } else if (yPos&gt;750) {
    score=score-1;
  }
}

void keyPressed() {
  if (keyCode == ENTER){
    gameStart = !gameStart;
  }
  else{

  }
}
</code></pre>

<p>Paddle SubClass
    class Paddle extends GamePiece {</p>

<pre><code>  boolean mouseMoved;
  boolean overPaddle = false;
  boolean locked = false;
  float xOffset = 0.0;
  float yOffset = 0.0;
  int px;
  int py;
  int pw=100;
  int ph=30;
  int pSpeed= 5;


  //float xPos = mouseX;
  //float yPos = 680;
  //int x;
  //int y;
  //int w=20;
  //int h=80;
  //Paddle (int tx,int ty) {
  //  x=tx;
  //  y=ty;
  //}



  Paddle () {
    super();
  }

  void display() {
    rectMode(CENTER);
    fill(#CBFEFF);
    stroke(255);
    strokeWeight(10);
    //rect(this.xPos, this.yPos, 50, 20);
  }
  //void mouseMove() {
  //  if (x==1) {
  //    py = py +- pSpeed;
  //  } else if (x == 0);
  //}
  void move () {

    if (mouseX &gt; px-(pw*ph) &amp;&amp; mouseX &lt; px+(pw*ph) &amp;&amp; 
      mouseY &gt; py-(pw*ph) &amp;&amp; mouseY&lt;py+(pw*ph)) {
      overPaddle=true;
      if (!locked) {
        stroke(255);
        fill(255);
      } else {
        fill(#CBFEFF);
        stroke(255);
        strokeWeight(10);
      }
      rect(px, py, pw, ph);
    }
  }
  void mousePressed() {
    if (overPaddle) {
      locked = true;
      fill (#CBFEFF);
    } else {
      locked = false;
    }
    xOffset =mouseX-px;
  }
  void bounce() {
  }
}
</code></pre>

<p>and GamePiece Superclass</p>

<pre><code>abstract class GamePiece {
  float x, y, w, h, vx, vy, dx, dy;
  abstract void move(); 
  abstract void display();
  abstract void bounce();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Need help because processing can't read slovak</title>
      <link>https://forum.processing.org/two/discussion/23416/need-help-because-processing-can-t-read-slovak</link>
      <pubDate>Wed, 12 Jul 2017 14:13:29 +0000</pubDate>
      <dc:creator>lolnyancats</dc:creator>
      <guid isPermaLink="false">23416@/two/discussions</guid>
      <description><![CDATA[<pre><code>int currentSlide;
String[] slide;

String tl;
String tr;
String bl;
String br;

int time;
int wait=5000;

void setup(){
  size(800,1000);
  time=millis();
  currentSlide=0;
  slide=new String[500];
  slide=loadStrings("data for rosetta stone.txt"));
  tl=slide[0];
  tr=slide[2];
  bl=slide[1];
  br=slide[3];
}


void draw(){
  textSize(35);
  rectMode(CENTER);
  if(millis()-time&gt;=wait){
    time=millis();
    print("tick");
    tl=slide[currentSlide+4];
    tr=slide[currentSlide+6];
    bl=slide[currentSlide+3];
    br=slide[currentSlide+5];
  }
  background(255/2+50);
  fill(0);
  text(tl,50,50);
  text(tr,width/2+100,50);
  text(bl,50,height/2+50);
  text(br,width/2+50,height/2+50);
}
</code></pre>

<p>data in the text file</p>

<p>Ahoj</p>

<p>Hello</p>

<p>Zbohom</p>

<p>Goodbye</p>

<p>Ako sa máš</p>

<p>How are you</p>

<p>Ako sa voláš</p>

<p>What is your name</p>
]]></description>
   </item>
   <item>
      <title>trying to set the font, getting a black screen instead</title>
      <link>https://forum.processing.org/two/discussion/23410/trying-to-set-the-font-getting-a-black-screen-instead</link>
      <pubDate>Wed, 12 Jul 2017 03:54:56 +0000</pubDate>
      <dc:creator>mortebouse</dc:creator>
      <guid isPermaLink="false">23410@/two/discussions</guid>
      <description><![CDATA[<p>hello, i'm trying to code a short interactive animation in openprocessing with images, sound, and text, and when i try to use textFont() in preload(), my whole sketch goes black (though the interactivity and sound both remain). and if i try to use it in draw() or setup(), it sets itself to a different font instead and sets the font size to the same size across the sketch.</p>

<p>the only time it has worked when i tried (but not with the typeface i need) it is when i set it to textFont('Courier') in draw(). i've tried to load another .ttf file to see if the font itself was the problem, but the replacement one didn't work either. the font i'm trying to load is <a rel="nofollow" href="https://fontstruct.com/fontstructions/show/675134/fontstuck_2">this one</a>.</p>

<p>you can find my sketch <a rel="nofollow" href="https://www.openprocessing.org/sketch/438767">here</a>. it takes a little bit of time to load. i would post the code here, too but there are a dozen files needed to play it locally, so i think it's better if i don't. if you need more information, let me know.</p>

<p>thanks in advance.</p>
]]></description>
   </item>
   <item>
      <title>Why does this code work, and this one doesn't?</title>
      <link>https://forum.processing.org/two/discussion/23395/why-does-this-code-work-and-this-one-doesn-t</link>
      <pubDate>Mon, 10 Jul 2017 22:08:07 +0000</pubDate>
      <dc:creator>truffel</dc:creator>
      <guid isPermaLink="false">23395@/two/discussions</guid>
      <description><![CDATA[<p>Hello...
I found a way in which I could avoid including the data-processing-sources in the canvas tag. I am having trouble understanding why, when I click the button, the canvas that is wrapped in the function does not appear.</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
  &lt;head&gt;
     &lt;script src="/js/processing.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;


&lt;input type="button" value="imagen" id="clear" onclick="canvas()"&gt;

&lt;canvas id="mycanvas"&gt;&lt;/canvas&gt;



&lt;script type="text/processing" data-processing-target="mycanvas"&gt;




function canvas() {

void setup()
{
  size(200,200);
  background(0);
  fill(200);
  noLoop();
  PFont fontA = loadFont("courier");
  textFont(fontA, 14);  
}

void draw(){  
  text("Hello!",20,20);

}

}


&lt;/script&gt;


  &lt;/body&gt;
&lt;/html&gt;      
</code></pre>

<p>On the other hand, this code works well:</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
    &lt;html&gt;
      &lt;head&gt;
         &lt;script src="/js/processing.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;



&lt;canvas id="mycanvas"&gt;&lt;/canvas&gt;



&lt;script type="text/processing" data-processing-target="mycanvas"&gt;






void setup()
{
  size(300,300);
  background(0);
  fill(255);
  noLoop();
  PFont fontA = loadFont("courier");
  textFont(fontA, 14);  
}

void draw(){  
  text("Hello!",20,20);
      }




&lt;/script&gt;


  &lt;/body&gt;
&lt;/html&gt;      
</code></pre>

<p>Thanks in advance</p>
]]></description>
   </item>
   <item>
      <title>Processing 3.3.1 text font arrayindexoob error</title>
      <link>https://forum.processing.org/two/discussion/22214/processing-3-3-1-text-font-arrayindexoob-error</link>
      <pubDate>Wed, 26 Apr 2017 01:18:13 +0000</pubDate>
      <dc:creator>mikel334u2</dc:creator>
      <guid isPermaLink="false">22214@/two/discussions</guid>
      <description><![CDATA[<p>This works in Processing 3.3, however I get an ArrayIndexOutOfBoundsException in Processing 3.3.1. When I omitted the 'm' and '_'s in the text, it runs fine though. I just used the "Create Font" tool under Tools to get the vlw file, and it works fine if no font is declared.</p>

<pre><code>size(800,800);
PFont comicsans = loadFont("ComicSansMS-48.vlw");
fill(0);
textFont(comicsans, 48);
textAlign(CENTER,CENTER);
text("m_a_n", 400, 400);
</code></pre>
]]></description>
   </item>
   <item>
      <title>[Solved] Fonts &amp; PGraphics in Processing 3</title>
      <link>https://forum.processing.org/two/discussion/20735/solved-fonts-pgraphics-in-processing-3</link>
      <pubDate>Fri, 10 Feb 2017 17:31:54 +0000</pubDate>
      <dc:creator>jacopom</dc:creator>
      <guid isPermaLink="false">20735@/two/discussions</guid>
      <description><![CDATA[<p>The short form of my question is:
<strong>How do I set a custom font for a PGraphics object in processing 3?</strong> 
I'm trying to migrate a complex sketch from 2 to 3, I recreated the issue in a much simpler program so we can isolate it and focus on it.</p>

<p>Processing 2 has no issues with PGraphics.textFont( PFont ) to set the font of a PGraphics object.
Processing 3 throws a generic "NULL ptr exception" ( mind you neither the pg object nor the myfont object are null and the ttf font is correctly loaded from the data directory as it works perfectly in the main frame (   line 8 simply works ) ).</p>

<p><strong>Am I missing some sort of initialization for my pg object?</strong> the textfont memeber of PGraphics is set to null and pg.textFont = myfont; creates more issues than it solves.</p>

<p>If you want to test this code simply use any ttf font place it in the data directory and change   myfont = createFont("small_pixel.ttf", 10); from "small_pixel.ttf" to your file name.</p>

<pre lang="java">PGraphics pg;
PFont myfont;

void setup() {
  size(640, 360);
  pg = createGraphics(400, 200);
  myfont = createFont("small_pixel.ttf", 10);
  textFont(myfont);
  // The next line is the issue
  pg.textFont(myfont);

}

void draw() {
  fill(0, 12);
  rect(0, 0, width, height);
  fill(255);
  noStroke();
  text("Hello main frame", 20, 20);
  pg.beginDraw();
  pg.background(150,150,150);
  pg.fill(255,255,255);
  pg.textSize(12);
  pg.text("Hello pGraphics", pg.width/2, pg.height/2);
  pg.textAlign(CENTER,CENTER);
  pg.noFill();
  pg.stroke(255);
  pg.endDraw();
  
  // Draw the offscreen buffer to the screen with image() 
  image(pg, 120, 60); 
}</pre>
]]></description>
   </item>
   <item>
      <title>How do I get p5.js to remove certain objects within my program (e.g. button)?</title>
      <link>https://forum.processing.org/two/discussion/18789/how-do-i-get-p5-js-to-remove-certain-objects-within-my-program-e-g-button</link>
      <pubDate>Sun, 30 Oct 2016 15:13:12 +0000</pubDate>
      <dc:creator>ish2nv</dc:creator>
      <guid isPermaLink="false">18789@/two/discussions</guid>
      <description><![CDATA[<p>var img;
var buttonhover;
var buttonhover2;
var header = ["Pop the bubble game"]
var buttontext = ["START","HELP"]</p>

<p>function preload() {
  img = loadImage("bubbleimg.png")</p>

<p>}
function setup() {
  createCanvas(600,620)</p>

<p>}</p>

<p>function draw() {
 image(img,0,0)</p>

<p>img.resize(600,620)</p>

<p>stroke(0)
  strokeWeight(4);
  textFont("stencil")
  fill(255);
   textSize(46);
text(header[0],46,59);</p>

<p>ellipseMode(CENTER);
  stroke(5,0,0)
  fill(55,120,260)
  strokeWeight(5);</p>

<p>var space = dist(mouseX, mouseY,296,194)
  if (space&lt;100 ) {
    buttonhover = true;}
    else {
      buttonhover = false;
    }</p>

<pre><code>if (buttonhover === true) {
  fill(0,255,0);}

ellipse(300,200,200,200);
stroke(0)
  textFont("stencil")
</code></pre>

<p>strokeWeight(4);
  fill(255);
   textSize(45);
text(buttontext[0],230,211);</p>

<pre><code>draw2()
</code></pre>

<p>}</p>

<p>function draw2() {</p>

<p>ellipseMode(CENTER);
  stroke(5,0,0)
  fill(55,120,260)
  strokeWeight(5);</p>

<p>var space = dist(mouseX, mouseY,296,450)
  if (space&lt;100 ) {
    buttonhover2 = true;}
    else {
      buttonhover2 = false;
    }</p>

<pre><code>if (buttonhover2 === true) {
  fill(255,0,0);
}

ellipse(300,450,200,200);

stroke(0)
  textFont("stencil")
</code></pre>

<p>strokeWeight(4);
  fill(255);
   textSize(45);
text(buttontext[1],244,464);</p>

<p>}</p>

<p>function mousePressed() {
  if (buttonhover == true) {
   draw3()
  }</p>

<p>}</p>

<p>function draw3 () {
  remove()
}</p>
]]></description>
   </item>
   <item>
      <title>p5.js text accents displaying</title>
      <link>https://forum.processing.org/two/discussion/17683/p5-js-text-accents-displaying</link>
      <pubDate>Thu, 28 Jul 2016 14:50:25 +0000</pubDate>
      <dc:creator>arieluzal</dc:creator>
      <guid isPermaLink="false">17683@/two/discussions</guid>
      <description><![CDATA[<p>I've been running into a small problem with a project trying to get p5.js to display accented characters (such as <strong>á</strong>) and other characters used in Spanish (such as <strong>ñ</strong>).</p>

<p>After some exploring, I found out that the problem only appears when using TrueType fonts. When using the default font or and OpenType font, accents are displayed correctly.</p>

<p>Does anybody know if there's a solution or workaround for this? I don't have OTF versions of the fonts I need for my project.</p>

<p>Here is some demo code</p>

<pre><code>var FONT_TTF;
var FONT_OTF;

function preload() {
  FONT_TTF = loadFont("Arial.ttf");
  FONT_OTF = loadFont("TektonPro-Bold.otf");
}

function setup() {
  createCanvas(200, 100);
  fill(0);
  textFont(FONT_OTF);
  //textFont(FONT_TTF);
  text("Accents test: á é í ó ú ñ ", 50, 50);
}
</code></pre>

<p>Thanks!</p>
]]></description>
   </item>
   <item>
      <title>loadFont() problem</title>
      <link>https://forum.processing.org/two/discussion/17113/loadfont-problem</link>
      <pubDate>Sun, 12 Jun 2016 18:24:13 +0000</pubDate>
      <dc:creator>Xeronimo74</dc:creator>
      <guid isPermaLink="false">17113@/two/discussions</guid>
      <description><![CDATA[<p>var myFont;</p>

<p>function preLoad() {
  myFont = loadFont('assets/DroidSansMono.ttf');
}</p>

<p>function setup() {
  textFont(myFont);
}</p>

<p>why does this give me the following error: "25722: Uncaught Error: null font passed to textFont"?</p>
]]></description>
   </item>
   <item>
      <title>Help with random text</title>
      <link>https://forum.processing.org/two/discussion/16638/help-with-random-text</link>
      <pubDate>Mon, 16 May 2016 11:00:50 +0000</pubDate>
      <dc:creator>GianmariaVernetti</dc:creator>
      <guid isPermaLink="false">16638@/two/discussions</guid>
      <description><![CDATA[<p>Hi everyone,
I am working on an installation based on visual and texts.
I would like to extract random quotes from a txt file and show them for a fixed time (eg. 5 seconds) but I am having some trouble.
Here is the part of code related to the issue.
Thanks in advance!</p>

<p>PFont f;</p>

<p>//Database variables
String[] lines;
int index = 0;</p>

<p>void setup() {
  size(800, 800, P3D);
  noStroke();
  frameRate(30);
  f = createFont("AmericanTypewriter", 16, true);</p>

<p>lines = loadStrings("OBLQ.txt");</p>

<p>}</p>

<p>void draw() {
  background(230);</p>

<p>//Database
  if (index &lt; lines.length) {
    String[] pieces = split(lines[index], " ");
    if (pieces.length == 2) {
      int x = int(pieces[' ']) ;
      int y = int(pieces[1]) ;</p>

<p>println(x);
index = index + 1;</p>

<p>//HERE IS WHERE I WOULD LIKE TO INSERT THE TEXT();</p>

<p>}
}
//Loop database
if(index &gt; 20) {
index = 0;</p>

<p>}
}</p>
]]></description>
   </item>
   <item>
      <title>Font List</title>
      <link>https://forum.processing.org/two/discussion/16525/font-list</link>
      <pubDate>Tue, 10 May 2016 12:35:19 +0000</pubDate>
      <dc:creator>jaspervanblokland</dc:creator>
      <guid isPermaLink="false">16525@/two/discussions</guid>
      <description><![CDATA[<p>Hi There</p>

<p>I am using the next code to have a Font List. It works perfectly. But i want to replace the ''random(0, 2)" by the sequence of the font list. So, i want that the font is not anymore random. Do someone know how i can fix this?</p>

<p>Greetings</p>

<p>PFont afont, bfont, cfont;</p>

<p>String[]mainfont = {"afont", "bfont", "cfont"};</p>

<p>void setup() { 
  size(200,200);</p>

<p>afont = createFont("FreeMono", 1);
  bfont = createFont("Kinnari-Italic", 1);
  cfont = createFont("Norasi", 1);</p>

<p>}</p>

<p>void draw(){</p>

<p>float x = random(0,2);
  int y = int (x);</p>

<p>textFont(mainfont[y]);</p>

<p>// GET THE MESSAGE: method textFont(PFont) in the type PApplet is // not applicable for the arguments (String)</p>

<p>text("I want to get here everytime another FONTtype", 50, 50);
  }</p>
]]></description>
   </item>
   <item>
      <title>Any solution for textFont() bug in Android mode?</title>
      <link>https://forum.processing.org/two/discussion/15283/any-solution-for-textfont-bug-in-android-mode</link>
      <pubDate>Fri, 04 Mar 2016 15:59:38 +0000</pubDate>
      <dc:creator>erkosone</dc:creator>
      <guid isPermaLink="false">15283@/two/discussions</guid>
      <description><![CDATA[<p>Any solution for this bug?</p>

<p>In android when you use a text font fail all transparencies of the images and the screen becomes corrupted, you can not use text in android? a temporary solution for working with text in android?</p>
]]></description>
   </item>
   <item>
      <title>Unexpected Results of  the function createGraphics</title>
      <link>https://forum.processing.org/two/discussion/15505/unexpected-results-of-the-function-creategraphics</link>
      <pubDate>Tue, 15 Mar 2016 13:36:57 +0000</pubDate>
      <dc:creator>DarkFlame</dc:creator>
      <guid isPermaLink="false">15505@/two/discussions</guid>
      <description><![CDATA[<p>I am working on a small demo about creating text clouds, and got stuck in the createGraphics().</p>

<p>Here is my Code:</p>

<pre><code>    PImage pic;
    PFont font;
    PGraphics pg;
    PGraphics manyC,finalSave;
    String[] words={"hello","world","hello","world","hello","world","hello","world","hello","world","hello","world"};
    PGraphics[] wordPic;


    void setup(){
      size(1800,1800);
      pic=loadImage("1.png");
      pic.filter(THRESHOLD,0.9);
      pic.resize(1800,0);
      pic.save("D://sample.png");


      font=createFont("微软雅黑",240);
      textFont(font);
      float strHt=textAscent()+textDescent();
      manyC      = createGraphics(pic.width,pic.height);
      finalSave  = createGraphics(pic.width,pic.height);
      //finalSave.smooth();

      wordPic=new PGraphics[words.length];
      int[] w =  new int[16];
      w[0] = 400;
      w[1] = 400;
      w[2] = 400;
      w[3] = 400;
      w[4] = 400;
      w[5] = 400;
      w[6] = 400;
      w[7] = 400;
      w[8] = 400;
      w[9] = 400;
      w[10] = 400;
      w[11] = 400;
      w[12] = 400;
      w[13] = 400;

      for(int i=0;i&lt;wordPic.length;i++){

        int wid = (int)textWidth(words[i]);
        println(wid);
        wordPic[i] = createGraphics(w[i],400);
        wordPic[i].beginDraw();
        wordPic[i].background(255);
        wordPic[i].textFont(font);
        wordPic[i].textAlign(LEFT,TOP);
        wordPic[i].fill(color(0,0,0));
        wordPic[i].text(words[i],0,0);
        wordPic[i].endDraw();

        if(wordPic[i].width&gt;=width){
          wordPic[i].resize(width,0);
        }
      }


      for(int i=0; i&lt;wordPic.length;i++){
        wordPic[i].save("D://wordpic"+i+".jpg");
      }
      println("over");
    }
</code></pre>

<p>the output is like that:
<img src="https://forum.processing.org/two/uploads/imageupload/372/PCBXICRIX3M7.png" alt="Image 1" title="Image 1" /></p>

<p>so far so good. However, if I adjust the value of w[], which changes the width value when calling the function createGraphics(), the unexpected result comes out!</p>

<p><img src="https://forum.processing.org/two/uploads/imageupload/010/1RGUS4LGHNDE.png" alt="Image 2" title="Image 2" />
<img src="https://forum.processing.org/two/uploads/imageupload/011/GI18MPB5I1TY.png" alt="Image 3" title="Image 3" /></p>

<p>All I did was changing some values of w[], like 800,1200.</p>

<p>well, I'm confused.</p>

<p>I'm trying to adjust the graphics width, like this: 
wordPic[i] = createGraphics((int)textWidth(words[i]),(int)strHt);
so I can handle them as small objects of the text Cloud.</p>

<p>And clearly, the results are not good enough.</p>

<p>So, is there anyone could help me about this problem?
tell me why this will happen, or how can I leave this problem alone and go ahead for my work?</p>
]]></description>
   </item>
   <item>
      <title>per object movement</title>
      <link>https://forum.processing.org/two/discussion/15154/per-object-movement</link>
      <pubDate>Sat, 27 Feb 2016 15:57:39 +0000</pubDate>
      <dc:creator>zörg</dc:creator>
      <guid isPermaLink="false">15154@/two/discussions</guid>
      <description><![CDATA[<p>Hi there,
This should be fairly simple but I cannot seem to make it work. I've somehow managed drawing each letter separately but I would like ascend() to apply on an x-axis per letter basis instead of the cumulative x so that only the letters on the left of the mouse should execute it. 
I'd appreciate it if you guys could help me out. 
Thanks in advance.</p>

<pre><code>            PFont f;
            String s = "This has gone too far";
            int x = 30;
            int howBig = 20;
            Letter [] letters;



            void setup() {
              size (400, 200);
              frameRate(25);
              smooth();
              f = createFont("DINTBlack",20);
              textFont(f);
              letters = new Letter[s.length()];

              for (int i = 0; i&lt;s.length(); i++) {
                char c = s.charAt(i);
                letters[i] = new Letter(x, height/2, c);
                x+=textWidth(c);

                //println(letters);
              }
            }

            void draw() {
              background(127);
              for (int i = 0; i&lt;letters.length; i++) {
                letters[i].display();
                if (mouseX&gt;x) {
                  letters[i].ascend();
                }
                if (mousePressed) {
                  letters[i].home();
                }
              }
            }

        class Letter {
          int x, y;
          int homeX, homeY;
          char c;
          Letter(int x_, int y_, char c_) {
            x=homeX=x_;
            y=homeY=y_;
            c=c_;
          }
          void display(){
            text(c,x,y);
          }
          void ascend(){
            if(y&gt;0){
            y-=random(2,4);

            }else{
              y= homeY;
            }

          }
          void home(){
            x = homeX;
            y = homeY;
          }
        }


            //println(PFont.list());
</code></pre>
]]></description>
   </item>
   <item>
      <title>starting a new string by pressing return</title>
      <link>https://forum.processing.org/two/discussion/14894/starting-a-new-string-by-pressing-return</link>
      <pubDate>Sat, 13 Feb 2016 17:09:06 +0000</pubDate>
      <dc:creator>Tilia</dc:creator>
      <guid isPermaLink="false">14894@/two/discussions</guid>
      <description><![CDATA[<p>hi people!
i wrote a simple code just to write something live in the sketch window. 
i want to finish this string and start a new one by pressing return, because i want then to write with another font.
i tried a few things, but i cannot make more than one string at the same time and writing directly in the sketch window.. i dont know why..</p>

<p>here is the code:
    PFont myFont; //myFont als PFont deklarieren
    String typedWord = "";//String deklarieren</p>

<pre><code>void setup() { 
  size(displayWidth, displayHeight);//grösse des Sketchfensters

    myFont = createFont("CENTURY.ttf", 100);//kreiere PFont als myFont
    //myFont = createFont("AAA.ttf", 100);//kreiere PFont als myFont


  textFont(myFont);  //benutze myFont als TextFont

  fill(255);//Füllfarbe der Schrift
}

void draw() {
  background(0);//Hintergrundfarbe
  text(typedWord, displayWidth/16, displayHeight/16*3);//Stringwahl und Anfangsposition  
}

void keyPressed() {
  println(key); //schreibe den aktuellst getippten Buchstaben in die Konsole
  if (key!=1) {
    if (keyCode == BACKSPACE) { //Anweisung um einen Buchstaben aus dem String löschen zu können
  if (typedWord.length() &gt; 0) {
    typedWord = typedWord.substring(0, typedWord.length()-1); //erases the last character
  }
    }
    else { //Anweisung den getippten Buchstaben zum String zu addieren
  typedWord += key; 
    }
  }

}
</code></pre>
]]></description>
   </item>
   <item>
      <title>fontsize dynamically fitting into screen</title>
      <link>https://forum.processing.org/two/discussion/14593/fontsize-dynamically-fitting-into-screen</link>
      <pubDate>Sat, 23 Jan 2016 16:56:33 +0000</pubDate>
      <dc:creator>Tilia</dc:creator>
      <guid isPermaLink="false">14593@/two/discussions</guid>
      <description><![CDATA[<p>hey guys,</p>

<p>ive written a writing programm using geomerative library. now i got 2 problems to solve.</p>

<ul>
<li><p>i want to make the fontsize dynamically fitting into the the given window depending on the string length.
(here is an example video on youtube: <span class="VideoWrap"><span class="Video YouTube" id="youtube-BBqR9qfdels"><span class="VideoPreview"><a href="http://youtube.com/watch?v=BBqR9qfdels"><img src="http://img.youtube.com/vi/BBqR9qfdels/0.jpg" width="640" height="385" border="0" /></a></span><span class="VideoPlayer"></span></span></span>)</p></li>
<li><p>i want to make a linebreak by pressing return/enter. what is the best way to do that?</p></li>
</ul>

<p>here is the code:</p>

<pre><code>import geomerative.*;
import processing.pdf.*;
boolean doSave = false;

RFont font;
RPoint[] myPoints; 
String myText = "";
RGroup myGroup;
int textsite;
//----------------SETUP---------------------------------
void setup() {
  size(800,300);
  background(255);
  smooth();
  RG.init(this); 
  font = new RFont("FreeSans.ttf",100, CENTER);
}

//----------------DRAW---------------------------------
void draw() {

  background(0);
  stroke(#00FFE8);
  noFill();
  translate(width/2, height/1.7);

  RCommand.setSegmentLength(1);
  RCommand.setSegmentator(RCommand.UNIFORMLENGTH);

  if (myText.length() &gt; 0) {
    RGroup myGroup = font.toGroup(myText); 
    myGroup = myGroup.toPolygonGroup();
    RPoint[] myPoints = myGroup.getPoints();

    beginShape();
    for(int i=0; i&lt;myPoints.length; i++) {
      ellipse(myPoints[i].x, myPoints[i].y,1,1);
      //curveVertex(myPoints[i].x, myPoints[i].y);
    }
    endShape();

    // ------ SAVING  ------ 
    if (doSave) {
      doSave = true;
      endRecord();

      println("gespeichert");
    }
  }
}

//----------------KEYS---------------------------------
void keyReleased() {
  if (keyCode == CONTROL) doSave = true;
}

void keyPressed() {
  if(key !=CODED) {
    switch(key) {
    case DELETE:
    case BACKSPACE:
      myText = myText.substring(0,max(0,myText.length()-1));
      break;
    case ENTER:

      break;
    default:
      myText +=key;
    }
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How can I control my font?</title>
      <link>https://forum.processing.org/two/discussion/14299/how-can-i-control-my-font</link>
      <pubDate>Wed, 06 Jan 2016 13:39:58 +0000</pubDate>
      <dc:creator>jondoh</dc:creator>
      <guid isPermaLink="false">14299@/two/discussions</guid>
      <description><![CDATA[<p>I needed to learn to use PGraphics to achieve what I wanted in my code - scrolling text across the screen and the ability to "graffiti" it too".</p>

<p>However, since re-writing, my font, size, boldness etc won't change!</p>

<p>In my non-PGraphics code, I used</p>

<p><code>font = createFont("CourierNewPS-BoldMT-48", 44, true);</code></p>

<p>However, in my new code, it doesn't seem to use the values that 'font' has.</p>

<p>My new code is (sorry for the length - I have no idea where the font code should be)</p>

<pre><code>import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;
// import necessary libraries to play sound effect
String[] tickerText =
{
  "children were some of the greatest victims", "I was a child soldier", 
// ....
};

Minim minim;
AudioPlayer sound1; // variable name
AudioPlayer sound2;
PGraphics pg;
PFont font; //declare PFont object called font
PImage background; 
float x; // location of text on x axis
int index = 0;


void setup() {

  size(615, 762, P2D);

  font = createFont("CourierNewPS-BoldMT-48", 44, true);
  background = loadImage ("background_Text_Image.JPG"); // load background image
  minim = new Minim(this); //define construction
  sound1 = minim.loadFile("Children_Playing_Sound.mp3");
  sound1.loop(); // is looped

  pg = createGraphics(width, height, P2D);
  pg.beginDraw();
  pg.background(background); // draw background as imported image
  pg.endDraw(); 

  font = createFont("CourierNewPS-BoldMT-48", 44, true);

  x = 0; // the int x is used as the entry point for the text scrolling in
}

void draw() {
  if (mousePressed) { //function activated by mouse
    pg.beginDraw();
    pg.line(mouseX, mouseY, pmouseX, pmouseY);
    pg.stroke(random(255), random(255), random(255)); // stroke changed to random RBG values, each with a max of 255
    pg.strokeWeight (random(4, 8)); // random stroke weight, with a min of 4 and max of 8 pixels
    pg.endDraw();
  }
  background( pg.get() );
  textFont(font);  
  fill(255,0,0); //sets colour of font, red
  text(tickerText[index], x, height/2); //location of text on x axis - in this case mid-way


  x = x - 1; 
  float w = textWidth(tickerText[index]); // calculates the width of the text string - necessary for knowing when the text leaves the screen
  if (x &lt; -w) { // when x moves completely off the screen new text appears
    x = width; 
    index = (index + 1) % tickerText.length;

   }
}
</code></pre>

<p>Thank you in advance</p>
]]></description>
   </item>
   <item>
      <title>PGraphics - can't get text to display</title>
      <link>https://forum.processing.org/two/discussion/13893/pgraphics-can-t-get-text-to-display</link>
      <pubDate>Fri, 11 Dec 2015 15:46:36 +0000</pubDate>
      <dc:creator>DDJ</dc:creator>
      <guid isPermaLink="false">13893@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I am working with a PGraphics item to display an information panel on screen, but can't get it to display text.  The code is below.</p>

<p>As it stands currently there is a runtime Null Pointer Exception at the point shown below.</p>

<p>If I take all of the font references out, I get no runtime errirs, but only the rectangle is displayed, not the text.</p>

<p>Can anyone point out what I'm overlooking here please?</p>

<p>Thanks.</p>

<pre><code>final int TEST_TEXT_X1=12;
final int TEST_TEXT_X2=80;
final int TEST_BOX_X=10;
final int TEST_BOX_Y=320;
final int TEST_BOX_HEIGHT=79;
final int TEST_BOX_WIDTH=100;
final int TEST_TEXT_GAP=17;
final int TEST_DATA_Y1=TEST_BOX_Y+15;
final int TEST_DATA_Y2=TEST_DATA_Y1+TEST_TEXT_GAP;
final int TEST_DATA_Y3=TEST_DATA_Y2+TEST_TEXT_GAP;
final int TEST_DATA_Y4=TEST_DATA_Y3+TEST_TEXT_GAP;
final int TEST_DATA_Y5=TEST_DATA_Y4+TEST_TEXT_GAP;
final int TEST_CLEAR_X=40;
final int TEST_CLEAR_Y=TEST_BOX_Y+2;
final int TEST_CLEAR_HEIGHT=50;
final int TEST_CLEAR_WIDTH=90;
//
PGraphics testPanel; // panel to display test information
//
void setup() {
  colorMode(RGB);
  size(1400, 500);
  background(255,255,255);  
  // If I remove the font stuff from here.....
  PFont font;
  font=loadFont("Calibri-20.vlw");
  testPanel.textFont(font,12);  // ********* Null Pointer Exception here ********
  // ....to here no runtime error but no text displays either
  testPanel = createGraphics(TEST_BOX_HEIGHT+2, TEST_BOX_WIDTH+2);
  testPanel.beginDraw();
  testPanel.stroke(0,0,0);
  testPanel.strokeWeight(1);
  testPanel.fill(255,255,255);
  testPanel.rect(0, 0, TEST_BOX_HEIGHT, TEST_BOX_WIDTH);
  testPanel.fill(0,0,0);
  testPanel.textSize(12);
  testPanel.text("A", TEST_TEXT_X1, TEST_DATA_Y1);
  testPanel.text("B", TEST_TEXT_X1, TEST_DATA_Y2);
  testPanel.text("C:", TEST_TEXT_X1, TEST_DATA_Y3);
  testPanel.text("D", TEST_TEXT_X1, TEST_DATA_Y4);
  testPanel.text("E:", TEST_TEXT_X1, TEST_DATA_Y5);
  testPanel.endDraw();
}

void draw() {
  image(testPanel, TEST_BOX_X, TEST_BOX_Y);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Chat with dynamic type</title>
      <link>https://forum.processing.org/two/discussion/13854/chat-with-dynamic-type</link>
      <pubDate>Wed, 09 Dec 2015 12:02:26 +0000</pubDate>
      <dc:creator>Tilia</dc:creator>
      <guid isPermaLink="false">13854@/two/discussions</guid>
      <description><![CDATA[<p>Hi Guys,</p>

<p>Do you think it is possible to program a chat in processing in which the punctuation has influence on the typeface?
for example:</p>

<p>"Hello, i write something like this!!!" --&gt; and it will be postet like --&gt; "<strong><em>Hello, i write something like this!</em></strong>"</p>

<p>it should be postet bold and italic because i have done three "!!!"</p>
]]></description>
   </item>
   <item>
      <title>Displaying text makes my frameRate fall</title>
      <link>https://forum.processing.org/two/discussion/13069/displaying-text-makes-my-framerate-fall</link>
      <pubDate>Sat, 17 Oct 2015 16:16:27 +0000</pubDate>
      <dc:creator>jimrolland</dc:creator>
      <guid isPermaLink="false">13069@/two/discussions</guid>
      <description><![CDATA[<p>Hello,
I have a little problem. On a processing project for android, I have to display a lot of text on the screen.
I use :</p>

<pre><code>string myString = "lots of words";
textFont(myFont, 20);
text(myString, x, y);
</code></pre>

<p>but the performances are very low (5 fps).
Does anyone has an advice for a best performance?</p>

<p>Thanks a lot,
JM</p>
]]></description>
   </item>
   <item>
      <title>Searchable PDFs</title>
      <link>https://forum.processing.org/two/discussion/13003/searchable-pdfs</link>
      <pubDate>Wed, 14 Oct 2015 09:38:01 +0000</pubDate>
      <dc:creator>setup</dc:creator>
      <guid isPermaLink="false">13003@/two/discussions</guid>
      <description><![CDATA[<p>Is it possible to create searchable PDFs in processing?</p>
]]></description>
   </item>
   <item>
      <title>loadFont is not defined</title>
      <link>https://forum.processing.org/two/discussion/11116/loadfont-is-not-defined</link>
      <pubDate>Tue, 02 Jun 2015 15:04:03 +0000</pubDate>
      <dc:creator>akiersky</dc:creator>
      <guid isPermaLink="false">11116@/two/discussions</guid>
      <description><![CDATA[<p>Hi All!</p>

<p>Working on a project with the great p5js javascript lib and running into an issue using loadFont. When trying to use loadFont in preload() I get a "RefrenceError: loadFont is not defined" I see it in the github repo, however the versions from the cdn and bower give the ref error. I tried downloading manually from github (just the p5js file), but then I get "RangeError: argument 1 accesses an index that is out of range"</p>

<p>Here's a demo of what I'm trying to do:</p>

<pre><code>var Helv;

function preload() {
    Helv = loadFont("HelveticaNeueLTStdCn.otf");
}
function setup() {
  textFont(Helv);
  text("it's helvetica!", 100, 100);
}
</code></pre>

<p>What am I missing?</p>
]]></description>
   </item>
   <item>
      <title>Trying to load a font...</title>
      <link>https://forum.processing.org/two/discussion/11499/trying-to-load-a-font</link>
      <pubDate>Mon, 29 Jun 2015 12:48:04 +0000</pubDate>
      <dc:creator>Holtensen</dc:creator>
      <guid isPermaLink="false">11499@/two/discussions</guid>
      <description><![CDATA[<p>Hello Community!
I have been trying to create a font all morning, looked through various sites and everything, but it still wont work.
I downloaded a font I called "gamefont(.ttf)", but now when I put in my code:</p>

<p>createFont(gamefont, 20);</p>

<p>I get the error: "Cannot find anything named "gamefont".".<br />
For test purposed I let processing create a new font, using its own tool, but the programm wont even load that font. 
Of course the fonts are in the sketch's data folder.</p>

<p>Can anyone tell me what I am doing wrong?</p>

<p>Thanks for a short answer in advance!</p>
]]></description>
   </item>
   <item>
      <title>Different font versions (light, ultrabold etc.) other than italic/bold don't show in Processing?</title>
      <link>https://forum.processing.org/two/discussion/10137/different-font-versions-light-ultrabold-etc-other-than-italic-bold-don-t-show-in-processing</link>
      <pubDate>Wed, 01 Apr 2015 16:27:31 +0000</pubDate>
      <dc:creator>rapatski</dc:creator>
      <guid isPermaLink="false">10137@/two/discussions</guid>
      <description><![CDATA[<p>I'm about ready to file this as a bug, but just to be sure; anyone else trouble getting certain font styles to work in Processing? I seem to have invariably trouble getting Light variants of fonts to work, and whether condensed works seems arbitrary.. Tested both the behaviour of createFont and loadFont, but they seem the same.</p>

<p>See test sketch below:</p>

<pre>
PFont light, lightItalic, normal, normalItalic, bold, boldItalic, black; 

void setup()
{
  size(800, 800);
  //println(PFont.list());

  //normal = createFont("Helvetica", 100);
  //light = createFont("Helvetica-Light", 100);
  //bold = createFont("Helvetica-Bold", 100);

  light         = createFont("GillSans-Light", 100);
  lightItalic   = createFont("GillSans-LightItalic", 100);
  normal        = createFont("GillSans", 100);
  normalItalic  = createFont("GillSans-Italic", 100);
  bold          = createFont("GillSans-Bold", 100);
  boldItalic    = createFont("GillSans-BoldItalic", 100);
  black         = createFont("GillSans-UltraBold", 100);
  
}


void draw()
{
  textAlign(CENTER, CENTER);
  int numLines = 8;

  textFont(light);
  text("PROCESSING", width/2, height/numLines*1);
  textFont(lightItalic);
  text("PROCESSING", width/2, height/numLines*2);
  textFont(normal);
  text("PROCESSING", width/2, height/numLines*3);
  textFont(normalItalic);
  text("PROCESSING", width/2, height/numLines*4);
  textFont(bold);
  text("PROCESSING", width/2, height/numLines*5);
  textFont(boldItalic);
  text("PROCESSING", width/2, height/numLines*6);
  textFont(black);
  text("PROCESSING", width/2, height/numLines*7);
}
</pre>
]]></description>
   </item>
   <item>
      <title>Very slow responsiveness when using textfond()</title>
      <link>https://forum.processing.org/two/discussion/9884/very-slow-responsiveness-when-using-textfond</link>
      <pubDate>Mon, 16 Mar 2015 16:08:04 +0000</pubDate>
      <dc:creator>sm2883</dc:creator>
      <guid isPermaLink="false">9884@/two/discussions</guid>
      <description><![CDATA[<p>Hi their,</p>

<p>I am currently working on an application which consist of a GUI and a number of application levels (states). However the responsiveness of all the buttons and to switch between different states become really slow when I make use of the textfond() method. For a satisfactory response time I have to completely get rid of textfond().</p>

<p>Is this normal or its just me? I am currently using processing 2.1</p>

<p>Thanks</p>
]]></description>
   </item>
   </channel>
</rss>