Get the old value of font size of the text after resizing the image.

Hi all

I write the script to get the size of the font of the text layer. I'm old font size after resizing the image.

Here are the steps:

-I write the function to get the property of the selected text layer...

getInfoOfText = function (textLayer)

{

........;

var textItem = textLayer.textItem;

fontSize var = textItem.size;

.........;

}

-After image resize 50%. I am executing this function.

But I get always the old value of font size.

Let's say that the size of the font of the text = 36 px.

Now I apply Image resize 50%. Thus, the size of the font of the text becomes 18 px.

Now, if I run the 'getInfoOfText' function, I get always 36 px.

I can't understand the behavior. Am I missing something here? Is it possible to get the correct font size value?

Please note that I use the CS6 version.

Waiting for your help guys.

Thank you

It seems that there is a BUG in CS6 and CC with transformed text, here is a function of http://www.ps-bridge-scripts.talktalk.net/

function getFontSize(){
if(app.version.match(/^\d+/) < 13) return activeDocument.activeLayer.textItem.size;
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('textKey'));
var textSize =  desc.getList(stringIDToTypeID('textStyleRange')).getObjectValue(0).getObjectValue(stringIDToTypeID('textStyle')).getDouble (stringIDToTypeID('size'));
if (desc.hasKey(stringIDToTypeID('transform'))) {
            var mFactor = desc.getObjectValue(stringIDToTypeID('transform')).getUnitDoubleValue (stringIDToTypeID('yy') );
    textSize = (textSize* mFactor).toFixed(2).toString().replace(/0+$/g,'').replace(/\.$/,'');
    }
return textSize;
};

Tags: Photoshop

Similar Questions

  • change font and font size in all text fields

    Hi, I want to change font and font size in all text fields. I tried under the code, but it changes the font size but has not changed the font. can u pls help me. Thank you...

    Police - Courier New

    the size of the font - 10

    Loop through the fields in the document

    for (var i = 0; i < numFields; i ++) {}

    Get a reference to the current field

    var f = getField (getNthFieldName (i));

    Change the properties of certain types of fields

    {Switch (f.type)}

    case 'text ':

    f.textFont = fonts. Courier New;

    f.textSize = 10;

    }

    }

    You have a good reason to want to use Courier New instead of the built-in Courier font? In all cases, you must change one line to:

    Use the built-in font Courier

    f.textFont = fonts. Court;

    -or-

    Use the Courier New

    f.textFont = "CourierNew;

  • I'm editing in the bright room of Adobe and when I change in the develop module, I get the image I want, but when I see in the library module in its final State, it changed and degraded. Why is this happening?

    I'm editing in the bright room of Adobe and when I change in the develop module, I get the image I want, but when I see in the library module in its final State, it changed and degraded. Why is this happening?

    The difference between the raw edition photo and editing a PSD is that the PSD has black points and white pinned to the visible pixel values, the raw photo has still "headroom" with values of pixel darker than black visible and brighter than white, so when you export the raw file , there may be details that have improved (or obscured if it was another type of image) of the perception and mapping of the Compensation of the black spot on the final color profile.

    This means not PS is better or LR is lower, it is enough for you to go to a different type of image.  If you don't have PS to do final Assembly, you can probably do the same thing by exporting the raw in a 16 bit ProPhotoRGB TIF file, re-import this TIF and then set it LR, possibly using the tone curve to make the pitch black dark areas.

  • I have my Dell XPS HDMI cable to my Sony Bravia TV / I get the image on the TV but the sound from the laptop

    I have my Dell XPS HDMI cable to my Sony Bravia TV / I get the image on the TV but the sound from the laptop

    Thank you.  I had to go to the sounds and have speakers/headphones to HDMI it didn't work at first but founmd you need to have the TV and the computer.

  • How can I get the image of the Web page when my mouse over the icon in the taskbar?

    I used to get the image of some Web pages I look at one when I spent my mouse on the browser used in the taskbar, now, I only get the Scripture that says what pages are open, how to get back the images? It facilitated visually for me to see.

    Hello

    Are you referring to the feature Aero Peek in Windows 7?

    You can use Aero Peek to take a quick look at other open windows without clicking away from the window you are currently working. For more information, see Preview an open window on the desktop using Peek.

    You may experience this problem if PEAK Aero is disabled on the computer.

    If you can not see the effects of glass window, or if you are unable to use Aero Peek and Aero Shake, use the Aero troubleshooting tool to diagnose and fix the problem automatically.

    Solve problems Aero in Windows 7

    http://support.Microsoft.com/kb/976170

    You can also go to the Control Panel - Performance and options (find it by typing in the search box) - and set for the "look better".

    I hope this helps. If you need help with Windows, let us know and will be happy to help you.

  • With the help of LR4 with Windows 8 - impossible to get the images to desempilement.

    Using LR4 with Windows 8 - impossible to get the images to desempilement.

    Right click on the picture, select stacking, select Unstack

  • Cannot make the fx color correction without getting the image of strobe

    Cannot make the fx color correction or blur fx with masks without getting the image to strobe. Do not return in the sequence, or export without the video strobe effect. It is clearly a problem since at least 2011 because I saw some forum posts dating back that far. Don't know how or why it is always a question 5 years later. I have the correction color fx on an adjustment layer that makes very well. Leave color and blur fx on a couple of individual clips is whats creating the problem. Does anyone have a solution? It does not appear that I can wait for Adobe.

    At this point, I would create a sequence for each clip (in the garbage, make a right click, create sequence and apply the FX it) then replace the clips in the mixture with the sequences.  -Test this point by one before they go crazy.

    OR, using the idea of sequence preceding above, return on a new clip with holiday color applied to replace as new originals in the mixture.

    Third idea: replace the clips with linked AE comp and try the color of leave which are.

    In short, do what you can to take the color of leave out of the final equation.

  • I can't upload an image under license. I always get the image in low resolution. How to solve the problem?

    I can't upload an image under license. I always get the image in low resolution. How to solve the problem?

    Follow these steps to download or save in the library: I downloaded my 10 free images and they all have the Adobe watermark on them, so I can't use them. Why do they have a watermark on them?

  • I am new to Adobe Stock.  An Adobe stock image is usable like a Facebook profile picture?  My concern is that the image profile can saved by other users of Facebook... so they can get the image without having to pay Adobe for it.

    I am new to Adobe Stock.  An Adobe stock image is usable like a Facebook profile picture?  My concern is that the image profile can saved by other users of Facebook... so they can get the image without having to pay Adobe for it.

    Hi martyc98498222,

    I suggest you to use the Image of Adobe Stock for social media, also you can refer to the following document: https://helpx.adobe.com/stock/faq.html#Adobe%20Stock%20usage%20and%20licensing

    Kind regards

    Tanuj

  • Want to change the WordPad default values for font size and line spacing

    I use WordPad quite heavily because it is simple and fast.  But the new version of W - 7 seems to not allow you to change the default values for the font, size and line spacing.  The default values are not suitable for a large part of what I do and I'd like to find a way of quickly and easily, either make the changes permanent or change this to open with a single click of mouse or at most two.  Any suggestions?

    It is the "best" solution to workaround.  After you change your Default.rtf custom, simply move it to your system32 directory and add the "Default.rtf" at the end of the location of your target on the property sheet for your file WordPad.exe.

    Every time that you open its default location in the directory c:\program files\windows NT\Accessoires WordPad.exe, it defaults to now your Default.rtf custom.

  • Can't get my larger than .9em font size?

    I use some CSS in an external worksheet to control certain text slogan and I try to make the text bigger, but when I increase the font size of the values above .9em seems to make the text smaller?

    {#tagline}

    margin: 1px 0 15px 10px;

    font size: .9em;

    letter-spacing: 0.6em;

    make-weight: bold;

    1. what font size is greater than .9em?

    2. is there a heavier weight "BOLD" I can use here?

    Thank you!

    mediafred wrote:

    1. what font size is greater than .9em?

    Anything higher than 0.9em for example, 1em, 2em etc.

    mediafred wrote:

    2. is there a heavier weight "BOLD" I can use here?

    Fonts can be specified in words ("BOLD", more "BOLD") or numbers (100 to 900).

    http://www.w3schools.com/cssref/pr_font_weight.asp

  • change /-the font size of a text field on master pages is not possible? (field prop)

    Hello

    I would like to change the font and the font size of a textfield on a master page.

    I wonder if I did anything wrong, because font options (size, fonts, etc.) are simple grayed out / not available, when I click on my text field.

    Apparently, there is a way to customize the font properties of a textfield (only) on the master page.

    Well, I guess it would work with java script in the event init... but really, why the hell it should not possible just use properties/text properties?

    Please correct me if I'm wrong. I'm doing something wrong, or is it really not possible to customize the police of a text field on master pages?

    Import you the form in the designer?

  • PDF FORMS - can you assign a font size of a text field greater than 300pt?

    I create forms PDF from InDesign so that a customer can use as a model for in-store signage. It must be a PDF file so that one of their stores can simply change the wording of the text and print it. For smaller signs, I didn't have a problem, open the form in Acrobat and adjusting the text field properties to suit design styles I prescribed. But on signs largest where they must be legible from a distance, I can't get the size of the font to work above 300. For one of the signs I need the police to be as big as 930.

    Does anyone have a solution for this? Is there a way I could use a script to adjust the font size.

    Whatever the solution is, it should be ready to print.

    Thank you.

    Yes, you can use a script, something like:

    Change the font size of a field

    getField("Text1").textSize = 930;

    but replace "Text1" with the actual name of the field. You can run this in the JavaScript console interactive, or of the mouse event to the top of a temporary button.

  • Could not get the image format to fill screen TV is set to 16: 9 all other devices to fill the screen

    I can't get the picture size to fill the screen. The TV is set to 16: 9 and all other devices to fill the screen.

    Thanks for any suggestions that might help solve this frustrating problem.

    Welcome to the Apple community.

    The devices on which you are talking about, are you using AirPlay.

  • How to get the image similar to others?

    Hi all

    I am very new to PS, so always try to find my way. I needed to change the image on the left on the home page of my company. All I could find was a free picture that has been coloured, so I enlarged and makes B & W. However, the hair is too dark. The other pictures seem to have a sort of gray or softness on them, even if some people are too Brown. It doesn't have to be perfect, the main thing was to get rid of the old image.  But how can I get the first image to look more like the others?

    Thank you

    see you soon

    Donna

    http://www.Ostara.org.au

    Hello again once, Donna,

    I don't know what you're asking.  I just did what I mentioned above: Image - adjust - curves, then I manipulated the black point and curve a bit so he could look right.  You could refine the result with sharpness, or look online for more sophisticated sharpening devices.

    -Christmas

Maybe you are looking for

  • When I try to print a page, I get the entire page of very low, either I get only part of the page. Which setting I'm missing?

    I am trying to print a page of a web page. If I check, 'reduced to fit' print / page setup, I get the whole page but small enough to be useless. If I uncheck 'reduced to adjust', I get only about 1/3 of the page. I tried the % function, and it only c

  • What to do now؟؟؟

    Too many attempts were made to enter your information. Try again later. Answers to security questions are incorrectly entered because I forgot What to do now؟؟؟

  • Password required power

    Hello I have a problem when I start my Hp Pavilion Admin password or power supply necessary system to disable the key: 98735144 after 3 attempts Could you please help me find a solution? Sorry if I made any mistakes in writing, I'm an old french man.

  • Live Search has stopped working

    Since a few days ago Live Search has stopped working on my HP almost nineI type in a phrase, the icon 'search' is displayed for a few seconds then this 502 bad gateway (tab)Incorrect gatewayThe proxy server received an invalid response from an upstre

  • Establishing internet Layer 3 switch

    How can I set this up and y at - it a document can I refer too.