Skip to main content
Bedazzled532
Inspiring
September 12, 2024
Answered

Kasheeda Justification on selected character / text only

  • September 12, 2024
  • 2 replies
  • 1888 views

I am trying to achieve to put Kasheeda on selected character only. In fact, I ahve kasheeda enabled in paragraph style. Some characters are not looking good in kasheeda so I thought of removing kasheeda from that characters or use some other kasheeda. Indesign gives an option. If I change kasheeda from drop down, it changes in the whole paragraph and not the selected characters.

 

Is there a way to achieve that using script or Character styles ?

 

Here is the text

اسمہ اسلام اباد، یایہا الناس اجتنبوا الكذب

 

Here is the code I have written to apply character style BUT I do not know how to control that drop down.

I have attached a screenshot and IDML file also.

 

Here is the code written to apply character style:

var characterStyleName = "Kasheeda";
var mySelection = app.selection[0];
    if (mySelection.length == 0) {
		 alert("Please select some text first.");
	}
	else {
        // Check if the character style exists in the document
        var charStyle = doc.characterStyles.itemByName(characterStyleName);
        if (charStyle.isValid) {
		
			//Modify Character Style here to add or remove kasheeda
			
            // Apply the character style to the selected text
            mySelection.applyCharacterStyle(charStyle);
            alert("Character style applied successfully!");
        } 
		else { 
			alert("Character style '" + characterStyleName + "' not found."); 
		}
    }

I have used "body" paragraph style.

In the attached image, say I want to remove kasheeda (marked with red square) of 2 and 3rd box in the text. I want to either make it "none" or "short" or "medium" or "long". It is driving me crazy.

 

Thanks.

This topic has been closed for replies.
Correct answer Bedazzled532

Downloaded the .idml and it looks like neither traking or kerning are going to work. Horizontal scale can be applied but it is not acceptable as it scles the stroke as well. Kasheeda seem to be a combining form of some sort in the character.

So unless someone else who works in arabic has a bright idea, I think the GREP Style idea is a non-starter.


@Robert at ID-Tasker @Peter Spier 

Seems like there is no solution to it. Will have to do it manually as kasheeda width option is not there in character style.

 

There are 4 types of kasheeda width and it needs to be applied as per the space available. It would have been much easier with character style so that it can be controlled later if any modification is required.

 

Kasheeda can be selected using ~W in grep but only if it is applied manually. Shift + 6 is the keyboard shortcut to apply kasheeda (Tatweel Unicode u0640) using urdu keyboard.

 

I thought scripting might help but looks like it is not possible with scripting as well.

 

Anyway, thanks to all of you.

2 replies

Brainiac
September 14, 2024

Variable Fonts to the rescue?

 

Trying to understand kashida, I came along this ongoing discussion.

https://github.com/googlefonts/axisregistry/issues/77

 

It will be interesting how the related fonts evolve. The Estedad font as of the inital upload from July 2022 already shows with a Kashida axis and changing the value stretches the text.

https://github.com/aminabedi68/Estedad/tree/master/fonts/Variable

 

Robert at ID-Tasker
Brainiac
September 12, 2024

 

 

Valid for:

 

 

Bedazzled532
Inspiring
September 13, 2024

@Robert at ID-Tasker Thanks for the reply.

That modification will be paragraph based. I am looking for a solution in Character Styles. Meaning, in a paragraph ("body" paragraph style applied in that paragraph), if I want kashidawidth to be 0 for few selected characters and 1 or 2 for some selected characters. How do I do that using character styles ? Or script ?

Thanks

Peter Spier
Community Expert
September 13, 2024

@Peter Spier

 

I meant that in order to use GREP Styles - you need to select CharStyle on the list, right?

 

But as you can't set width in the CharStyle... 

 


are kasheeda selectable as a character or they part of the characters they join? Does changing horizontal scale work?