How to set the desired font to the selected text in textframe?

Hi,
I want to change the font(let's say Times New Roman) of selected text in textframe when I click on  menu-item of my plug-in.
I went through the Adobe Text Engine documentation and  tried some code for setting font but failed. I don't see any member function in IFont class to set desired font, so unable to move forward.
plz see the code. I would like to know one more thing that how can we set a particular font for a textframe?
TextRangesRef rangesRef = NULL;
result = sAIDocument->GetTextSelection(&rangesRef);
aisdk::check_ai_error(result);
ITextRanges ranges(rangesRef);
if (ranges.GetSize() > 0)
     ITextRange range = ranges.Item(0);
     ICharFeatures features = range.GetUniqueLocalCharFeatures();
     IFont  font;                     // I don't see any method to put desired font.
   // features.SetFont(); 
Thanks.
D.A

First, get the font:
AIFontKey fontKey = 0;
AIErr error = sAIFont->FindFont("Times New Roman Regular", kAIAnyFontTechnology, kNativeAIScript, 0, &fontKey);
// do something with error
ATE::FontRef fontRef = 0;
error = sAIFont->FontFromFontKey(fontKey, &fontRef);
// do something with error
ATE::IFont font(fontRef);
Then, apply it like this:
ATE::TextRangeRef textRangeRef = 0;
AIErr error = sAITextFrame->GetATETextRange(handle_to_artwork, &textRangeRef);
// check error
ATE::ITextRange textRange(textRangeRef);
ATE::ICharFeatures charFeatures = textRange.GetUniqueLocalCharFeatures();
charFeatures.SetFont(font);
textRange.ReplaceOrAddLocalCharFeatures(charFeatures);
There are a few other ways to set the text, but you need to understand how character & paragraph styles interact with each other to understand the differneces. This is the most straight forward way to do it though.

Similar Messages

  • How to set different pointsize  (Font Size) for different text range in the single textframe.

    I have a one textframe in which i want to  set three different pointsize(font size) for three different text ranges. I have set different tag name for different text ranges . So How can I set different pointsize in the single texmframe.
    Please reply me if anyone is aware of it.
    Thanks,

    Jack,
    Extending Martti's post, you can create an XSLT that will add an element around the ASD2.1 part when you import the XML file into FrameMaker. Then FrameMaker's EDD can format this added element with a font different from the one used in the content element.
    Van

  • How to select the desired language in the item Startup and Login Windows?

    Users can individually select the language in which applications are displayed by moving the entries in the Language list of the International pane in System Preferences into the desired order. However, this language preference only affects applications started by each user, it does not apply to the startup phase of the operating system and its login window. Under normal circumstances, this kind of language preference can only be set when installing or reinstalling the operating system.
    How to modify this language preference without having to reinstall the system. Select the desired language in the item Startup and Login Language ?

    The language used by the login window is written in /Library/Preferences/.GlobalPreferences.plist. The file name begins with a dot . , so it is hidden in the Finder.
    If it is OK for you to use unix command line, then you can modify this plist file by using "defaults" command as follows (CAUTION! please be careful no to make any mistakes, and do it at your own risk).
    Open /Applications/Utilities/Terminal.app. and type
    cd /Library/Preferences
    cp .GlobalPreferences.plist saved-GlobalPreferences.plist
    to make a backup copy of the plist. (if you get permission error, then try
    sudo cp .GlobalPreferences.plist saved-GlobalPreferences.plist
    and enter the admin password.)
    Then type
    defaults read /Library/Preferences/.GlobalPreferences AppleLanguages
    to show the current setting. You can rearrange the list of languages as you like, for example,
    defaults write /Library/Preferences/.GlobalPreferences AppleLanguages '(fr en)'
    (or sudo defaults write .... if you get permission error)
    I think you may make the list as short as you like.
    If you don't like to use Terminal.app, then install Xcode (you can find it in Tiger install DVD, or download the latest version from Apple -- you need to register at Apple website to download it). It will install /Developer/Applications/Utilities/Property List Editor.app. You can edit /Library/Preferences/.GlobalPreferences.plist by this app by typing the following into Terminal.app (it's hidden in Finder so you must use Terminal.app to start editing it by Property List Editor):
    open /Library/Preferences/.GlobalPreferences.plist
    PowerMacG4, PowerBookG4, iMac(C2D)   Mac OS X (10.4.8)  

  • How to set up automatic payment for the purchase order

    Hi, All,
    I have one question how to set up automatically payment for the Rent Office purchase Order?
    There is the requirement from the client. They want to create one kind of purchase order for the Office Rent, then pay the fees in the certain time of every month to the vendor for the rent fees without any invoice. Whatu2019s the normal solution for this kind of purchase order? Is it ERS? Or something else?
    Please give me the details and business flow. Also please tell me how to setup in the SAP and T-code.
    Thanks in advance

    Either you can set up ERS or you can pay directly from the FI side.
    Prerequisites
    Evaluated receipt settlement must be flagged in the purchase order item.
    The vendor must be flagged as being subject to ERS in the vendor master record.
    The goods receipt must refer to a purchase order.
    Goods-receipt-based Invoice Verification must be defined for the purchase order item.
    A tax code must have been maintained in the purchase order item.
    The order price of the materials may not be an estimated price.
    If you flag a vendor as being subject to ERS, the system sets the ERS indicator as a default in each item when you create a purchase order for the vendor. You can prevent this happening for certain vendors by flagging the info record for the material and the vendor as not being subject to ERS.
    In Purchasing, you can delete the default ERS indicator in a purchase order item.
    Choose Logistics Invoice Verification ® Automatic Settlement ® Evaluated Receipt Settlement (ERS).
    The selection screen appears.
    You can use the following criteria to narrow down selection of the transactions to be settled:
    Company code
    Plant
    Goods receipt posting date
    Goods receipt document
    Fiscal year of the goods receipt
    Vendor
    Purchase order and order item
    You can define the selection criteria for the invoice documents by:
    Delivery
    Purchase order
    Purchase order item
    Goods receipt document
    Credit memo
    Invoice
    Currency
    Choose  Execute.
    The system issues a log for Evaluated Receipt Settlement, which displays the following:
    Settled
    In line with your selection criteria, the system displays all the order items that were settled (or if you are working in test mode, which would have been settled).
    Could not be settled
    In line with your selection criteria, the system displays all order items for which ERS is defined but could not be settled. It also lists the reasons.
    If the system reports being unable to invoice a transaction, you should exclude the transaction from ERS to avoid it being included in the log the next time ERS is run.
    Select the item and choose Exclude from ERS.
    The system also generates and possibly sends a message to inform the vendor(s) about the transaction settled, depending on the settings in Customizing.
    You can display the following environment information for the order items selected. To do this, choose Goto ®:
    Display purchase order
    Display invoice
    Display material document
    Display long text

  • How to set a variable value on the BPC Data Manager

    Hello BPC Experts,
    I'm creating a BPC10 NW version demo environment for our prospect customer.
    I made a data manager to import  BW data into BPC model from BW cube.
    I need to import just one month data into BPC from the BW cube that has more than one month data.
    When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
    But, in a case where the program (data manager) runs by JOB monthly,
    I can't select a member of the time dimension prompt manually.
    So I want to know how to set a  variable value to the time dimension prompt from a system date etc. automatically.
    Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
    Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data  by the data manager running on JOB ?
    (without selecting a member of the time dimension prompt of the data package manually)
    Thanks in advance,
    Keisuke

    Hi Gersh
    Sorry for my late reply and thanks for your helpful information.
    I tried the second way of your information and I could configure it.  
    And I 'll try first way of your information.
    Regards,
    Keisuke

  • Anyone know how to change the default font for the new pages? Apparently it does not even come up when I search the 'Help' section of Pages. The level of incompetence in this new version seems breathtaking

    I cannot find how to change the default font in the new Pages. It does not appear in the Help area when I search for it. I am never sing Helvetica for my standard documents and cannot seem to change it. What am I missing? And why does Pages help not have an easy answer?
    dan

    You open a blank template and change the font to you liking. Remember to also get all the styles changed with new font. Then Save As Template. Now you have a template with the font you like.

  • How to set Multi User Environment in the weblogic 5.1 and 6.1 server..(Urgently)

    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

    Hi. A JDBC connection pool is a set of identical, interchangeable, pre-made
    connections, and the controls to make sure only one user uses a particular
    connection at any one time. If you want to have different DBMS users, you can
    have a separate pool for each DBMS user, which may contain as many or few
    connections as you want. Some applications has a pool for the accounting
    applications, and another for the sales applications etc. Some do have a
    separate pool for john, jane, joe etc, each with one connection. Pools
    can be created and destroyed dynamically using the dynamic pool API.
    Joe
    softstar wrote:
    >
    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

  • I have everything set for Arabic fonts and the keyboard as well. When I type in WORD or EXCEL I just get individual Arabic letters, but they never connect, they should be for example like this   الس    but they always appear like that ا ل س

    I have everything set for Arabic fonts and the keyboard as well. When I type in WORD or EXCEL I just get individual Arabic letters, but they never connect, they should be for example like this   الس    but they always appear like that ا ل س

    MS Word for Mac has never supported Arabic.  You have to use other apps.  Mellel is best, but Pages 5, TextEdit, Nisus Writer, or Open/LibreOffice should work OK.
    Sometimes you can make Word for Mac do connected Arabic if you are editing a document created with Windows Word.

  • How to display the COURIER font in the Form

    Hi all,
    <br><br>
    I created a form with some items of "Courier New" font. Later I noticed that if the "Standards and Formats" in the "Regional and Language Setting" in the client PC was set to "Arabic", the data is <b>not</b> displayed in the items with the specified font. Instead, the data looks like of Arial font.
    <br><br>
    <b>Is there a way to display the Courier font in the Form, if the regional setting was set to Arabic in the client side?</b>
    <br><br>
    Thanks in advance.

    Which version of Forms are you running? Webforms or Client/Server?
    regards,
    Heike

  • I'm new to using iCloud and couldn't find the answer to: how to set my calendar to use the 24 hour clock. Thanks all.

    ?? I'm new to using iCloud and couldn't find the answer to: how to set my calendar to use the 24 hour clock. Thanks all.

    Thanks, David.  i thought i had it set correctly in Preferences in L&R. Being i was wearing my suspenders and belt at the same time i went back to L&R, cleared what was there and re-entered same to include unchecking and rechecking Time Format fgor 24-hour time.   It works now. Thanks again.

  • How to set colors in cells depending the conditions  in alvtree

    Hi All,
    Could you please provide me idea or sample program how to set colors in cells depending the conditions  in alvtree.
    Thanks,
    Suresh

    When running vim in a terminal, it will use whatever colour scheme is defined by the terminal.  You should have a look at this thread:
    http://bbs.archlinux.org/viewtopic.php?id=51818
    Also, check the wiki article on Xdefaults.

  • How to set field to blank if the data is # or unassigned

    hi experts,
    how to set field to blank if the data is # or unassigned?
    thx

    Hi
    add the following macro to your workbook (template workbook):
    Sub SAPBexonrefresh(qstring As String, resultArea As Range)
        For Each c In resultArea
            If LCase(c.Value) = "not assigned" Then c.Value = ""
           Next
    End Sub

  • How I can disable unnecessary fonts from the font menu?

    How I can disable unnecessary fonts from the font menu?
    I'm so frustrated to always browse the kilometer-long font menu. There are Chinese, Arabic, Thai, Japan etc. fonts. I will never need these fonts!
    The platform is the iMac and Maverics. Illustrator is a version CS6. All software is the latest version of.
    I get off some of these fonts using Apple's Font Book, but still there will be unnecessary Chinese, Arabic, Thai, Japan etc. fonts.
    I also have Suitcase Fusion 4, but that doesn't help in this case because I can't disable system fonts etc. I also tried the "Monolingual" software. Monolingual is a software for removing unnecessary language resources from OS X. But still I see many foreign language fonts in font menu.

    I could do with an answer to this question too
    The fonts I don't want on my system are these (all Adobe covert additions as far as I can tell):

  • How do I add Show Fonts in the upper left corner of the viewer in iMovie if it is not there

    How do I add Show fonts in the upper left corner of the viewer if they do not exist?

    Hi
    You must have a Text inserted one way or the other.
    then click on the Text clip box
    and now it's there.
    You have Advance tools turned on ?
    Yours Bengt W

  • How do you change the font of a newly inserted slide, so that it is the same font as the default in the Adventure Trailer theme?

    iMovie would not let me customize new text in a new slide, so that it looks like the other titles in default slides (slides in the Adventure Theme Trailer). I basically want to have all the titles the exact same font, which is the default font in the trailer. iMovie won't let me do that though. I need help ASAP please.

    iMovie would not let me customize new text in a new slide, so that it looks like the other titles in default slides (slides in the Adventure Theme Trailer). I basically want to have all the titles the exact same font, which is the default font in the trailer. iMovie won't let me do that though. I need help ASAP please.

Maybe you are looking for

  • I just got mac defender attacked..help...what do i do??

    i just got mac defender attacked. i entered my password but did not register...what do i do. and once i am able to get rid of it how do i make sure my computer is completely safe? what anti malware product should i get (purchase or for free)?? thanks

  • Simple (first attempt) mxi

    ok guys decided to look into extension writing have hacked away at the config dir and files within to produce what im after. a simple button which launches the browser and directs to a url. This bit is fine and have it working and it packages up fine

  • SXMB_MONI retention period

    Hi all, I configured the retention period for deleting and archiving XML messages in SXMB_ADM. My retention period for deleting messages is 30 days and the job is scheduled on a weekly basis. When I go to the message monitoring in the RWB, I can see

  • Business Rules - Configure Entities/Scope without elimination rules.

    Hello Experts, I am working on BPC 10 and have set many elimination rules that apply to all "SCOPE". Is there a way to configure that for a given "SCOPE" elimination rules may be nullified, you bone not apply to a SCOPE in particular? Thanks for your

  • I cannot use the Camera Raw feature

    I cannot use the Camera Raw feature after updating the CC!!!