Nifty#32510
Back with another PsdProcessor question. I've tried to simplify my code so someone can copy and paste it, run and see the problem.
I've got a text layer that has a variable placeholder of "{txt2}". Depending on what I replace it with, the text renders in reverse order. Below are the code examples that shows the issue.
Please know that I don't just post the issues as soon as I run across them. I've tried using the TextCallback and examining the HTML string that is in the textFrame.String property and such, but I can't figure out how to make this work.
You guys are very good at fixing or providing a workaround, but there is a time delay so I really do try and solve the problems on my own. I've attached the drive.psd that I'm using, along with the two images so you can see the output.
We are trying to adjust our Photoshop files to deal with the weird rendering of the paths, but we can't work around the incorrect rending of the text, any pointers would be greatly appreciated.
Thanks again for your help.
attach #1368attach #1366attach #1367
I've got a text layer that has a variable placeholder of "{txt2}". Depending on what I replace it with, the text renders in reverse order. Below are the code examples that shows the issue.
static void correct() {
var customResolver = new FontResolver(@"D:\Temp\PsdTests\FontCache");
customResolver.FontRegistry.FallbackFonts.Add("Arial");
var psdProcessor = new PsdProcessor(customResolver);
psdProcessor.StringCallback = (processor, textFrame) => {
var newText = textFrame.Text;
// A string of "Two" works
newText = newText.Replace("{txt2}", "Two");
newText = newText.Replace("{txt}", "Name");
return newText;
};
psdProcessor.Render(@"D:\Temp\drive.psd", @"D:\Temp\correct.jpg");
}
static void incorrect() {
var customResolver = new FontResolver(@"D:\Temp\PsdTests\FontCache");
customResolver.FontRegistry.FallbackFonts.Add("Arial");
var psdProcessor = new PsdProcessor(customResolver);
psdProcessor.StringCallback = (processor, textFrame) => {
var newText = textFrame.Text;
// The string "2" renders incorrectly.
newText = newText.Replace("{txt2}", "2");
newText = newText.Replace("{txt}", "Name");
return newText;
};
psdProcessor.Render(@"D:\Temp\drive.psd", @"D:\Temp\incorrect.jpg");
}Please know that I don't just post the issues as soon as I run across them. I've tried using the TextCallback and examining the HTML string that is in the textFrame.String property and such, but I can't figure out how to make this work.
You guys are very good at fixing or providing a workaround, but there is a time delay so I really do try and solve the problems on my own. I've attached the drive.psd that I'm using, along with the two images so you can see the output.
We are trying to adjust our Photoshop files to deal with the weird rendering of the paths, but we can't work around the incorrect rending of the text, any pointers would be greatly appreciated.
Thanks again for your help.
attach #1368attach #1366attach #1367