Thread View: adobe.scripting.indesign
9 messages
9 total messages
Started by HenryL
Fri, 13 Feb 2009 12:43
Font Size in & Leading in TextFrame
Author: HenryL
Date: Fri, 13 Feb 2009 12:43
Date: Fri, 13 Feb 2009 12:43
11 lines
1356 bytes
1356 bytes
Hi, I've a problem on font size and leading handle in textframe. There is a textframe with text on difference font size, for example, first line with font size 10 and 2nd line with size 12 .... and there are total 10 lines. With this 10 lines, the textframe is overflow. To make the textframe become not overflow, it need to decrease the font size and the leading by 0.1 in each characher of the textframe until the textframe not overflow. I've tried to loop through all the charachter inside the textframe and do the reduction (on character.pointsize and character.leading) but the performance is very low as there are many characters inside the textframe within those lines. Is there any faster way to make the font size and leading reduce in the Textframe until not overflow? Please advise. Thanks. HenryL
Re: Font Size in & Leading in TextFrame
Author: HenryL
Date: Mon, 16 Feb 2009 03:33
Date: Mon, 16 Feb 2009 03:33
7 lines
881 bytes
881 bytes
Hi, I found shortcut keys (crtl + shift + < or crtl + shift + >) for point size and (alt + up arrow or alt + down arrow) for leading that work on a selected textframe. Does anyone know what function calls that actually used by those short cut keys? Please advise. Thanks Henry
Re: Font Size in & Leading in TextFrame
Author: Peter Kahrel
Date: Mon, 16 Feb 2009 09:03
Date: Mon, 16 Feb 2009 09:03
17 lines
1035 bytes
1035 bytes
Henry,
Work on paragraphs, not characters, that should make a difference. And if there's a lot of text it pays to work on arrays, bot collections:
myParagraphs = myTextFrame.parentStory.paragraphs.everyItem().getElements();
while (myTextFrame.overflows)
{
for (i = 0; i < myParagraphs.length; i++)
{
myParagraphs[i].pointSize -= 0.1;
myParagraphs[i].leading = -0.1;
}
}
Peter
Re: Font Size in & Leading in TextFrame
Author: HenryL
Date: Mon, 16 Feb 2009 09:21
Date: Mon, 16 Feb 2009 09:21
1 lines
603 bytes
603 bytes
Thanks Peter, it works.
Re: Font Size in & Leading in TextFrame
Author: HenryL
Date: Mon, 16 Feb 2009 11:23
Date: Mon, 16 Feb 2009 11:23
9 lines
997 bytes
997 bytes
Hi Peter, There is issue when using Paragraph. When a line contains difference font/font size in difference characters, expected result would be the font size decrease in proportion maner with the original font/font size. However, the output result using paragraph is not what expected, it changed into the same font/font size in the whole line. Any advise for this issue? Thank you. Henry
Re: Font Size in & Leading in TextFrame
Author: Peter Kahrel
Date: Mon, 16 Feb 2009 11:37
Date: Mon, 16 Feb 2009 11:37
3 lines
934 bytes
934 bytes
Ah -- if you have different point sizes in a paragraph then you would have to process characters, not paragraphs. But you did that already, didn't you? Anyway, you could use the script I posted earlier in #2 and replace "paragraphs" with "characters". That will probably be a bit quicker than what you had before. Peter
Re: Font Size in & Leading in TextFrame
Author: HenryL
Date: Mon, 16 Feb 2009 12:36
Date: Mon, 16 Feb 2009 12:36
9 lines
988 bytes
988 bytes
Hi Peter, Yes I have done it using characters but what I wonder is that there is a short cut key function in Indesign interface which can do it smoothly and in very good performance. That why I would like to know exactly that functions and use that functions call instead. Thank you very much for the advise. Henry
Re: Font Size in & Leading in TextFrame
Author: Harbs
Date: Mon, 16 Feb 2009 12:40
Date: Mon, 16 Feb 2009 12:40
5 lines
789 bytes
789 bytes
You'd probably be better using textStyleRanges rather than characters. -- Harbs http://www.in-tools.com
Re: Font Size in & Leading in TextFrame
Author: HenryL
Date: Mon, 16 Feb 2009 13:12
Date: Mon, 16 Feb 2009 13:12
1 lines
603 bytes
603 bytes
Thanks Harbs. It works.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads