Professional Web Applications Themes

Forced line break changes previous line endings - Adobe Indesign Macintosh

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.doents.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": ...

  1. #1

    Default 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.doents.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 doent, 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

  2. #2

    Default 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

  3. #3

    Default Re: Forced line break changes previous line endings

    Thanks Ole.

    doc
    doc_bud@adobeforums.com Guest

  4. #4

    Default 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

  5. #5

    Default 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

  6. #6

    Default 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

  7. #7

    Default 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

  8. #8

    Default 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

  9. #9

    Default 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

  10. #10

    Default 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

  11. #11

    Default 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

  12. #12

    Default 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

  13. #13

    Default 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

Similar Threads

  1. line break
    By cozzabags in forum Macromedia Contribute General Discussion
    Replies: 4
    Last Post: August 19th, 05:21 PM
  2. Help! My line endings change when I create a PDF . . . why?
    By Sara_Temby@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 10
    Last Post: January 23rd, 07:56 AM
  3. Language change alters line endings
    By Kevin_R._Stauffer@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 5
    Last Post: July 6th, 06:41 PM
  4. line break in a datagrid
    By hannes in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: March 13th, 01:48 PM
  5. forced line ending
    By Bill Peterson in forum Adobe Indesign Windows
    Replies: 0
    Last Post: April 27th, 12:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139