簡體   English   中英

將文本附加到同一單元格后,表格單元格中的 Indesign 字形消失了

[英]Indesign Glyphs in table cell disappeared after append text to the same cell

我正在為 Adob​​e Indesign 編寫 js 擴展腳本。 我正面臨一個問題,這很奇怪,我不知道是 Adob​​e Indesign 錯誤還是我的問題。

情況是:我必須在表格中插入一些特殊字符,所以我必須使用 find 和 change Glyphs 方法將這些特殊字符插入到該表格的單元格中:

month12day29.contents = "¢";
app.findChangeGlyphOptions.includeMasterPages = true;
month12day29.characters.everyItem().appliedParagraphStyle ="前ー月大丸";
month12day29.characters[0].properties={appliedFont : 'A-OTF Futo Go B101 Pro',fontStyle: 'Bold'}
app.findGlyphPreferences.appliedFont= 'A-OTF Futo Go B101 Pro';
app.findGlyphPreferences.fontStyle= 'Bold';
app.findGlyphPreferences.glyphID = 102;   //Character:  ¢
app.changeGlyphPreferences.glyphID=8103;  //Desired character, there is no unicode for this, i cant insert it directly, so i have to insert it by glyphs
app.changeGlyphPreferences.appliedFont= 'A-OTF Futo Go B101 Pro';
app.changeGlyphPreferences.fontStyle= 'Bold';
month12day29.characters[0].changeGlyph();
month12day29.characters.everyItem().appliedParagraphStyle ="前ー月大丸";   // same Font A-OTF Futo Go B101 Pro

以上部分沒問題,但是當我嘗試將文本附加到該單元格時,插入的字符消失了

month12day29.contents +="\r";  /// the Desired chacter above some how got deleted after this line execute

我想問一下:

  • 問題是什么?

  • 如何解決這個問題?

謝謝你,對不起我的英語不好!

由於您正在處理這種甚至沒有 unicode 的奇特字形,因此可能是 JS 連接失敗了。

在這種情況下,您可以將要附加到表格單元格的最后一個插入點的字符串插入。 所以你可以保留你的腳本,但作為最后一步,你可以這樣做:

month12day29.insertionPoints.lastItem().contents = "\r";

這基本上讓插入的字形單獨存在,只是在它后面放了一些東西。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM