摘要:本文将带你了解Illustrator快速入门之Illustrator插件开发 使用Adobe Text Engine,希望本文对大家学Illustrator有所帮助。
本文将带你了解Illustrator快速入门之Illustrator插件开发 使用Adobe Text Engine,希望本文对大家学Illustrator有所帮助。
Adobe text engine提供了Illustrator中强大的文本支持,主要的特点有:
1. unicode
2. OpenType
3. 先进的排版技术,如字距、边缘对齐、自动的字形替换、字形比例。
4. 文本和段落样式
5. 亚洲文字
下面就是一些使用ATE的方法。
创建point text:
ASErr SnpText::CreatePointText(){ ASErr result = kNoErr; try { // Get the group art that contains all the art in the current layer. AIArtHandle artGroup = NULL; result = sAIArt->GetFirstArtOfLayer(NULL, &artGroup); aisdk::check_ai_error(result); // Add the new point text item to the layer. 添加point text AITextOrientation orient = kHorizontalTextOrientation; AIRealPoint anchor = {10,10}; AIArtHandle textFrame = NULL; result = sAITextFrame->NewPointText(kPlaceAboveAll, artGroup, orient, anchor, &textFrame); aisdk::check_ai_error(result); // Set the contents of the text range. 改变内容 TextRangeRef range = NULL; result = sAITextFrame->GetATETextRange(textFrame, &range); aisdk::check_ai_error(result); ITextRange crange(range); crange.InsertAfter("New point text item"); } catch (ai::Error& ex) { result = ex; } catch (ATE::Exception& ex) { result = ex.error; } return result;}
创建In path text:
ASErr SnpText::CreateInPathText(){ ASErr result = kNoErr; try { // Get the group art that contains all the art in the current layer. 获取组art AIArtHandle artGroup = NULL; result = sAIArt->GetFirstArtOfLayer(NULL, &artGroup); aisdk::check_ai_error(result); // Add the new in path text item to the layer. AIArtHandle textFrame; sAIArt->GetArtFirstChild(artGroup, &textFrame); // 我先创建了一个矩形矿,这里是获取这个矩形框 aisdk::check_ai_error(result); AITextOrientation orient = kHorizontalTextOrientation; result = sAITextFrame->NewInPathText(kPlaceAboveAll, artGroup, orient, textFrame, NULL, false, &textFrame); aisdk::check_ai_error(result); // Set the contents of the text range. 改变内容 TextRangeRef range = NULL; result = sAITextFrame->GetATETextRange(textFrame, &range); aisdk::check_ai_error(result); ITextRange iTextRange(range); iTextRange.InsertAfter("New in path text item"); } catch (ai::Error& ex) { result = ex; } catch (ATE::Exception& ex) { result = ex.error; } return result;}
创建on path text:
ASErr SnpText::CreateOnPathText(){ ASErr result = kNoErr; try { // Get the group art that contains all the art in the current layer. AIArtHandle artGroup = NULL; result = sAIArt->GetFirstArtOfLayer(NULL, &artGroup); aisdk::check_ai_error(result); // Add the new on path text item to the layer. AITextOrientation orient = kHorizontalTextOrientation; AIArtHandle textPath; sAIArt->GetArtFirstChild(artGroup, &textPath); // 先创建了一个圆弧,这里是获取这个圆弧 aisdk::check_ai_error(result); result = sAITextFrame->NewOnPathText(kPlaceAboveAll, artGroup, orient, textPath, 0, 0, NULL, false, &textPath); aisdk::check_ai_error(result); // Set the contents of the text range. TextRangeRef range = NULL; result = sAITextFrame->GetATETextRange(textPath, &range); aisdk::check_ai_error(result); ITextRange iTextRange(range); iTextRange.InsertAfter("New on path text item"); } catch (ai::Error& ex) { result = ex; } catch (ATE::Exception& ex) { result = ex.error; } return result;}
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标常用软件之Illustrator!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号