xxxxxxxxxx
55
let customFont;
let blurText;
function preload() {
// Load the custom font (replace 'YourFontFile.ttf' with your actual font file name)
customFont = loadFont('Handjet.ttf');
}
function setup() {
createCanvas(600, 600);
noLoop(); // Draw only once
}
function draw() {
background(255);
textAlign(CENTER, CENTER);
textFont(customFont); // Set the custom font
// Draw the main text "سودان" with random transformations
for (let i = 0; i < 5; i++) {
let fontSize = random(50, 100);
let offset = random(-10, 50); // Allow for more overlap
let opacity = random(50, 150); // Random opacity
let angle = -TWO_PI / 2; // Random rotation between -45 and 45 degrees
let flip = random([1, -1]); // Randomly flip horizontally
fill(random(255),0,0, opacity); // Set fill color with opacity
textSize(fontSize);
// Save the current transformation state
push();
translate(width / 2 + offset, height / 2 + offset); // Center the text
rotate(angle); // Apply rotation
scale(flip, 1); // Apply flip
text("سودان", 0, 0); // Draw the text at center
pop(); // Restore the transformation state
}
// Draw the blurred text "150423" on the off-screen graphics buffer
blurText = createGraphics(600, 600);
blurText.clear(); // Clear the buffer
blurText.fill(0,0,0,10);
blurText.textSize(50);
blurText.textFont(customFont);
blurText.textAlign(CENTER, CENTER);
blurText.text("150423", blurText.width / 1.9, blurText.height / 2);
blurText.filter(BLUR, 1); // Apply blur effect
// Draw the blurred text onto the main canvas
image(blurText, 0, 0);
}