Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Nifty  
#1 Posted : Friday, January 12, 2018 9:43:45 AM(UTC)
Nifty

Rank: Member

Groups: Member
Joined: 10/12/2015(UTC)
Posts: 28

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.

Code:
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.

drive.zip (719kb) downloaded 1 time(s).correct.jpgincorrect.jpg
Andrey Semenov  
#2 Posted : Tuesday, January 16, 2018 1:35:07 AM(UTC)
Andrey Semenov

Rank: Member

Groups: Member, Administration
Joined: 7/4/2017(UTC)
Posts: 15

Was thanked: 3 time(s) in 3 post(s)
What I've found after checking your template:

1) Right-To-Left Paragraph Direction is checked in paragraph settings for "{txt} MILES" layer for some reason (see attached screenshot). It is usually used for arabic texts. After changing this to Left-To-Right, template started to be rendered normally (please found fixed template attached).
Read more about enabling this feature in Photoshop here: https://forums.adobe.com/thread/1315628

2) For "{txt}" layer, all caps feature is switched on, but it is not supported by Graphics Mill.

3) As for the rendering of the paths, I've reproduced this bug and it should be fixed in future releases.

Regards,
Andrew

rtl.png
drive_fixed.zip (743kb) downloaded 0 time(s).
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.