Can't change font size properly

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

3db

Can't change font size properly

Post by 3db »

Howdy !!
I open this topic due to problems I have for more than a month, to summarize I wrote a script that retrieves data from a csv file and processes a psd file

first problem:

when I change the font size of a text the value is always applied in Pt
-if I change preferences in pixels, same thing
-if I apply the value with UnitValue, ex Lay.size = UnitValue (10, "px") the result displayed is 6.94px !!
I think I've tried everything to no avail

2nd :

& I want to know if it is possible to assign the name of fonts displayed in photoshop, eg for font 'Arial' we are obliged to write 'ArialMT' and not 'Arial', it's annoying to find the name of each are especially if we must use multiple fonts (more than twenty), especially if the script is written to a third person (I do not know the fonts it uses)

3rd :

I can't find the property Superscript or Subscript of TextItem but I founded nothing in the documentation neither on forums !

sorry for my English !! & thanks

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

pfaffenbichler

Can't change font size properly

Post by pfaffenbichler »

1) What is the problem there?
Why do you not want to use points?

2) I don’t know if one can set the font by fontName instead of fontPostScriptName via Action Manager code.
»textStyle« of »textStyleRange« of »textKey« of a Layer has a key for both – but using that for creating Type Layers might be pretty cumbersome.
Key 0 = styleSheetHasParent: DescValueType.BOOLEANTYPE
Key 1 = fontPostScriptName: DescValueType.STRINGTYPE
Key 2 = fontName: DescValueType.STRINGTYPE
Key 3 = fontStyleName: DescValueType.STRINGTYPE
Key 4 = fontScript: DescValueType.INTEGERTYPE
Key 5 = fontTechnology: DescValueType.INTEGERTYPE
Key 6 = size: DescValueType.UNITDOUBLE
Key 7 = syntheticBold: DescValueType.BOOLEANTYPE
Key 8 = tracking: DescValueType.INTEGERTYPE
Key 9 = baselineShift: DescValueType.UNITDOUBLE
Key 10 = fontCaps: DescValueType.ENUMERATEDTYPE
Key 11 = digitSet: DescValueType.ENUMERATEDTYPE
Key 12 = markYDistFromBaseline: DescValueType.UNITDOUBLE
Key 13 = baseline: DescValueType.ENUMERATEDTYPE
Key 14 = textLanguage: DescValueType.ENUMERATEDTYPE
Key 15 = color: DescValueType.OBJECTTYPE

What do you use the Script for, if I may ask, that it needs to use 20 fonts?

3) The key »baseline« in the Action Manager code carries that information.
But again: Creating (or editing) Type Layers with AM code may be uncomfortable.

Hopefully one of the more experienced contributors will drop by.
3db

Can't change font size properly

Post by 3db »

Hi, thx for the answer
1) I would like to switch between the two units (depends on my needs)
but when I use the script "TextTest.jsx" included in X-tools, units are entered in pixels and validated in pixels !! , but where is the problem?

2)J'utilise maintenant le script FontLister qui est pratique
yes I use a lot of fonts

3)I faced with a problem, to edit a single layer of text with multiple fonts and font sizes the only solution is the function "TextStyle" included in "TextTest.jsx" ?

thx