Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issues in PsdFile preventing PsdComposerSample from working #240

Merged
merged 1 commit into from Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Plugins/Libs/PsdPlugin/PsdFile/Text/TdTaParser.cs
Expand Up @@ -54,7 +54,7 @@ public static object query(object tree, string selector)
if (m != null && m.Success)
{
string key = m.Groups["key"].Value;
return query(((Dictionary<string,object>)tree)[key], selector.Substring(m.Length));
return ((Dictionary<string, object>)tree).ContainsKey(key) ? query(((Dictionary<string,object>)tree)[key], selector.Substring(m.Length)) : false;
}

//Check for array notation
Expand Down
3 changes: 3 additions & 0 deletions Plugins/Libs/PsdPlugin/PsdFile/Text/TextLayerRenderer.cs
Expand Up @@ -142,6 +142,9 @@ public void Render(Graphics g, Nullable<Color> overlayColor, string replacementT
fontName = new Regex("\\-(Bold|Italic|BoldItalic)$", RegexOptions.IgnoreCase | RegexOptions.IgnoreCase).Replace(fontName, "");
//Remove PS
if (fontName.EndsWith("PS")) fontName = fontName.Substring(0, fontName.Length - 2);
//Convert camel case fontName to spaced font name
fontName = Regex.Replace(fontName, "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 ");

//Find font family
try {
fontFamily = new FontFamily(fontName);
Expand Down