Indesign Script to test Character Variants in Indesign
Sami Artur Mandelbaum
Posts: 97
Indesign is capable to access any opentype feature from a script.
Here a script to test a font with Character Variant in Indesign:
if( app.selection.length ) // do we have a selection?
if( app.selection[0].hasOwnProperty("opentypeFeatures") )
if( app.selection[0].opentypeFeatures.toSource()=="[[\"cv01\", 1]]" )
app.selection[0].opentypeFeatures = []; // reset to nothing
else
app.selection[0].opentypeFeatures=[["cv01",1]];
Copy this text to text editor and save wit jsx extension, ex: CV01.jsx.
Copy the file to indesign scripts directory.
Usually this directory in windows is: C:\Program Files\Adobe\Adobe InDesign 2021\Scripts\Scripts Panel\Scripts.
This is a simple script and You need to change the number of the "CVxx features" for every diferent "CVxx" and save with a different name.
This script is for "Character Variant 01"
Clicking one time to CVxx "On" and another to CVxx "Off".
I have test this feature using source code pro: https://fonts.google.com/specimen/Source+Sans+Pro#standard-style
I know this is a simple script but please tell me what do you think?
Regards
Sami
Here a script to test a font with Character Variant in Indesign:
if( app.selection.length ) // do we have a selection?
if( app.selection[0].hasOwnProperty("opentypeFeatures") )
if( app.selection[0].opentypeFeatures.toSource()=="[[\"cv01\", 1]]" )
app.selection[0].opentypeFeatures = []; // reset to nothing
else
app.selection[0].opentypeFeatures=[["cv01",1]];
Copy this text to text editor and save wit jsx extension, ex: CV01.jsx.
Copy the file to indesign scripts directory.
Usually this directory in windows is: C:\Program Files\Adobe\Adobe InDesign 2021\Scripts\Scripts Panel\Scripts.
This is a simple script and You need to change the number of the "CVxx features" for every diferent "CVxx" and save with a different name.
This script is for "Character Variant 01"
Clicking one time to CVxx "On" and another to CVxx "Off".
I have test this feature using source code pro: https://fonts.google.com/specimen/Source+Sans+Pro#standard-style
I know this is a simple script but please tell me what do you think?
Regards
Sami
4
Comments
-
@Sami Artur Mandelbaum Thank you! It works on my own font with CV features (Windows 8.1, Indesign CS6). I suggest to publish the script on GitHub.0
-
@Sami Artur Mandelbaum The link return error 404!0
-
I am sorry @Stefan Peev, it's my first time in Github.
Now I change the repository to public, try again, pleae.0 -
The link is OK now, @Sami Artur Mandelbaum. Thank you again!0
-
Did you mean to spell InDesign incorrectly in the GitHub URL (Indesing) and readme (Indesin)? That will make it harder to find for people searching for InDesign related content.0
-
Thank You @John Hudson, I made a correction, I hope it is right this time, the link still the same.0
-
Since the repo is a new one, I think the best thing to do would be to rename the repo, which will fix the URL and the reference. You can rename a repo by going into the settings.0 -
I made a change in readme.md, I hope is right this time.
It really hard for me making changes in Github.
Sami0 -
Well, the spelling in the readme is now incorrect in the same way as in the repo name and URL, so I suppose that is a kind of consistency.0
-
I've made a second Indesign script with a prompt.
Now You can digit the number of the Character Variant (always 2 algarisms) in your text selection.
To remove the feature click again and digit "00" or remove the numbers.
It is still a very simple script but now You don't need to create a script for every Character Variant feature number.
New link:
https://github.com/samiartur/Character-Variant-Java-Script-for-Indesign
Please let me know what you think.
Sami2 -
@Sami Artur Mandelbaum It works. Thank you!0
Categories
- All Categories
- 40 Introductions
- 3.7K Typeface Design
- 796 Font Technology
- 1K Technique and Theory
- 615 Type Business
- 444 Type Design Critiques
- 539 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 482 Typography
- 301 History of Typography
- 114 Education
- 67 Resources
- 495 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 162 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports