Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with text layer width and height when using Mac PSD's on PC

Status
Not open for further replies.

StevenBevan

Technical User
Feb 22, 2005
3
GB
We have a number of clients that supply us with PSD files created on Macs (possibly using PS 7) and we have a piece of PC software that modifies these files using JavaScript in CS. It gets the height and width of text layers, using:

Layer.textItem.width
Layer.textItem.height

However, in some of these files, the width and height returned is incorrect by an arbitrary amount.

For example:
Width from the Info palette = 264, width from script = 280
Info = 418, Script = 330
Info = 348, Script = 300

If I recreate the text layer on a PC using the same font and size values, the returned height and width are correct.

Has anyone had similar problems or know of a solution?

Any help would be much appreciated,
Steve
 
It could be because Mac font sizes are tyically based on 72ppi and PC fonts 96ppi. Hence a piece of 48pt type will appear to be a different size on Mac compared to a PC.

I'm speculating but perhaps photoshop compensates for this somehow?

Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 
The font sizes appear to be the same, but the problem comes from the size of the bounding box of the text layer.

The Info palette displays the correct width and height, but if I use JavaScript or VB to get the these, it gives the incorrect values.

It doesn't happen with all of the Mac files we receive, only the odd few.

If I duplicate the layer in CS, the errors are passed to the duplicate..... I'm stumped!
 
Why do you need the script? The mac psd should open right up in Photoshop. As long as they haven't flattened the layers, you should have full access. I'm guessing that you're using Export Layers to Files script.

One thing that could be fouled up is the creator's ruler settings. If the original is set to inches, centimeters, etc and your script works on pixels, there could be some conflict. That's just a shot in the dark.
 
I'm using the script to automatically open a large number of PSD files, do things to the text layers and save out a new file, using a script I created.

I'll have a look at the ruler setting, cheers for the suggestion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top