RETOUR
A
L ACCUEIL

//Nom.jsx


var docRef = activeDocument


var posHoriz = docRef.width*(5.2/100); //je donne un pourcentage de la taille du document

var posVertic = docRef.height*(99/100); //pour la position du texte


Opacite = 100 ; // reglage de la transparence du calque texte ( de 0 a 100 )

//var TailleFonte = 14;


//Je rends TailleFonte proportionnel a la taille de l image :


TailleFonteW = docRef.width*(0.54/100); // modifier les 0.54 ( = 14 px pour 3888 px )

TailleFonteH = docRef.height*(0.54/100);


if ( docRef.width>docRef.heigth ) // Portrait ou paysage

{

TailleFonte = TailleFonteW

}

else

{

TailleFonte = TailleFonteH

}



//alert( TailleFonte )



fontPostScriptName = "ArialMT-Italic" //"ParkAvenueBT-Regular" - Normal Gras ...etc

NomPolice = "ArialMT" //"ParkAvenue BT" il faut trouver les noms postcripts des fontes.


app.displayDialogs = DialogModes.NO;

app.preferences.typeUnits = TypeUnits.POINTS;


var textColor = new SolidColor; //changer les couleurs

textColor.rgb.red = 201;

textColor.rgb.green = 70;

textColor.rgb.blue = 70;

textColor.opacity = 100;


monNom = "txuku";


var newTextLayer = docRef.artLayers.add(); // le calque de Texte


newTextLayer.kind = LayerKind.TEXT;

newTextLayer.textItem.contents = monNom;

newTextLayer.textItem.position = Array(posHoriz, posVertic);


newTextLayer.textItem.postScriptName = fontPostScriptName;

newTextLayer.textItem.font = NomPolice


newTextLayer.textItem.size = TailleFonte;


newTextLayer.textItem.color = textColor;





newTextLayer.opacity = Opacite;


docRef.flatten(); //aplatir