Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Problem with the paragraph.contents property

Return to Member Forum

  • Author
    Posts
    • #1199233
      Tamás Nagy
      Participant

      Hi friends,

      I ran into a stange phenomenon today. Given a paragraph with some text in it and a string containing a special character in the middle. I tried to replace the original content of the paragraph with the string but this character was simply left out. This character was formatted using one instance of the Zapf Dingbats font. In this font the given glyph had no Unicode number, it looked similar to a > sign. In a different instance of Zapf Dingbats font it has the Unicode number 276F. I tried this script piece:

      alert(myString);
      myParagraph.contents=myString;

      In the alert window the special character was there/visible (a question mark-like thing replaced the glyph) but after the script stopped I found the string text in Indesign without the arrow character. Nothing appeared in it’s place, not even a question mark or an invisible character that we would have to step over by the cursor-right key. Even the character-count of the paragraph became 1 less than the length of the string. I tried to change this arrow with the same looking glyph from the other instance of Zapf Dingbats and it was all right. So the error seems to be related with the font instance or the fact that the character had no Unicode index in that font.

      Unfortunately we must not change the font, so now I don’t know what to do. Do you have any idea why the character was left out or how could I manage this situation: how to force Indesign to include that character into the paragraph text?

      Thanks,
      Tamás

    • #14323517

      Can you verify that font again? I am not convinced your character is from the original Zapf Dingbats set – I double-checked against lists of fonts such as on https://www.fileformat.info/info/unicode/char/276f/fontsupport.htm, and that does not list it for Zapf Dingbats either.

      (Other well-known dingbats such as the floral U+2766 *are* listed, and are supported by a font called “Dingbat” — which looks like a blatant rip-off of that original font.)

    • #14323516
      Tamás Nagy
      Participant

      Hi Theunis,

      I’m sure that this font is NOT the original one (btw. which is the original, the simple or the ITC version, the regular or the medium style…) but we are fixed to it since our client uses this one, they have no other variation. I think this problem is only an indicator that shows us that something is not perfectly round in InDesign.

      Or maybe this is an unusable pirate-copy of that font and this is what causes all our problems. I don’t know.

      Tamás

    • #14323512
      Brian Pifer
      Participant

      Are you using string.replace? Have you tried changing one graf with GREP. If that works, you could set a GREP replace script instead of string.replace, replacing with that arrow character with the character that copies over and maybe setting that character with a style that you can apply on the GREP replace?

    • #14323508
      Tamás Nagy
      Participant

      Thanks, Brian,

      maybe finally I’ll have to replace it firts with a GREP change but I’m afraid this stuation will arise later again and again, maybe with other characters, or other fonts, so first I would try to defeat the bug altogether, without altering the original documents.

      My job is to collect certain paragraphs from a book into an RTF table that will be later processed by experts and finally returned into the original document. This time the book is 620 pages long and there are some 5-10 relevant paragraphs on a single page so it certainly needs a script. And it is just one book (although it is definitely within the biggest ones) of the many.

      First I tried to store the text content of the original paragraph into a string (myString=origParagraph.contents), then in another document I gave this content to an unformatted (plain Arial), yet empty paragraph in a table cell (myParagraph.contents=myString). This method didn’t work, since this mystical character disappeared somehow: the string still contained it, the cell-paragraph not.

      Later I tried something else. I simply copied the original paragraph into the cell (orgigParagraph.duplicate(LocationOptions.AT_BEGINNING, myCell). This way I saw some character in the right place, although it didn’t look the same. Juppie, let’s go on, export the table from InDesign into an RTF file! Then in Word I checked the result. And the character disappeared again.

      To Theunis:
      I’m not sure but I think that if any character (with an unicode index, say 276F) isn’t implemented in a font then Indesign usually replaces it with some other character from the font, maybe the one named “notdef”, of course only if this character does exist. I have’n tested what happens when the applied font misses this special character as well. First I wrote that the character in question has no Unicode index: I checked it in a font editor, but in InDesign, on the Glyphs palette some index was assigned to it, anyway. I don’t think it is normal that any character is just left out. And it is probably (or at least should be) independent of the font used. Isn’t it?

      Tamás

      Ps: Yesterday two of my posts didn’t appear here at all after clicking on Submit. What could I do wrong? :D

    • #14323502
      Tamás Nagy
      Participant

      I didn’t mention what the original task was. I have to copy the exact text content of some paragraphs from a book into an InDesign table, then export this table into an RTF file for further processing by other experts. The book is 620 pages long and there are an average 5-10 such paragraphs on a page so I decided to do it by a script. The problem is that some characters that were borrowed from a font named Zapf Dingbat didn’t go through.

      Later I modified the above script to the following:

      myParagraph.duplicate( bla…bla);

      and then at the destination I removed all unnecessary formattig from it. This way those characters didn’t disappear. But after exporting I had to realize that although in InDesign I saw those characters, in Word they disappeared again. This time they were simple Arial glyphs, so their Dingbat past was gone.

      The book was originally typeset in London, and as I investigated the whole, I saw they used 3 diffferent Zaph Dingbats fonts throughout the book:

      ZapfDingbats PostScript (unknown)
      ZapfDingbatsITC TrueType (unknown)
      ZapfDingbatsStd OpenType (Adobe_OT_Library)

      I don’t know where they got these fonts, and why they used 3 different instances for the same purpose but I may not change it. I think all 3 are some illegal copy or modified somehow. But why they didn’t work after the text has already been formatted to Arial?

Viewing 5 reply threads
  • You must be logged in to reply to this topic.
Forum Ads