Sizing of conditional font for a text Overlay on Photo

The size of the photo is 640 pixels x 800 pixels. I can get the script working on the 9-point font, but not if the bunk is too long without resizing the police.

Here are the main parameters of the initial script I prepared.

var originalRulerUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.PERCENT;

var docRef = activeDocument;

var myLayerRef = docRef.artLayers.add ();

myLayerRef.kind = LayerKind.TEXT;

myLayerRef.name = "Filename";

var myTextRef = myLayerRef.textItem;

Set the size of the font in Points (may vary according to the length in characters)

myTextRef.size = 9;

myTextRef.font = "Arial";

Text color to RGB values

newColor var = new SolidColor();

newColor.rgb.red = 255;

newColor.rgb.green = 255;

newColor.rgb.blue = 255;

myTextRef.color = newColor;

Set the position of the text

myTextRef.position = new Array (50, 96.875);

myTextRef.justification = Justification.CENTER

Set the blending Mode of the layer text

myLayerRef.blendMode = BlendMode.NORMAL;

Opacity in percent

myLayerRef.opacity = 100;

The length of the text is based on a variable "Pnom" (concatenation of first name and surname of a database) that is written and stacked in the lower part of the photo must be a single line.

This is an example of 9 points as the default font size.

Here are the conditions, I don't know how to do:

1. If the number of characters is less than 40, then use fonts of 9 points;

2. If the number of characters is 40 to 50, then use 8 point fonts.

3. If the number of characted is 51 and more, then use fonts by 7 points.

Thanks in advance.

You could try a switch clause:

switch (true) {
          case (myTextRef.contents.length < 40):
          myTextRef.size = 9;
          break;
          case ((myTextRef.contents.length >= 40) && (myTextRef.contents.length <= 50)):
          myTextRef.size = 8;
          break;
          default:
          myTextRef.size = 7;
          break;
          };

Tags: Photoshop

Similar Questions

  • Change the default font for the text added to the files PDF - wire II

    Is there anyone who knows how to change the default font for the text added in the use of tools. Content | Change the text of the Document? If so, would it be possible to post a reply to the thread located

    http://forums.adobe.com/message/6219252#6219252, who has not yet received all the answers?

    Thank you very much

    Unfortunately, it is not possible to set the default font for the tool add text beneath the editing of content in Acrobat XI Panel, but it would be a great feature request.

  • Definition of default font for the text box in Acrobat XI

    Projects that I am working, I scan in all copies of documents I acquire and add at the bottom of the first page of the relevant information, that is, the source of recordings, volume, and page, using the tool text box (or typewriter).

    In earlier versions of Acrobat, I could choose a font style once and it has carried over to any subsequent document, I proceeded. In Acrobat Pro XI, it always happens as Minion Pro and I need to change in Arial Black every time. Is there a way to define Arial Black as the default choice for the text box?

    For what it's worth, I use Windows 8.

    Thank you.

    I came across a work-around for this for Acrobat Pro XI.  It is a process in two steps and a little heavy, but it works.

    First, go and add your text box and everything what you need text.  After having done that, select all the text, then bring up a bar of properties of the text box text by placing your cursor in the toolbar area and select 'Properties Bar' top of the page, right click or simply press Ctrl + E.  The properties of the text box bar will appear (floating, but not all the time).  Let the selected text, and then change the font properties to what you need.

    Secondly, deselect the text, select the border of the text box, make a right click and then select "Make current properties default" in the pop-up window.  FYI, the property bar to the box text will be changed from a floating real estate bar at this time, so if you need to make more detailed changes, simply close the bar and back to Ctrl + E to call upwards and make other changes.

    I use Windows 7 64-bit.

  • Does not allow me to choose among all the fonts for adding text

    Im running windows 8 and I want to add text to my video, but when I try to change the font, it won't let me see the whole list to select or scroll. It's only showing me what can fit on the screen

    Donaldo234

    What version of Premiere Elements you use on Windows 8 supposed 64 bit?

    And where you are when you want to change the font

    a. in the first item editor opens the module of titration

    or

    b. other?

    For example, the following is first elements 11 Editor (Windows 7 64-bit) and the open titration module, Section of text.

    Have you been there and done that?

    If you have and the problem persists, please give more details. The answers should be in the details.

    Feel free to ask questions or seek clarification on the above.

    Thank you.

    RTA

  • the font for Normal text size

    I'm working on an HTML Help system that uses a standard theme template and style sheet. I use a style called 'Normal' for most of the text. The police is currently being Verdana, Regular, size Small, which is very nice for my old eyes. However, I notice that it is so great that the fonts used in other online help systems (for example, online help for RH6). I tried to move to the X-small size, but it is much too small. After a little experimentation, Verdana 11 points looks all right, at least on my screen. My question is this: what is the difference between the system of small-medium-large to measure fonts and the fonts measurement points system? Font sizes appear differently on different monitors of size and resolution? And is there a rule for what font size is the most readable? (I'm familiar with it for printing, not so much for online.)

    Thank you, Ben. I went on the website of W3C and got some good information. Sounds like it is preferable to use the xs, sm, m, l, xl font sizes, because users can automatically adjust these by selecting their "privileged" font size (in IE, select the size in the menu of the Page). Font style in pts not resize when the user changes its settings.

    I'm still not convinced that I have the right answer, though. There are so many variables to consider (size screen, resolution, type of browser, the browser settings) compared to the good old print WYSIWYG...

  • What controls the size of the font for the text of the "Table of Context"?

    Hi people,

    I know it's a small thing, but I can't. How adapt you or change the size of the police especially for the label "Table of context" in the table of contents. Bad code is based on the skin or it's adjustable. Great-completely any help appreciated!

    See you soon

    Steve

    Skin editor > TOC settings > TOC Information.  There is a drop-down list that allows you to set the formatting for several different parts of the TOC.

  • AppleScript cannot change the font of the text layer

    I used Applescript to create a text layer and specify its properties, but when I specify the font I get a compilation error:

    Impossible to define 'class NTR' to 'TradeGothic-Bold ". Unauthorized access.

    That sounds like a kind of permission error.

    Here is a little simplified script:

    Tell application "Adobe Photoshop CS4"

    say current document

    do new layer of art Properties {name: "File name", type:text layer}

    say the text object layer of art 1

    the value {content, size, stroke color, position, type} {"thefilename", 12, {class:RGB hexadecimal color, hexadecimal value: 'CC0000'}, {2, 12}, text of paragraph}

    set the font to "TradeGothic-"BOLD""

    tell the end

    tell the end

    tell the end

    If I put the police manually and use 'get properties of the text object in layer art 1', the Script Editor returns (with a long list of other properties):

    "" police: 'TradeGothic-"BOLD".

    so I think that I've specified the name of the font correctly at least. In the list of properties returned by the Script Editor, the font is blue like above, but all other property names are purple. It's I have to say something.

    Well, after some trial and error, I answered my own question. Here's what worked:

    Tell application "Adobe Photoshop CS4"

    tell the active document

    new layer art with properties {name: "File Name", layer type: text}

    the text of the layer 1 of the art of storytelling

    the value {content, size, stroke color, position, type} {"thefilename", 12, {class hex color: RGB, hex value: 'CC0000'}, {2, 12}, paragraph text}

    tell the end

    set the font for the text of art layer 1 to "TradeGothic-"Bold"object

    tell the end

    tell the end

    Maybe someone who understands OOP and/or better than I do, may explain why it worked and my first try didn't.

  • How to set up make-style for the text box in the apex.

    Hi all

    I created a text box in the apex and now I'm changing the font for that text box style and I applied here like this is this correct one or any suggestions on this.
    --
    HTML Form Element Attributes: style="font-family:Arial;font-style:Regular;
    The apparoach is the right one or not.
    {code}
    
    
    Thanks,
    Anoo..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    David wrote:

    I created a text box in the apex and now I'm changing the font for that text box style and I applied here like this is this correct one or any suggestions on this.

    --
    HTML Form Element Attributes: style="font-family:Arial;font-style:Regular;{code}
    The apparoach is the right one or not.
    

    N ° attribute is missing a quote from endpoint, and "Regular" is not a valid value for the http://reference.sitepoint.com/css/font-style">make style property.» Valid values are normal | italic | oblique as shown.

    Also, it is recommended to specify a default value of generic downturn at the end of the specifications of font family :
    {code}
    style = "do-family: Arial, Helvetica, without serif;" make-style: normal; »
    {code}
    (There's really no need to ask such questions icies and waste of time to wait for answers: to bookmark a good reference CSS like Sitepoint link above or the http://www.w3.org/TR/CSS21/#minitoc"> W3C CSS specification and refer to them as needed.")

  • How do you define the default font size and color for the text caption and text boxes?

    When I click CTR + e to open the text properties box when you are working with markup tools, the default font size is 9.

    I understand how to change the font size for the individual text boxes but the size is up to 9 whenever I create a new box.

    Is there a way to set a default font for brand boxes place size? I spent hours searching and have not found one.

    This problem appeared only with the latest version of Acrobat Reader DC (15.017.20050).

    Any help would be greatly appreciated.

    Thank you

    Andrew

    Hello

    We have released an update today that solves the problem to "default properties" and parameters are now sticky. Please open Acrobat or Reader DC and visit help > check for updates to ensure that you are on the latest patch.

    Details on the release: https://helpx.adobe.com/acrobat/release-note/acrobat-dc-august-02-2016.html

    Please let us know how it goes.

    Thank you

    -ashu

  • How can I change the size of the font for the comments/text call out boxes?

    How can I change the size of the font for the comments/text call out boxes?

    Hey sylviec10386621,

    Once you add any call box, select this option and press (Ctrl + E) to open its properties.

    Try this at your end and let me know how it goes.

    Kind regards

    Ana Maria

  • Flash professional help | Embed fonts for the appearance of the text consistent

    This question has been posted in response to the following article: http://helpx.Adobe.com/Flash/using/embed-fonts-consistent-text-appearance.html

    Simply apply the same weight/family/font style of fonts for each textfield.  Flash will be only once incorporate police.

  • Fonts for the instructions to the legislation

    Hello

    I'm working on a new document and given some options for fonts. The document is a guide to the legislation, so I want the look and feel of compare the legislative text.

    The guidelines are there to support the drive, in order to guide them in the legal conditions in a clear and concise manner.

    I want to assure you that the document is accessible and easy to read. It is unlikely that a reader can read from beginning to end. They are more likely to dive in and read some sections.

    In the previous guidelines we used Myriad Pro or Verdana for body text and Hypatia without heads. However, in this case, I am considering a wheelbase for the body, such as Warnock or Garamond. While these policies help to make the document more readable, I fear that this may make the guidelines seem more serious and less accessible.

    So, Serif, serif GOLD for this type of document.

    I would be grateful for suggestions.

    Thank you

    Niall

    Niall,

    It may be too close in this case, but you will notice that it is a little less tiresome/boring. In this context, it matters little whether you again.

    Always thinking.

    Edit:

    To the contrast and readability, you should consider some of the more readable (but very different) without fonts Verdana, Helvetica, myriad, Futura or a very different serif font like Century Schoolbook (as you probably know, Arial is simply a euphemism for false Helvetica).

    To decide, you can put a text (the full keyboard letters or a relevant text element) in a word processing application at the time, and then repeatedly copy and change the police, until you like what you see in comparison. With each new piece of selected text, you should be able to run through the fonts and see it happen, and then select font, create a new copy and go. When you reach the bottom, you can compare, delete and move about, until you're there.

  • IMAQ text overlay, then Writfile in the right size

    Hello

    I use IMAQ to display an image, and then I want to draw lines by using the KING and text overlay, before exporting it as a jpg or bitmap.

    Please take a look at the façade attached jpg.  It shows a part of my image of front panel and I drew a KING of the line next to the line, I added text.  It looks great.  But when I use IMAQ write file 2 or IMAQ Write queue, then the KING and the cache are not correct.  Please look at the OverlayLV - you can see the line type (only now it is green), and the text is really tiny.

    Thanks for any help!

    Steve

    Hi all

    I thought about it.  Before adding the KING and overlays, I had to re - sample the image to the size of my IMAQ indicator.

    Steve

  • Looking for the text of the "Microsoft Shared Source License Version 1.0 for Windows CE"

    Hello

    I am looking for the text of the "Microsoft Shared Source License Version 1.0 for Windows CE".

    With the help of Bing or Google gave the text of this license.

    I am looking for the text of the license, because I have a piece of source code that has the following file header and I would like to know what are the exact conditions for the use of this source code.

    //
    Copyright (c) Microsoft Corporation.  All rights reserved.
    //
    //
    This source code is under the Microsoft Shared Source license
    Version 1.0 for Windows CE.
    For a copy of the license, visit http://go.microsoft.com/fwlink/?LinkId=3223.
    //

    Unfortunately, the link is dead.

    Kind regards
    Mark

    PS: Yes, I know that my question is not a perfect match for this forum but the Microsoft Ribha Customer Service Representative (manager is Lalita) recommend to post my question here.

    The license can be found here:
     
     
     
  • How to permanently change the font for all emails color

    How can I change the color of the font for all my emails constantly?

    E-mail address is removed from the privacy *.

    Hello Msmouser,

    What mail client do you use?
    If you use Outlook, I suggest to look at this article:
    If you use your web mail from Verizon, I would say that to visit the Verizon Mail support page:
    If you use Windows Live Mail, please visit:

Maybe you are looking for

  • upgrade to ios 9.3 error

    I have an iphone 6 and before the error 53, today I tried to update to ios 9.3 and get an error, I don't want to do the update with the cause of the computer I'm afraid that my iphone will get again in brick, so I'm hopping apple realizes issue and l

  • Can satellite C655 - I use a vacuum cleaner to clean the fans?

    Hello- I have a Satellite C655 I bought and a year and a half ago. In recent days the fan was shot in a lot more than usual. I hear the fan or fan on the left - the quietest, one on the right is always quite calm and on. I'm not under any big program

  • How to clean the fan on the Satellite A100-153

    Hello First of all, my warranty on this laptop is expires.My laptop runs hot and that's why I want to clean my fan module.Where can I find documentation, how do I open up my laptop? I despaired of m, because I don t find anything in the WWW. I hope t

  • How to use my TV as a monitor extra?

    Original title: TV as additional monitor I want to get the same signal on my TV and the monitor. I connected a cable audio-video VGA with a DVI to VGA adapter to my computer and the other end to the PC on my TV input. I get no signal. When I connect

  • Windows Live Mail error 0x800CCC92

    I have a problem with my Windows Live Mail with pop-up and OX800CCC92 error code... impossible to send or receive electronic mail.  How can I fix this error? [Original title: Windows Live Mail error]