5 Replies Latest reply on Jan 5, 2012 4:05 PM by [Jongware]

    Why doesn't find and replace work on font sizes?

    LaRocca1965

      I have had this problem for a while. We work on a lot of documents that have fractional type sizes and/or leading that we need to fix. We need to change these to no longer than one decimal point as part of our standard mechanical cleanup process. Example:) A font that is 12.413 points on 15.086 leading would need to be changed to 12.4 on 15.1. I have tried find and replace for this, and it almost never finds these items. Once in a while I can get it to find one, but then there will be seven other instances of a font size like this right on the same page, and it says it can't find them. Why? Is there a special trick I don't know? It would save loads of time if I could get this to work.

       

      Thanks.

        • 1. Re: Why doesn't find and replace work on font sizes?
          TᴀW Adobe Community Professional & MVP

          I think, but I'm not sure, that this is because of internal rounding errors.

           

          So for instance, if the font size is actually 11.2546424248 it will

          display as 11.255, but you won't be able to find it by searching for

          11.255 because that's not its real size.

           

          Just a guess.

           

          Ariel

          • 2. Re: Why doesn't find and replace work on font sizes?
            macinbytes Level 4

            You got it exactly!

             

            What one can do if they don't want to hunt around for it is take the stories (text frames) and export them as incopy assigments, open the incopy assignment in a text editor, find a portion of the text and look for the type size. Will look like

             


            <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/$ID/[No character style]" PointSize="12.0145868">

             

            with the full portion.

             

            Alternately you could export the layout as idml, change the name to zip, unzip the file, go to the story, open the XML and find it there. It is a bit more semantic to read.

             

            I'm sure this can be done via scripting also.

            • 3. Re: Why doesn't find and replace work on font sizes?
              Peter Spier Most Valuable Participant (Moderator)

              I'm pretty sure that the problem here is rounding errors, and that the values you see are not the exact internal values in the database that is the ID document. It's also possible that it could have to do with how scaling was handled (do you see values in parentheses in the type fields?).

              • 4. Re: Why doesn't find and replace work on font sizes?
                LaRocca1965 Level 1

                I think the rounding off of the point sizes/leading thought is probably correct. As for the scaling, I know that these boxes are not scaled type—at least the ones I found today aren't. We do get some things that have scaled text boxes (giving us the type size in parenthesis), and I know how to deal with that. That is definitely not what's happening here. Our art directors usually scale things all over the place before we get the files, but anything that was scaled is almost always set back to 100% when we get the files.

                 

                So yeah, although I can't be sure yet, I think it's that the program is rounding off long decimal numbers. I'll look into it, along with the solutions proposed here. Thanks to everyone for your help, and if anyone else has any other possible ideas, I'm still open to hearing them.

                 

                Thanks.

                • 5. Re: Why doesn't find and replace work on font sizes?
                  [Jongware] Most Valuable Participant

                  A simple Javascript can fish out the actual font size and put it into the Find field:

                   

                  app.findTextPreferences = null;
                  app.findTextPreferences.pointSize = app.selection[0].pointSize;
                  app.menuActions.item("$ID/EditMenu_FindChange").invoke();
                  

                   

                  The 1st line clears all previous settings in the Find box, the 2nd one sets the Find What point size to the one at the current cursor position, and the 3rd line calls up the Find/Change box automatically. Alas, there is no simple way to find "anything between 11.0 and 12.0 pts".