Stretching Type / Upper Case Type for media installation

edited March 2018 in Questions about Code

Hello there,

I am working on a multimedia installation, for which I will import headlines from an rss feed and mix it with images from my archive.

My problem now is, that I would like to stretch the type vertically by around 120% and draw the headlines in all uppercase.

Somehow "toUpperCase()" seems to create a conflict with the xml.

Would be very happy to find out, how to solve this.

So this is what I got so far:

PImage[] drawing = new PImage[24];
PImage[] hg = new PImage[8];
PImage[] illu = new PImage[38];
PFont font;
float x;  // horizontal location of headline
XML xml;
String[] headlines;
PFont myFont;

void setup(){
  size(1920, 1080); colorMode(RGB);  background(255,255,255); shapeMode(CENTER);
  frameRate(1);

 // The URL for the XML document
  String url = "http://" + "www.dailymail.co.uk/tvshowbiz/index.rss"; 
  // Load the XML document
  xml = loadXML(url);

  // Grab the element we want
  XML[] headers = xml.getChildren("channel/item/title");
  headlines = new String[headers.length];

  for (int i = 0; i < headers.length; i++) {
     headlines[i] = headers[i].getContent();  }


  for(int i = 0; i<drawing.length; i++)
  {drawing[i] = loadImage("d-"+ i +".png");}
  for(int i = 0; i<hg.length; i++)
  {hg[i] = loadImage("hg-"+ i +".png");}
  for(int i = 0; i<illu.length; i++)
  {illu[i] = loadImage("i-"+ i +".png");}


}

void draw(){    background(255, 255,255);  


  int zufall1 = int(random(24)); int zufall2 = int(random(8));   int zufall3 = int(random(38)); int zufall4 = int(random(18));

   image(hg[zufall2], 0, 0, 700, 987);
   image(drawing[zufall1], 1000, 0, 700, 987);
   image(illu[zufall3], 0, 0, 700, 987);
   text(headlines[zufall4], 200,0, 1500, 1080);

font = createFont("Arial Black.ttf", 152);

textFont(font);
fill(0, 0, 0);
  textSize(152);

  textLeading(140);
 textAlign(CENTER, CENTER);
}

//saveFrame("t-##.jpg"); 

Answers

Sign In or Register to comment.