• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Photoshop text size bug???

Engaged ,
Sep 14, 2015 Sep 14, 2015

Copy link to clipboard

Copied

I think there is a bug in the Photoshop scripting DOM with the text size.   The wrong text size is being reported if an image is resized after the text layers were already created.  It reports the original text size instead of the new text size.

app.activeDocument.activeLayer.textItem.size will always report the text size as the original text size after the image has been resized (and text is auto resized with the image resizing).  Say for instance, you create a text layer at 20 points and then resize the image to 50%.  In this case the text auto sizes down to 10 points.  In the Photoshop user interface it shows the text correctly at 10 points.  However, app.activeDocument.activeLayer.textItem.size still has the font size stored as 20 points instead of 10 points.

Taking it step further, when replacing the text using app.activeDocument.activeLayer.textItem.contents="New Text"..........

For CS6 it will resize the text back to the original point value (text size before the image was resized).

For CC, the text replacement does not resize the text.  It will stay at the current size.  However, CC will still report the old text size and not the current text size

Has anyone encountered this?  If so, would you know of a work around?

TOPICS
Actions and scripting

Views

4.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Advisor ,
Sep 14, 2015 Sep 14, 2015

Copy link to clipboard

Copied

I don't know if this is the same problem that we saw before (sounds similar), but here one fix that was cooked up. If you need something other than points or pixels, you'll need to change a line or two.

//
// PSCCFontSizeFix.jsx
//  setFontSizePoints
//  setFontSizePixels
//
// This file contains a couple of functions that work around
// a bug in PSCC+ that prevents setting the size of the font
// for text layer via the DOM. There is also a test function
// provided.
//
// NOTE: This function will bash both the font typeface and
//      contents of thelayer so it's best to use it right
//      after creating the layer.
//
// $Id: PSCCFontSizeBugFix.jsx,v 1.4 2014/10/11 17:36:54 anonymous Exp $
// Copyright: (c)2014, xbytor
// License: http://www.opensource.org/licenses/bsd-license.php
// Contact: xbytor@gmail.com
//

PSCCFontSizeFix = {
};

PSCCFontSizeFix.setFontSizePoints = function(layer, pt) {
  function cTID(s) { return app.charIDToTypeID(s); };
  function sTID(s) { return app.stringIDToTypeID(s); };

  var magicNumber = cTID("0042");

  var desc23 = new ActionDescriptor();

    var ref6 = new ActionReference(); 
    ref6.putProperty( cTID('Prpr'), cTID('TxtS') ); 
    ref6.putEnumerated( cTID('TxLr'), cTID('Ordn'), cTID('Trgt') ); 
  desc23.putReference( cTID('null'), ref6 );

    var desc24 = new ActionDescriptor(); 
    desc24.putInteger( sTID('textOverrideFeatureName'), magicNumber ); 
  desc24.putInteger( sTID('typeStyleOperationType'), 3 ); 
    desc24.putUnitDouble( cTID('Sz  '), cTID('#Pnt'), pt ); 
  desc23.putObject( cTID('T  '), cTID('TxtS'), desc24 );

  executeAction( cTID('setd'), desc23, DialogModes.NO ); 
  return;

};
PSCCFontSizeFix.setFontSizePixels = function(layer, px) {
  function cTID(s) { return app.charIDToTypeID(s); };
  function sTID(s) { return app.stringIDToTypeID(s); };

  var magicNumber = cTID("0042");

  var desc23 = new ActionDescriptor();

    var ref6 = new ActionReference(); 
    ref6.putProperty( cTID('Prpr'), cTID('TxtS') ); 
    ref6.putEnumerated( cTID('TxLr'), cTID('Ordn'), cTID('Trgt') ); 
  desc23.putReference( cTID('null'), ref6 );

    var desc24 = new ActionDescriptor(); 
    desc24.putInteger( sTID('textOverrideFeatureName'), magicNumber ); 
    desc24.putInteger( sTID('typeStyleOperationType'), 3 ); 
    desc24.putUnitDouble( cTID('Sz  '), cTID('#Pxl'), px ); 
  desc23.putObject( cTID('T  '), cTID('TxtS'), desc24 );

  executeAction( cTID('setd'), desc23, DialogModes.NO ); 
  return;
};


PSCCFontSizeFix.test = function() {
  var doc = app.documents.add(UnitValue("5 in"), UnitValue("7 in"), 300);
  var layer = doc.artLayers.add(); 
  layer.kind = LayerKind.TEXT; 
  layer.name = "Test"; 
  var titem = layer.textItem;

  titem.size = new UnitValue("50", "pt");
 
  if (Math.round(titem.size.as("pt")) != 50) {
    PSCCFontSizeFix.setFontSizePoints(layer, 50);
  }
 
  titem.contents = "This text should be 50pt"; 
  titem.font = "Monaco";
  alert(Math.round(titem.size.as("pt")) + " pt");

  doc.close(SaveOptions.DONOTSAVECHANGES);

  var doc = app.documents.add(UnitValue("5 in"), UnitValue("7 in"), 300);
  var layer = doc.artLayers.add(); 
  layer.kind = LayerKind.TEXT; 
  layer.name = "Test"; 
  var titem = layer.textItem;
  titem.size = new UnitValue("50", "px");
 
  if (Math.round(titem.size.as("px")) != 50) {
    PSCCFontSizeFix.setFontSizePixels(layer, 50);
  }
 
  titem.contents = "This text should be 50px/12pt"; 
  titem.font = "Monaco";
  alert(Math.round(titem.size.as("px")) + " px");

  doc.close(SaveOptions.DONOTSAVECHANGES);
};

//PSCCFontSizeFix.test();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 14, 2015 Sep 14, 2015

Copy link to clipboard

Copied

Thanks for the response.  I'm thinking that the issues that you were having are possibly from the same root issue/bug.  For my script, there is know way of knowing what the font size needs to be.  The script is a text content replacement script that reads a csv file, matches the image file name, and replaces the text contents based on the csv fields.  The users will have text that varies in size.  The script does not change the font or any text parameters. It just replaces the text contents.  I was finally able to use the script listener and modify it so it doesn't resize the text. The script listener outputs 445 code lines when just replacing the text characters.  I chopped off all of the unneeded stuff and got it to 16 lines so it only replaces the text contents.  This seems to work without resizing the text.

The second option I want the script to have is an auto text resizing.  Basically, the script would be used to auto size the text based on the character length. Since the text size is unknown, the resizing would need to do some math and resize based on a percentage of the current text size. However, the issue is that when an image was resized after the text layer was created the DOM returns back the original text size prior to the the image resizing instead of the new text size after the image resizing.  I can't find any way to return the actual current text size.  Without that information there is no way to resize the text appropriately. 

Here is the modified script listener code that seems to replace text without resizing it.  This seems to work even when the text size is returning incorrectly in the DOM.  This would at lest accomplish the first goal of just replacing the text contents without the danger of it resizing.

function replaceText(newText){

var idsetd = charIDToTypeID( "setd" );

    var desc96 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref26 = new ActionReference();

        var idTxLr = charIDToTypeID( "TxLr" );

        var idOrdn = charIDToTypeID( "Ordn" );

        var idTrgt = charIDToTypeID( "Trgt" );

        ref26.putEnumerated( idTxLr, idOrdn, idTrgt );

    desc96.putReference( idnull, ref26 );

    var idT = charIDToTypeID( "T   " );

        var desc97 = new ActionDescriptor();

        var idTxt = charIDToTypeID( "Txt " );

        desc97.putString( idTxt, newText );

    var idTxLr = charIDToTypeID( "TxLr" );

    desc96.putObject( idT, idTxLr, desc97 );

executeAction( idsetd, desc96, DialogModes.NO );

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 14, 2015 Sep 14, 2015

Copy link to clipboard

Copied

Yes, it's one of the long lasting issues the Javascript API, basically Photoshop fails to apply transformations to the values. When you resize things you can have a transform either at the doc level or at the layer level. Also I think there was separately some issue in different behaviour of different versions with unit values. I.e. if you assign a number to .size some versions take it as pixel value and some as a point value. More problematically this behavior varies by CC version and win/mac. Here's the code I have on the topic, you have to basically retest every version (reminds I've not tested the latest).

_getTextScale: function (direction) {

  var ref = new ActionReference()

  ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

  var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('textKey'))

  //Photoshop._debugActionKeys(desc)

  if (desc.hasKey(stringIDToTypeID('transform'))) { 

  var transform = desc.getObjectValue(stringIDToTypeID('transform'))

  //Photoshop._debugActionKeys(transform)

  var mFactor = transform.getUnitDoubleValue (stringIDToTypeID(direction))

  return mFactor

  } 

  return 1

},

getTextScaleVertical: function () {

  return Photoshop._getTextScale('yy')

},

getTextScaleHorizontal: function () {

  return Photoshop._getTextScale('xx')

},

getTextExtents: function (layer) {

  if (layer && layer.kind == LayerKind.TEXT) {

  app.activeDocument.activeLayer = layer

  /*

  var ext_2015v2 = Photoshop._getTextExtents2015v2(layer)

  var ext_2015v1 = Photoshop._getTextExtents2015v1(layer)

  var ext_2014v2 = Photoshop._getTextExtents2014v2(layer)

  var ext_2014v1 = Photoshop._getTextExtents2014v1(layer)

  */

  // best results @ 2015.03.17

  if ((Photoshop.isWindows() && (Photoshop.isCC2014() || Photoshop.isCC2015())) ||

  (Photoshop.isMac() && Photoshop.isCC2012())) {

  return Photoshop._getTextExtents2014v2(layer) // better choice

  } else {

  return Photoshop._getTextExtents2015v1(layer) // backup choice

  }

  }

},

_getTextExtents2015v2: function (layer) {

  var text_item = layer.textItem

  var ref = new ActionReference()

  ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

  var action = executeActionGet(ref)

  //Photoshop._debugActionKeys(action)

  var textKey = action.getObjectValue(stringIDToTypeID('textKey'))

  var bounds = textKey.getObjectValue(stringIDToTypeID('bounds'))

  var width = bounds.getUnitDoubleValue (stringIDToTypeID('right'))

  var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom'))

  var x_scale = 1

  var y_scale = 1

  return {

  x: Math.round(text_item.position[0]),

  y: Math.round(text_item.position[1]),

  width: Math.round(width),

  height: Math.round(height) }

},

// few pixels off due to rounding error (layer bounds integer, text item bounds float), but works in CS6 also

_getTextExtents2015v1: function(layer) {

  var text_item = layer.textItem

  var ref = new ActionReference()

  ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

  var action = executeActionGet(ref)

  var textKey = action.getObjectValue(stringIDToTypeID('textKey'))

  //Photoshop._debugActionKeys(action)

  // calculate the ratio of bounding box sizes reported for the layer and text item and is at scale

  var text_bounding_box = textKey.getObjectValue(stringIDToTypeID('boundingBox')) 

  var text_bounding_width = Math.round(text_bounding_box.getUnitDoubleValue (stringIDToTypeID('right'))-text_bounding_box.getUnitDoubleValue (stringIDToTypeID('left')))

  var text_bounding_height = Math.round(text_bounding_box.getUnitDoubleValue (stringIDToTypeID('bottom'))-text_bounding_box.getUnitDoubleValue (stringIDToTypeID('top')))

  var x_scale = Photoshop.getLayerWidth(layer) / text_bounding_width

  var y_scale = Photoshop.getLayerHeight(layer) / text_bounding_height

  var width = text_item.width.as("px") 

  var height = text_item.height.as("px")

  return {

  x: Math.round(text_item.position[0]),

  y: Math.round(text_item.position[1]),

  width: Math.round(width*x_scale),

  height: Math.round(height*y_scale)

  }

},

// gives pixel perfect results when working

_getTextExtents2014v2: function (layer) {

  var text_item = layer.textItem

  var ref = new ActionReference()

  ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

  var action = executeActionGet(ref)

  //Photoshop._debugActionKeys(action)

  var textKey = action.getObjectValue(stringIDToTypeID('textKey'))

  var bounds = textKey.getObjectValue(stringIDToTypeID('bounds'))

  var width = bounds.getUnitDoubleValue (stringIDToTypeID('right'))

  var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom'))

  var x_scale = 1

  var y_scale = 1

  if (textKey.hasKey(stringIDToTypeID('transform'))) { 

  var transform = textKey.getObjectValue(stringIDToTypeID('transform'))

  x_scale = transform.getUnitDoubleValue (stringIDToTypeID('xx'))

  y_scale = transform.getUnitDoubleValue (stringIDToTypeID('yy'))

  }

  return {

  x: Math.round(text_item.position[0]),

  y: Math.round(text_item.position[1]),

  width: Math.round(width*x_scale),

  height: Math.round(height*y_scale) }

},

_getTextExtents2014v1: function(layer) {

  var text_item = layer.textItem

  var ref = new ActionReference()

  ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") )

  var action = executeActionGet(ref)

  var textKey = action.getObjectValue(stringIDToTypeID('textKey'))

  //Photoshop._debugActionKeys(textKey)

  var bounds = textKey.getObjectValue(stringIDToTypeID('bounds')) 

  var width = bounds.getUnitDoubleValue (stringIDToTypeID('right')) 

  var height = bounds.getUnitDoubleValue (stringIDToTypeID('bottom')) 

  var x_scale = 1

  var y_scale = 1

  if (textKey.hasKey(stringIDToTypeID('transform'))) { 

  var transform = textKey.getObjectValue(stringIDToTypeID('transform'))

  x_scale = transform.getUnitDoubleValue (stringIDToTypeID('xx'))

  y_scale = transform.getUnitDoubleValue (stringIDToTypeID('yy'))

  }

  x_scale *= width / text_item.width.as("px")

  y_scale *= height / text_item.height.as("px")

  return {

  x: Math.round(text_item.position[0]),

  y: Math.round(text_item.position[1]),

  width: Math.round(width*x_scale),

  height: Math.round(height*y_scale)

  }

},

getTextSize: function (layer) {

  if (layer && layer.kind == LayerKind.TEXT) {

  app.activeDocument.activeLayer = layer

  var text_item = layer.textItem

  var pixels = text_item.size.as("px")

  var scale = Photoshop.getTextScaleVertical()

  return Math.round(pixels * scale) // .size is a unit value and we want to round it first to a regular number

  }

},

setTextSize: function (layer, size) {

  if (layer && layer.kind == LayerKind.TEXT && size) {

  app.activeDocument.activeLayer = layer

  var text_item = layer.textItem

  var scale = Photoshop.getTextScaleVertical()

  var unit_val = new UnitValue(size/scale+"px")

  text_item.size = unit_val

  }

},

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

Thanks for the code.  Honestly, this is getting too complicated for me for the auto text resizing.  I decided that all I want to do is have the script replace the text content (replace characters only).  Is there a simple way to ensure that the text does not get resized and just have the script replace the text characters only?  I thought the modified script listener code that i have did that but it still has issues resizing for certain layers.

I find it difficult to believe that Adobe has left a bug like this in place that has spanned so many versions of Photoshop.  Surely they must know about this issue by now???????

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

In 2014, you have to define text by points. Pixels don't work anymore. I think this issue of not registering the pixel size goes beyond just scripting. There is an issue about saving font presets in the character panel. If the text layer is resized, it messes things up, so you can't apply the preset correctly. This has something to do with the order in which PS applies values - not as simple as it should be. This could be what is happening here too. So I've learned to never resize text by using transform. Always set the font size through the character panel or menu bar.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

Thanks for the clarification about having to use points from 2014 on.  That is good to know.  I always use the character panel myself for sizing text, changing the aspect ratio, etc.  However, the script has quite a few users.  Some of those users are buying PSD templates and they want to use the script to replace text in the templates. I have no control of what people are feeding into the script and how the text was sized or transformed before the script sees it.  I was hoping to make something that worked regardless of how the text was already sized.  However, it's to complex for me to deal with all of the possible situations and how different PS versions and OS version handle it.  I'll just need to train people to modify their templates by recreating the text layers and not transforming or re-sizing the image.

What I may look into doing is having the script determine if the text has been transformed prior.  If so, it could just alert them with a warning message.  I think that may be possible??????   I'll need to look into it some more.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

Yea, when you're dealing with other people....well, as they say, nothing is fool proof, as fools are so ingenious. I do have a script I use at work that takes a text block and sizes it according to a percentage of an images border. But that's for a whole text block and it wouldn't work if you have multiple lines of text. It just keeps things from going into the image. It was working great until 2014, when you had to use points. got if fixed up once I realized that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

I don't like working with points.............it's not intuitive.  I guess it has a purpose in printing but for everyday editing as well as scripting it's just a nuisance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

I don't either. At least they don't make us use picas also.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2015 Sep 20, 2015

Copy link to clipboard

Copied

Just relooking at this thread, and I'm pretty sure this is the way PS handles transforms. I believe Chris Cox was telling me that there is an order to how PS transforms things. PS does retain the original text setting values then add the transform values on top of that. You can see this happen if you create a paragraph preset, then transform some text and try to apply that preset. It won't use the font size you have in your preset - more or less, it will use that font then still apply the transform to the text.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 20, 2015 Sep 20, 2015

Copy link to clipboard

Copied

@Chuck I think issues is that Javascript API is a bit incomplete/broken in this. I.e. there's no (DOM) API for accessing the transforms neither at doc or layer level and it's not consistent (or documented) whether the values passed in the API include the transforms or not. And of course having different behaviour accross platforms is universally bad thing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2015 Sep 21, 2015

Copy link to clipboard

Copied

That could be too. So many things are off with the scripting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 20, 2017 Oct 20, 2017

Copy link to clipboard

Copied

I'm a bit of a hack with JSX, but I was trying to write a script to dump out text data for use elsewhere and ran into this same problem.

I came up with a function that copies the data I want from the text layer, and then creates a new text layer using that data. It then compare layer.bounds of the new and original layers, and if they are off it throws an alert. (If they match it just deletes the new layer).

function testTransforms(Object){

  test_layer = app.activeDocument.artLayers.add();                                                        

  test_layer.name = ("PROBLEM LAYER_"+Object.name);                                                                  

  test_layer.kind = LayerKind.TEXT;                                                         

  test_layer.textItem.kind = TextType.PARAGRAPHTEXT;                                                         

  test_layer.textItem.color = Object.textItem.color

  test_layer.textItem.font = Object.textItem.font;

  test_layer.textItem.size = Object.textItem.size;

  test_layer.textItem.color.rgb.hexValue = 'ff0000';//Highlight the problem layer in red.

  test_layer.fillOpacity = Object.fillOpacity;

  if (Object.textItem.useAutoLeading == false){

  test_layer.textItem.useAutoLeading = false;

  test_layer.textItem.leading = Object.textItem.leading;

  }

  test_layer.textItem.width = Object.textItem.width;

  test_layer.textItem.height = Object.textItem.height;

  test_layer.textItem.justification = Object.textItem.justification;

  test_layer.textItem.contents = Object.textItem.contents;

  test_layer.textItem.antiAliasMethod = Object.textItem.antiAliasMethod;

  test_layer.textItem.position = Object.textItem.position;

  //Check to see if the properties recorded produce the same result:

  if(test_layer.bounds[0] ==  Object.bounds[0] && test_layer.bounds[1] ==  Object.bounds[1] && test_layer.bounds[2] ==  Object.bounds[2] && test_layer.bounds[3] ==  Object.bounds[3]){

  test_layer.remove();

  app.activeDocument.activeLayer = Object;

  }

  else{

  alert(Object.name+"  has unsupported transforms. Please recreate it without transforming it.");

  }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 20, 2017 Oct 20, 2017

Copy link to clipboard

Copied

Thanks for the reply! That's clever. I'd not thought of doing that. I think I could use that same concept for what I am doing.

For my script I wouldn't want to duplicate and delete because the user sometimes has adjustment layers above the text layer clipped to the text and those could become unclipped. However, I think the same concept could be done without duplicating. Perhaps doing it this way for my script would work. It would still replace the text regardless if the resizing happened but it would alert the use that they needed to fix the template.

1. collect the bounds for the text layer

2. replace the text in the current layer with the same text that is already in the layer

3. collect the bounds again and compare

4. If the bounds match then replace the text with the new text

5. If the bounds don't match then alert the user to fix the template

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 22, 2017 Oct 22, 2017

Copy link to clipboard

Copied

Actually, when I've tried duplicating the layer (instead of making a new layer) the bad transformations still showed up in the dupe (even after changing the contents).

When I create a brand new layer (via app.activeDocument.artLayers.add()), it puts the new layer at the very top of the layer list, so it shouldn't unclip anything from the source layer. (I did a quick test and it did not). I just use a straight-forward for-loop to process through all the layers, and adding and deleting the test layers doesn't seem to mess up that for-loop either.

One thing you might want to keep in mind if your text layers have any layer styles, is to use "boundsNoEffects" instead of "bounds". That way the layer styles won't throw and error, but you can still be confident that the text itself matches.

(I use "bounds" since the platform that I'm using this text data for doesn't support anything like layer styles, so I like to be warned if the design is using them.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 23, 2017 Oct 23, 2017

Copy link to clipboard

Copied

LATEST

Thanks for the info. Also, just curious, have you seen the text sizing issue on CC at all? For me I have only seen it prior to CC. Also, on my system, I can no longer re-create the issue on CS6. I used to be able to create the issue on CS6 by transforming the text and saving the file with the transformed text. Now, when I do that, CS6 works fine just like CC.  I'm not sure what fixed it on my system.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines