I have been distributing a script for digital-negative calibration:
http://www.botzilla.com/blog/archives/000544.html
and a number of users have complained that it keeps requiring the font 'Myriad Pro' -- which they don't have, and which my script never requests.
I've been investigating and sure enough, PS-CS2+ keeps automagically switching the font to Myriad as a default -- never a problem if you already have Myriad on your system, but otherwise you will get an error dialog on EVERY text-layer creation event. Bizarre and horrible....
The only solution so far seems to be requiring the purchase of 'Myriad Pro'
New Text Layers Causing Errors: Requires 'Myriad Pro'???
New Text Layers Causing Errors: Requires 'Myriad Pro'???
Does manually specify the font when you create the text layer get around the problem? I do have Myriad, but I've never noticed CS2 defaulting to it. But then again, I am usually also specifying the font which is why I asked.
-X
-X
New Text Layers Causing Errors: Requires 'Myriad Pro'???
Here's the function:
function writeText(x,y,userString,val,just)
{
var c = new SolidColor();
c.rgb.red = val;
c.rgb.green = val;
c.rgb.blue = val;
var newTextLayer = activeDocument.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.font = "Arial";
newTextLayer.textItem.size = 20; // points, not pixels
newTextLayer.textItem.contents = userString;
newTextLayer.textItem.color = c;
newTextLayer.textItem.position = Array(x, y);
newTextLayer.textItem.justification = just;
return newTextLayer;
}
function writeText(x,y,userString,val,just)
{
var c = new SolidColor();
c.rgb.red = val;
c.rgb.green = val;
c.rgb.blue = val;
var newTextLayer = activeDocument.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.font = "Arial";
newTextLayer.textItem.size = 20; // points, not pixels
newTextLayer.textItem.contents = userString;
newTextLayer.textItem.color = c;
newTextLayer.textItem.position = Array(x, y);
newTextLayer.textItem.justification = just;
return newTextLayer;
}
New Text Layers Causing Errors: Requires 'Myriad Pro'???
..also, I usually keep my character window open most of the time, and I do see it regularly switch to Myriad Pro all by itself, even though I may have set a different default font at some point
("Set" meaning: clicked a different font in the character window, or clicked the text tool and changed the font to some non-Myriad font before typing anything)
("Set" meaning: clicked a different font in the character window, or clicked the text tool and changed the font to some non-Myriad font before typing anything)
New Text Layers Causing Errors: Requires 'Myriad Pro'???
bjorke wrote: newTextLayer.textItem.font = "Arial";
}
That's your problem. Try
Code: Select all newTextLayer.textItem.font = "ArialMT";
It needs a postscript fontname. If you don't give it one, CS2 doesn't know what you want so it happily falls back to a substitute font.
-X
}
That's your problem. Try
Code: Select all newTextLayer.textItem.font = "ArialMT";
It needs a postscript fontname. If you don't give it one, CS2 doesn't know what you want so it happily falls back to a substitute font.
-X
New Text Layers Causing Errors: Requires 'Myriad Pro'???
Ok, slight variation on this same problem:
I have a dropdownlist which gives me a list of all the fonts, from which I select one. That font is then supposed to be used in the function later similar to Bjorke's one. But it keeps defaulting to Myriad Pro.
Here's the dropdownlist:
Code: Select alldlg.imgPnl.cpyPnl.cpyOptionPnl.typeSt = dlg.imgPnl.cpyPnl.cpyOptionPnl.add('statictext', [20, 130, 80, 150], 'Font:');
dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd = dlg.imgPnl.cpyPnl.cpyOptionPnl.add('dropdownlist', [90, 130, 270, 150], '');
var item
for (var i=0; i<app.fonts.length; i++) {
item = dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.add ('item', "" + app.fonts.name);
}
//dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.onChange = function() {
//varCpyFontDlg = app.fonts[parseInt(dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.selection)].name;
//}
How do I get it to give the postscript fontname you mentioned X?
I have a dropdownlist which gives me a list of all the fonts, from which I select one. That font is then supposed to be used in the function later similar to Bjorke's one. But it keeps defaulting to Myriad Pro.
Here's the dropdownlist:
Code: Select alldlg.imgPnl.cpyPnl.cpyOptionPnl.typeSt = dlg.imgPnl.cpyPnl.cpyOptionPnl.add('statictext', [20, 130, 80, 150], 'Font:');
dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd = dlg.imgPnl.cpyPnl.cpyOptionPnl.add('dropdownlist', [90, 130, 270, 150], '');
var item
for (var i=0; i<app.fonts.length; i++) {
item = dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.add ('item', "" + app.fonts.name);
}
//dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.onChange = function() {
//varCpyFontDlg = app.fonts[parseInt(dlg.imgPnl.cpyPnl.cpyOptionPnl.typeDd.selection)].name;
//}
How do I get it to give the postscript fontname you mentioned X?
New Text Layers Causing Errors: Requires 'Myriad Pro'???
app.fonts.postScriptName
Mike
Mike