Ask a Question related to Adobe Indesign Macintosh, Design and Development.
-
Olav_Kvern@adobeforums.com #1
Re: Forced line break changes previous line endings
Gang--
Give this script a try. It's quite experimental (i.e., use at your own risk), but in my tests it actually works to "freeze" the line endings preceding the cursor in a paragraph.
//LockDown.jsx
//An InDesign CS2 JavaScript
//
//"Locks" the composition of lines preceding the insertion point
//in its paragraph by adding soft line ends (and, if necessary, hard hyphens).
//
main();
function main(){
if(app.documents.length > 0){
if(app.selection.length != 0){
switch(app.selection[0].constructor.name){
case "InsertionPoint":
if(app.selection[0].paragraphs.item(0).insertionPoints.item(0).index != app.selection[0].index){
myLockDown(app.selection[0]);
}
else{
alert("Please select a range of text that does not include the first character in the paragraph.");
}
break;
case "Text":
case "InsertionPoint":
case "Character":
case "Word":
case "Line":
case "TextStyleRange":
case "Paragraph":
case "TextColumn":
if(app.selection[0].paragraphs.length == 1){
if(app.selection[0].characters.item(0).index != app.selection[0].paragraphs.item(0).index){
myLockDown(app.selection[0]);
}
else{
alert("Please select a range of text that does not include the first character in the paragraph.");
}
}
else{
alert("Please select a range of text inside a single paragraph.");
}
break;
default:
alert("Plase select some text and try again.");
}
}
}
else{
alert("Please open a document, select some text, and try again.");
}
}
function myLockDown(myText){
var myLine;
myText = myText.texts.itemByRange(myText.paragraphs.item(0) .characters.item(0), myText.characters.item(-1));
var myStringArray = myText.lines.everyItem().contents;
var myParagraph = myText.paragraphs.item(0);
//The last line is the one containing the insertion point, so we don't need to bother with it.
for(var myCounter = myStringArray.length-2; myCounter >= 0; myCounter--){
myResetFindChange();
myLine = myParagraph.search(myStringArray[myCounter])[0];
if((myCheckLineEnd(myLine) == true)&&(myLine.characters.item(-1).contents != "\n")){
myLine.insertionPoints.item(-1).contents = "-\n";
}
else{
myLine.insertionPoints.item(-1).contents = "\n";
}
}
}
function myCheckLineEnd(myLine){
var myBreak;
var myWord = myLine.words.item(-1);
if(myWord.characters.item(0).baseline != myWord.characters.item(-1).baseline){
myBreak = true;
}
else{
myBreak = false;
}
return myBreak;
}
function myResetFindChange(){
app.findPreferences = NothingEnum.nothing;
app.changePreferences = NothingEnum.nothing;
}
To install this script: Copy the script out of this message and paste it into a text editor or into the ExtendScript Toolkit. Save the file as a *text only* file (not RTF from TextEdit!) with the file extension ".jsx". Put the file in the Scripts folder inside the Presets folder in your InDesign folder. At that point, the script will appear in the Scripts palette. To run the script, select some text (or place a text insertion point) in a paragraph and then double-click the script name in the Scripts palette.
I expect that there are some composition cases where this script won't work, but it's done fairly well in my (admittedly limited) testing.
Thanks,
Ole
Olav_Kvern@adobeforums.com Guest
-
line break
I can't seem to get the line break to work in Contribute, so when I hit SHIFT + ENTER, it still gives a Paragraph tag. According to the help, it... -
Help! My line endings change when I create a PDF . . . why?
When I create a document in InDesign CS and I create a PDF once in a while the line breaks in the copy changes. Does anyone know why and what I can... -
Language change alters line endings
In InDesign CS2 version 4.0.2, changing the language of a text block alters the line endings. In one document, for example, switching from "No... -
forced line ending
I began using InDesign about a year ago and have been gradually moving away from FrameMaker. However, there's one feature in FM (aside from obvious... -
Can't seem to remove line break..
Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to... -
Olav_Kvern@adobeforums.com #2
Re: Forced line break changes previous line endings
Gang--
Oops, made a mistake.
The section:
case "InsertionPoint":
if(app.selection[0].paragraphs.item(0).insertionPoints.item(0).index != app.selection[0].index){
myLockDown(app.selection[0]);
Should be:
case "InsertionPoint":
if(app.selection[0].paragraphs.item(0).insertionPoints.item(0).index != app.selection[0].index){
myLockDown(myLockDown(app.selection[0].parentStory.characters.item(app.selection[0].index));
Thanks,
Ole
Olav_Kvern@adobeforums.com Guest
-
doc_bud@adobeforums.com #3
Re: Forced line break changes previous line endings
Thanks Ole.
doc
doc_bud@adobeforums.com Guest
-
Just_A_Mac_Guy #4
Re: Forced line break changes previous line endings
We avoid paragraph composer for a financial reason.
Everytime a paragraph reflows, the proof readers must re-read the copy.
Time and money add up when you have to check that copy reflowed or re-ragged
due to paragraph composer and not operator interaction.
Just_A_Mac_Guy Guest
-
Olav_Kvern@adobeforums.com #5
Re: Forced line break changes previous line endings
Hi Just_A_Mac_Guy,
Sigh. I find this sad. The paragraph composer and optical kerning are the two greatest improvements to the art of typesetting since DTP appeared. For justified copy, the work the paragraph composer does is nothing short of revolutionary, and results in copy that is both better-looking and easier to read (assuming reasonable spacing settings).
Thanks,
Ole
Olav_Kvern@adobeforums.com Guest
-
doc_bud@adobeforums.com #6
Re: Forced line break changes previous line endings
Just_A_Mac_Guy:
You have a good point. The paragraph composer does necessitate proof readers re-checking the lines for bad breaks. And the book publishers don't want reflow on top of that.
Olav--
I don't think that the paragraph composer and the optical kerning are the greatest thing since sliced bread. Optical kerning is fine for display type (i.e., chapter titles, main heads, etc.) but so far as text--no way. I have my H&Js set up for 80, 90, 133. I've found that the paragraph composer will squeeze a line and can (and does) ignore the H&Js you have set up. I only say it ignores because if you saw some of the lines you could definitely say it ignored the minimum of "80." It was more like 30 or 40.
Like I said earlier in this thread, the paragraph composer is a nice feature, but folks need to have control over what it does. It shouldn't be use it or don't. Improve it so that us mere humans have some control and say.
So far as metric or optical kerning: A good way to see how good the kerning is is to check out "New York" when typed. Check the space between the Y and the o in York. I've found that in most typefaces "metric" works best and "optical" looks lousy.
And to be honest--the best improvement in desktop publishing was Quark's ability to tweak kerning pairs.
doc
doc_bud@adobeforums.com Guest
-
Olav_Kvern@adobeforums.com #7
Re: Forced line break changes previous line endings
Hi doc,
Well, here's the deal: most fonts do not have sufficient kerning pairs defined for metrics to work well. "New York" works pretty well, because most fonts have the relevant pairs defined. Try a pair that's less likely--such as "Kv"--and metrics will leave you high and dry.
As far as InDesign breaking your H&J settings--of course it will from time to time! It has to--any composer does. What it *won't* do is break your letterspacing settings (assuming, of course, that they're set to 0, 0, 0). But it will break word spacing when it can't avoid it. I tend to set my word spacing to encourage the composer to err on the side of wide word spacing when it decides to break my rules. I then fix those problems manually, of course--I just find it easier to spot the places where things have gone awry.
Neither feature, by itself, produces perfect type--but they do reduce the time one needs to spend walking the lines of a book. Working with the single line composers and metrics-based kerning in QuarkXPress and PageMaker, I'd have to spend days fixing loose/tight lines in a book. InDesign doesn't entirely remove manual adjustment from the equation, but it does make the process much shorter and easier.
I think optical kerning works quite well for most body text. It tends to produce a somewhat loose but even fit, which can always be tightened up a bit by employing tracking in the paragraph styles. The point is to get an *even* optical spacing, and then adjust from there.
I never did like QuarkXPress' kerning pair utility, because I think such things should be done at the system level. It didn't make up for their horrible composer, in any case.:-)
But the most significant question--did you try the script? Might it help you in your work?
Thanks,
Ole
Olav_Kvern@adobeforums.com Guest
-
doc_bud@adobeforums.com #8
Re: Forced line break changes previous line endings
Ole--
Apologies but I haven't had time to try your script. I bought a lot of work home to do this weekend, but I think I will be trying your script tomorrow or Monday night. And I really appreciate it. I will definitely let you know.
So far as your thought of tracking to tighten paragraphs, that's a no-no in book publishing.
I personally think "metric" for text, and "optical" for display type. There are some designers out there who believe in "none."
I'm not sure what field your are in. I hope you don't consider it impolite if I ask??
To me, Adobe and many of the posters here seem to be about newspaper and magazine publshing.
So far as Quarks' kerning pair utility, I am confused about what you mean about doing it at the system level. How could it be accomplished at the system level?
Thanks for our discussions and your script. I will defiintely be trying it in a day or two and I do appreciate it.
doc
doc_bud@adobeforums.com Guest
-
Nini Tjäder #9
Re: Forced line break changes previous line endings
Doc - I've always used optical kerning on everything, be it body text or display type or whatever and paragraph composer on the whole thing. If it at times does what you don't want it to do, then overide it there and then.
It looks at all your settings for the paragraph not only the H & Js. including your hyphenation settings. The rest Ole explained.
Which values you set for the tracking/kerning etc of characters and words highly depends on taste, traditions, which font is used and in which font size and which visual intention you have with your text as I see it.
Ask 10 designers which values to use and you will get 10 different answers as there is no absolute answer to this.
The situation in QuarkXpress was highly different when it came to H & Js and such and it was next to impossible to get a good textflow without gaps between words. No matter which values used it always made too wide gaps between words in my opinion. PageMaker did it better actually - not that any QXP-user ever would admit that.
The paragraph composer and the optical kerning in combination in most cases is a blessing, regardless of which kind of publication you are creating, and I've over the years (have used ID since version 1.0 and PM and QXP since there very first versions) never gone back or seen a need to go back to the old way of doing it.
Nini Tjäder Guest
-
Olav_Kvern@adobeforums.com #10
Re: Forced line break changes previous line endings
Hi doc,
Though I'm now a "computer scientist" (whatever that is!) working on InDesign, I have been a typesetter (pre-DTP, Compugraphic gear) and book designer (I was an art director for Peachpit Press), and have produced a few hundred books. The only book I really work on now is "Real World Adobe InDesign." (I'll admit that the production process for this book is not normal, as I'm also the illustrator and writer--makes it fairly easy to get things to fit!):-)
re: tracking being a no-no in book production
I'd say it depends on the text and on the font (and the point size, measure, and so on). Optical kerning does apply a somehat more open spacing than automatic kerning based on font metrics, so I've often seen people use tracking to compensate. The point is *not* to squash the characters together(!)--which is the usual objection to tracking in book layout.
Optical kerning is not perfect, doesn't work with all fonts, and large display text will always need manual intervention. The paragraph composer is also not perfect--again, the results will depend on the text and the design specifications.
For my own work, I find that the combination works very well. It doesn't do anything that I couldn't do by hand if I had the time. And that's the point--the features save us the time we'd spend fixing kerning pairs for font metrics, or the trouble of applying manual kerning to body text. They don't produce perfect type--but they do get us to a better starting point for "tweaking."
Thanks,
Ole
Olav_Kvern@adobeforums.com Guest
-
doc_bud@adobeforums.com #11
Re: Forced line break changes previous line endings
Thanks Nini and Ole.
Nini--you are right about asking 10 designers and getting 10 different answers. Right now, the some book publishers want metric kerning, some want optical, some want none, some want a mixture.
I wish they would all get together and make an industry standard, but I realize that it impossible.
Ole--thanks for the insight. And I will find time to check out your script.
It would be nice if I was given the time to experiment more with the optical kerning and paragraph composer, but when you get a half-day to knock out a 500 page book, time is something I am short of. :(
Thanks again, gang.
doc
doc_bud@adobeforums.com Guest
-
emstudio@adobeforums.com #12
Re: Forced line break changes previous line endings
Deb, I can't really see what these other answers have to do with your problem, but I think I know what your problem is. If you are using "Paragraph Composer" you will usually get reflow in lines above the point you are editing. Switch to "Single Line Composer" and your problem will cease.
emstudio@adobeforums.com Guest
-
Deb_Jacome@adobeforums.com #13
Re: Forced line break changes previous line endings
Thanks emstudio. Early on in the thread someone mentioned that, and it did the trick. I've been using paragraph composer as a default, and then switching to single line composer as needed. So far that's been working well for me.
Deb_Jacome@adobeforums.com Guest



Reply With Quote

