/* ---------------------------------------------------------------- Copyright (C) 2005 Ricard Marxer Pi??n email (at) ricardmarxer.com http://www.ricardmarxer.com/ ---------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ---------------------------------------------------------------- Built with Processing (Beta) v0118 uses Geomerative (Alpha) v007 ---------------------------------------------------------------- Created 17 January 2006 ---------------------------------------------------------------- fractalfabet ---------------------------------------------------------------- */ import processing.opengl.*; import geomerative.*; RFont f; RMatrix mtx; RGroup basura; RGroup adptdGrp; RGroup txtGrp; RShape shp; int shapeIndex = 0; int[] wordOffsets; int textIndex = 0; int charIndex = 0; final int numChars = 100; //------------------------ Variables for OSD ----------------------------------- boolean osd = true; boolean forceOSD = true; PFont fnt; final String explanation = "Click to get focus. Type and press ENTER. Press ESC to exit."; final int explanationFg = #000000; final String renderTextLabel = "Text entered: "; final int renderTextFg = #000000; final int osdBg = #ffffcc; final int margin = 20; final int pad = 5; float textHeight; //------------------------------------------------------------------------------ String[] calculateRenderText(String txt){ String[] renderText = split(txt); if(renderText == null){ return null; } for(int i=0;i= words[textIndex].length()){ charIndex=0; wordOffsets[textIndex]++; textIndex = (textIndex + 1) % STRNGS.length; shapeIndex = (wordOffsets[textIndex] * words[textIndex].length()) % STRNGS[textIndex].length(); } txtGrp = f.toGroup(STRNGS[textIndex]); basura = new RGroup(); adptdGrp = new RGroup(txtGrp); shp = (RShape)(adptdGrp.elements[shapeIndex]); adptdGrp = new RGroup(); /* Reduce the number of characters per subshape depending on the length of the subshape */ float maxlength = 0F; for(int i=0;i= words[textIndex].length()){ charIndex = 0; wordOffsets[textIndex]++; textIndex = (textIndex + 1) % STRNGS.length; shapeIndex = (wordOffsets[textIndex] * words[textIndex].length()) % STRNGS[textIndex].length(); } /* Reduce the number of characters per subshape depending on the length of the subshape */ float maxlength = 0F; for(int i=0;i= minSize || eheight >= minSize){ result = true; } return result; } String removeSpaces(String s) { StringTokenizer st = new StringTokenizer(s," ",false); String t=""; while (st.hasMoreElements()) t += st.nextElement(); return t; }