Photoshop: OpenType Number Features: Proportional, Tabular, Lining, and Oldstyle

  • 9
  • Idea
  • Updated 7 months ago
  • Under Consideration
  • (Edited)
A feature that has been sorely missing from Photoshop since the implementation of its OpenType capabilities is the ability to specify which number features to use. This feature is fully implemented in InDesign and Illustrator so it's puzzling that it would be missing from Photoshop.
Photo of Seth G

Seth G

  • 4 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 9
Photo of michaelgolus

michaelgolus

  • 1 Post
  • 3 Reply Likes
+ 1. I've run into this countless times when working on web and interface mockups.
Photo of Marcel Münchow

Marcel Münchow

  • 3 Posts
  • 6 Reply Likes
+1000
Illustrator does support these OTF features. Why can ́t Photoshop do so?

(Edited)
Photo of Marcel Münchow

Marcel Münchow

  • 3 Posts
  • 6 Reply Likes
Here is a small photoshop script (tested with CC2017) for setting the figure style:
function setStyle()
{
    var docRef = app.activeDocument;
    var actLay = docRef.activeLayer;

    if(actLay.kind == LayerKind.TEXT){
      var textItem =  actLay.textItem;

      var idsetd = charIDToTypeID( "setd" );
          var desc79 = new ActionDescriptor();
          var idnull = charIDToTypeID( "null" );
              var ref8 = new ActionReference();
              var idPrpr = charIDToTypeID( "Prpr" );
              var idTxtS = charIDToTypeID( "TxtS" );
              ref8.putProperty( idPrpr, idTxtS );
              var idTxLr = charIDToTypeID( "TxLr" );
              var idOrdn = charIDToTypeID( "Ordn" );
              var idTrgt = charIDToTypeID( "Trgt" );
              ref8.putEnumerated( idTxLr, idOrdn, idTrgt );
          desc79.putReference( idnull, ref8 );
          var idT = charIDToTypeID( "T   " );
              var desc80 = new ActionDescriptor();
              var idfigureStyle = stringIDToTypeID( "figureStyle" );

              //Tabular
              var idStyle = stringIDToTypeID( "tabularLining" );

              //Normal
              //var idStyle = stringIDToTypeID( "Nrml" );

              //proportionalOldStyle
              //var idStyle = stringIDToTypeID( "proportionalOldStyle" );
              desc80.putEnumerated( idfigureStyle, idfigureStyle, idStyle );
          var idTxtS = charIDToTypeID( "TxtS" );
          desc79.putObject( idT, idTxtS, desc80 );
      executeAction( idsetd, desc79, DialogModes.NO );
      textItem = null;
    }
    docRef = null;
    actLay = null;
}
setStyle();

Just comment/uncomment the figure style you need (Tabular, Normal, proportionalOldStyle). It is not comfortable, but usable.
Photo of Gustavo Cardoso

Gustavo Cardoso

  • 2 Posts
  • 1 Reply Like
Marcel!

Huge thanks for the script. It works just fine for me, and yet the best solution i've seen! :)
Photo of Daniel Angel Jimenez González

Daniel Angel Jimenez González

  • 1 Post
  • 0 Reply Likes
Hey, I have never run a script and I've been searching for more than a day already on how to make this thing work without being able to. Any ideas? What do I have to do?
Photo of Marcel Münchow

Marcel Münchow

  • 3 Posts
  • 6 Reply Likes
https://www.creativebloq.com/photoshop/scripts-4132441
Step 1 as described in the link above. (Make your own script / Step 01): Open a texteditor.

Step 2: paste the complete code above. Please include also the line „setStyle();“. Otherwise the function is only defined and not called.

Step3: Save the document as typeSetStyle.jsx e.g. to your dashboard.

Step 3: as described in the blogpost:
In Photoshop, open a document you’re working on. Select File > Scripts > Browse and locate your script [--> typeSetStyle.jsx ].

-----

If you want to set the typesettings to Tabular use this code

//Tabular
var idStyle = stringIDToTypeID( "tabularLining" );
//Normal
//var idStyle = stringIDToTypeID( "Nrml" );
//proportionalOldStyle 
//var idStyle = stringIDToTypeID( "proportionalOldStyle" );
-----

If you want to set the typesettings to Normal use this code

//Tabular
//var idStyle = stringIDToTypeID( "tabularLining" );
//Normal
var idStyle = stringIDToTypeID( "Nrml" );
//proportionalOldStyle 
//var idStyle = stringIDToTypeID( "proportionalOldStyle" );
-----

If you want to set the typesettings to OldStyle use this code

//Tabular
//var idStyle = stringIDToTypeID( "tabularLining" );
//Normal
//var idStyle = stringIDToTypeID( "Nrml" );
//proportionalOldStyle  var idStyle = stringIDToTypeID( "proportionalOldStyle" );