-
the WPF way...: XAML Exporter for Illustrator using the CS2 COM Type Library
a another solution to export ai files in wpf solutions.
(using the CS2-3 Com type library).
NB: need to fix bug. replace, with . in the xaml generated file. -
https://svn.scriptographer.com/tags/gcj_1/src/cpp/plugin/ScriptographerEngine.cpp
-
// AIColor <-> AIColor
-
-
Adobe Forums - New TextRange?
I'm sorry you feel frustrated with the text api and documentation.
As you know a text range is a range of characters from a start offset to an end offset, so you can get the text range of a single character, a word, a text run, a glyph run, a paragraph, a text frame, a story or all the stories in the document by iterating the correct container - e.g an IWordsIterator, ITextRunsIterator, ITextLinesIterator, IGlyphRunsIterator, IParagraphsIterator, ITextFramesIterator, IStory, IStories. An ITextRange can contain anything from a single character in a text frame to the entire contents of the document throught the IStories set.
An ITextRun is a range of text with the same features, so if you had a text frame containing 2 lines of text and you changed a single feature attribute, like the font of one of those lines, you would then have 2 text runs - one run would contain the text with the original font, the other would contain the text with the new font.
The following code i took from your original sample and created a new code snippet, which runs in the new SnippetRunner plug-in which will be released in an updated version of the SDK in the next few days. Also in the new SDK is a document called Using the Adobe Text Engine which provides recipes for creating, editing, deleting and styling text.
# /* / ASErr SnpTest::Do(void)
{
ASErr result = kNoErr;
try {
AIArtSet artSet = NULL;
result = sAIArtSet->NewArtSet(&artSet);
aisdk::check_ai_error(result);
AIArtSpec specs[1] = {{kTextFrameArt,0,0}};
result = sAIArtSet->MatchingArtSet(specs, 1, artSet);
aisdk::check_ai_error(result);
AIArtHandle textArtHandle = NULL;
result = sAIArtSet->IndexArtSet(artSet, 0, &textArtHandle);
aisdk::check_ai_error(result);
ATE::TextRangeRef textRange = NULL;
char* thisWord = "test ";
result = sAITextFrame->GetATETextRange(textArtHandle, &textRange);
aisdk::check_ai_error(result);
ATE::ITextRange firstRange(textRange);
firstRange.InsertAfter(thisWord);
ATE::ITextRange newRange = firstRange.C -
Adobe Forums - ITextRange and Char Features
-
As I said, I'm a little hazy about how the character/paragraph properties work, but from what I can make out it's all about inheritance. There's a base set of characteristics (e.g. font, stroke, etc.) by default. A character style can override those values, but may not touch others (leaving you with the default). Then you can override those properties on the actual artwork itself.
First of all, it's important to know how the various types of containers work in the ATE. From what I can gather, it looks like each character (or Glyph) belongs to a GlyphRun -- which is just one or more characters that have the same set of
local properties. A TextRun contains one or more GlyphRuns, and a TextRange contains one or more TextRuns. And a TextFrame contains one TextRange. Only one, as far as I can tell.
-
