-
Notifications
You must be signed in to change notification settings - Fork 39
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
Overlapping text (possible fix found) #26
Comments
@Splatypus
It seems that the layerHeight value is not being correctly calculated by using the bounds, so I just used the rastering and measuring method found in the getRealTextLayerDimensions function. See if this helps out. I also made some tweaks to the scaleTextToFitBox function from excessFunctions.jsx file while I was testing fixes, but not sure if they were impactful or not. Try this and see if that helps. If you still have issues, I can give you my excessFunctions.jsx changes to see if those do the trick. |
@archangel519 thanks for the help! You're right in that it seems to be an issue in the scaleTextToFitBox function. Unfortunately, the change on line 730 looks like it gets me the same results. What kind of changes did you make to escessFunctions? |
I seem to have fixed the issue by commenting out the entire
block at formatText.jsx line 940 to line 971. |
Sure, Here is my excessFunctions.jsx updates, beginning around line 26.
I think the reason your change fixed your issue is because you are removing the flavor text from the text box, which makes the text not be too big for the text area. The changes I did in the function above basically hard sets the leadSize to 1.2x of the fontSize and does not try to do the previous math. The leadSize was what was causing issues for me if I remember correctly. It's been a few weeks since I had this issue and I'm not sure if my solution is the most elegant way to address this. :) |
what you guys are seeing with text layers is being caused by two things:
So currently the repo is pretty broken and I apologise for that. I've been rebuilding all of my templates from scratch to make some tweaks to them (fixing bevels, drop shadows, textures, tweaking a few other things), and these new versions have text layers that have been regenerated to fix this issue. Additionally, I've modified my code to step down in 0.1pt increments and fix a slew of other unitvalue related issues I found. (e.g. the part where leadsize was set to 2x fontsize) However I'm currently flat out with work and don't have much spare time so work on these templates is on hold atm. My plan was to release all of the new templates and update this repo all at once when the templates are done - I've made good progress on my templates but still have quite a few more to rebuild. To be honest I wasn't sure that anyone other than myself really used this repo so that's why I haven't prioritised fixing the text layers on my current templates and pushing out a patch earlier haha re: the purpose of the
|
I know it's probably not enough for the work involved, but if it helps I can drop you a $100 donation with the release of the new working templates/code. This tool is fantastic. |
holy moly!! you definitely don't have to but that'd be enormously appreciated <3 I'll let you know when I have more to share with regards to my new templates. thank you so much for the kind words! |
Just wanted to drop a comment that I've hit this same issue too when I updated my templates (accidentally overrode the old ones and had to update the repo to work with the new templates). I'd love to help you out @ndepaola if you need, I've been using a fork of your repo for over a year now and am thankful for what you've done to this point!! Also thank you @Splatypus for the tip on commenting out that block, that did the trick for me too! |
this issue has been up for a while so I thought I should share an update as to my progress towards resolving it. This year I've been working on redrawing all of my templates from scratch and I'm almost finished - just need to do the dfc/mdfc planeswalker templates for front/back and normal/extended variants. As soon as they're done I'll publish all of my new templates (which I think are significantly better quality than my old ones, check out images on my gdrive for a comparison as I have a mix of old and new there) and push my code changes that work with the new templates. I'm also interested in spending some time after the new templates go live on improving the code quality of this repo, as a lot of it is shockingly bad and I've learned a lot since first creating it - that shouldn't entail any functional changes though |
could you guys try pulling the latest changes and seeing if the updated scripts work w/ the new templates (available on my gdrive)? this should be resolved now |
Opening the new I chose to Keep Layers and overwrote the existing file and ran the scripts, and it looks real close! I'm thinking something may have been lost when I ran that conversion, but I don't think I can get around that. @ndepaola which version of PS do you use? |
huh, very weird - i'm using CC 2018, but i used to use CS5 and i thought i was being mindful of backwards compatibility. i'll check it out (i think i still have CS5 installed) and see if it's a simple fix. looks like the script didn't read the size of the textbox reference layer properly so it didn't scale down the text at all, but it did rasterise and centre-justify the text relative to the reference. |
hmm, this must have regressed while i was cutting down auto-generated code from format_text - frustrating that i can't recreate the issue locally! format_text on the refactor branch is now resetting the layer's justification to what it was pre-formatting as a final step - when you get a sec could you try pulling the latest changes and see if that fixes it? re: text not scaling down - the code that drives this sits in |
I pulled I added a couple print statements and noticed that one of the variables is // Reduce the reference height by 64 pixels to avoid text landing on the top/bottom bevels
var reference_height = reference_dimensions.height - new UnitValue(64, "px");
alert(reference_height); // NaN
alert(reference_dimensions.height); // 1.04... in
alert(compute_text_layer_dimensions(layer).height); // 1.17... in I have no experience with PS scripting so not sure if it was a data type or conversion issue. I'd be happy to jump on a Discord call or something for a debug session if you're interested! |
i managed to recreate the issue by setting my default units in Photoshop to inches (from pixels) - will post an update when i resolve the bug (don't have much time to work on it atm) |
I extended the templates.jsx -- line 367: execute: function () {
return_value = this.super();
var mana_cost = app.activeDocument.layers.getByName(LayerNames.TEXT_AND_ICONS).layers.getByName(LayerNames.MANA_COST);
mana_cost.textItem.justification = Justification.RIGHT;
return return_value;
} |
i thought i'd fixed the justification issue (in |
excellent!! i'll merge in that branch and leave this issue open for a bit longer in case anyone else in this thread is still having issues <3 |
using windows 10/photoshop CC2018. All fonts are installed and using a fresh pull and fresh template download. Running the script results in a lot of overlap in text boxes. This seems to happen using both normal and boxtopper cards.
The text was updated successfully, but these errors were encountered: