This content has been marked as final. Show 8 replies
Set the AppliedFont of the first insertion point of the text frame.
thank you for this fast response!
sorry, I have the problem again. I use a script to reset to the original applied font. But where is the original value stored of the font from the text frame?
Assuming I'm understanding you, it's not. Why are you working with applied fonts for text frames? You should be using Paragraph styles and then you wouldn't have to worry about this at all.
I have a problem in my script. I will describe the problem:
1. I have a text frame with correct font information on a master page
2. I create a new page based on this master and overwrite the frame
3. In the script I write text in this text frame.
4. Then the user manually can change the font to italic in this frame
5. Later I will run my script, which deletes the frame content
6. And write again text. But now the text is still italic.
How can I get the original font information?
OK, I can try to go again to the master and read it from there. But is there an easier solution.
why are you writing again new text to same TextFrame ?
what your script should do?
its an update function. The scripts reads text from the database (which has changed) again to the text frame. This works!
My problem is, that the font type of the text frame can be changed.
For example: The user changed the first character to "Wingdings". Then my script deletes all text in the frame. Then the whole new text has the font "Wingdings".
I don't understand, why InDesign changed the standard font of a text frame, when I delete text. You can check this behavior with the example in my first post.
There isn't really a "standard font of a text frame." The formatting information is stored by the text in the text frame, and not really by the frame itself. If the frame contains only a single insertion point, then the formatting is stored by that object. In your example, the insertion point has gotten formatted using Wingdings, so that's what you get when you add text to the frame.
This is still true even if you use an object style to format the text frame--but that's what I'd do. Then, when I change the text, I can re-apply the object style to format the text in the frame.