FindChangebyList with strings of text?

I'm trying to setup a findchangebylist document to change strings of text to match my company's verbiage. I've been successful changing items like:  $10.00 to read as $10 but I cannot get regular text like:  over-sized to read as oversized
More examples of text I'm trying to convert:
over-sized to oversized
CAT to CAT(R)   (adding the registration mark)
screenprint to screen print
Is this possible with this script?? There's over 100 words that follow this mindset. The custom dictionary isn't something that works, as it only checks for single words and not 2 words with a space inbetween.
Anything would be helpful.
Thanks!

Hi Trevor:
I have to admit, I like your script (The syntax for the arrays is pretty clean, esp. with the tags) but we don't need to completely reinvent the wheel, and we have a lot of functionality within the FindChangeReplace script that wouldn't need too many more additions.
nukleas wrote:
 There is the conflict of case sensitivity and some words you don't want to close up. A good example of this is in official titles (So you don't want to close up Over-All Program Goals 2012, but you are fine closing up over-all goals or over-stated nature.
By adding a tag at the begining of words one wants to be stictly case sensertive one can deal with this
By useing slice and toUpperCase() one can make sure that over-sized becomes oversized and Over-sized becomes Oversized.
In the case that one only wants the upper case to be changed that would not need tagging i.e. in our example only CAT would become CAT®, cat would stay the same.
To avoid Over-All being closed one also would not need to tag it because of the capitol A of All.
One would only need to tag something like Over-all if one did not want it to become Overall but wanted over-all to become overall.
True, but why don't we just add this to FindChangeReplace:
grep     {findWhat:"(Over|over)-(?!\\u|\\d)(\\S*)"}     {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
This way we don't need to write any more javascript code, and we preserve the features from that script, especially the option to do the search on individual stories or selections rather than the whole document, which is default for the script (I see these things usually from an inCopy standpoint, where you are working closely with the text) Having an easily editable text document as a list of things is probably not a bad idea either.
We also catch any hyphenations of digits (which we ought to keep hyphenated) or uppercase letters and keep whatever formatting existed previously with a single entry.
nukleas wrote:
Also, if whole word is turned on in the given regular text search example, over-size will not be converted to oversize. over-sized would be converted to oversize.
True, over-size would not be converted to oversize unless over-size was included in the word list.
False, over-sized would be converted to oversized and not oversize
Check the spelling in the script >.> (Yes, this is kinda pedantic, I apologize)
nukleas wrote:
This is also a concern copy editors have with closing up schoolteacher. In most cases it's fine, until you have a teacher that works at a high school. A high school teacher should probably not be written as high schoolteacher (although I'm sure some of them need to be to deal with some of today's youth.) and that's only really avoidable with a negative lookbehind.
This can easily be dealt with by adding in the array after the entry of ' school teacher'  , 'schoolteacher'
'high schoolteacher' , 'high school teacher'
see script below
Or in one line:
grep {findWhat:"(?<![high|elementary|middle] )([S|s]chool) (teacher)"} {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
Using the FindChangeReplace, we basically configure the text or grep search each time, so if we want, we can have something like this:
Makes million/billion/trillion units not break over lines:
grep     {findWhat:"(\\d+) (mil|bil|tril)(?=lion)"}     {changeTo:"$0",noBreak:true}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
This way we don't need to set about defining tags, since the way the script is written we can just call them when we need them.
And in this case, wouldn't we be in trouble if the query we wanted has a semicolon or something at the beginning of it? This can be the case in changing delimiters and other things. By defining options outside of the query, we better sanitize the query from errant symbols.
I think it might be best to also avoid changing things in the first place (like school teacher to schoolteacher and then backtrack with high schoolteacher to high school teacher) and the more exceptions or backtracks we need to make, the more likely errors will make it through.
Then again, for some, if not most changes that need to be made without exceptions, regular text search is fine. However, there can be a lot more errors introduced without lookaheads or lookbehinds than it could be worth, and this is one of the things that keeps copy editors like me employed
Also, with the script, why keep Pussy cat if it begins the sentence? The example would be perhaps the Pussy Cat Lounge, in that case you dont want to close that up or change that. However: Pussy cat is another term for a feline. Would not get changed, but it ought to. The script catches school teachers and high school teachers correctly, but not "School teachers are important to our nation" and (correctly) School Teacher's Association. These may need different capitalized versions of each type, or would possibly be better with grep and just brackets with both types alone. Case insensitivity in the grep can also preserve the capitalization of the original text, whereas I believe the text replace would change it to whatever the result is that is provided.
grep     {findWhat:"([pP]ussy) (cat)"}     {changeTo:"$1"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
(and the problem with this, that I would have to get to later, is that the plurals need to be dealt with)
All in all, I don't think it truly matters whether one uses GREP or text for such changes (it's actually best to know both!) and I appreciate you laying out how to perform these searches using javascript, I have definitely learned from it!
I apologize for any errors, I typed this quite fast D:
Many thanks Trevor,
Nukleas

Similar Messages

  • I have a Text control string box with some initial text. I would like to highlight old text with click of mouse and type in new data from keyboard

    I have a text control string box with some initial text (says: Please enter Name). I would like the operator to click on the text control box and have it automatically highlight so that when new data is typed in the old erases (all at once) and the new data is now in the text box.
    I tried using the "Text.Selection" property node and when I run it and put the mouse inside the text box the initial text is highlighted and if I press "delete" on the keyboard or if I start to type in new data the initial data does delete but once I start to type new characters they erase each other. For example if I want to type in “Willi
    am” I type the “W” and then the “I” but the “I” erases the “W” and now I am only left with an “I” in the text box and so on. I appreciate any help

    It seems you are continuously setting the property node over and over again. This should only happen once if you mouse over it.
    Create a property node for your text control with the following three items:
    (1) KeyFocus (wire a "true" constant to it)
    (2) Text.SelStart (Wire a "zero" constant to it)
    (3) Text.SelEnd (Wire a constant containing the string length of the text).
    Put this property node inside an event structure, triggered by "Mouse enter" on the string control.
    (see if the attached example works for you)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Enter_Name.vi ‏23 KB

  • How do I copy an entire string of text messages to email?

    I want to save a long string of text messages and export to email.
    On first try I can press "edit" select a few messages (worked for up to 14) and press "forward" to get them into email
    How do I copy the whole lengthy string of many texts?
    The copy/paste function would be tedious and take forever.
    On my iPhone, it allows one transfer, then no more will be allowed unless I reboot, then only one allowed again.
    Is there an easy way to load ALL texts (pref
    with time/date stamps)?
    Thank You

    Press and hold on a message, tap More > Select the messages you want > Tap the arrow > copy everything out of the new message that appears

  • Is it possible to save an iPhone back up and access the files later if needed?  I have a string of text sms and iMessages that I would like to save and then delete them from my phone.  Is this possible?

    I have a string of text sms and iMessages that I would like to save and then delete them from my phone, but gain access to them later if I need them.  I prefer to have the string with the date/time stamp vs copying and pasting into a doc or text file.  Is this possible?

    Not unless you buy an app that accesses data from an iTunes backup.  Check in the app store.

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • Write into existing file with "write to text file"

    Hi all,
     I have a text file that contains several lines of data (text). Now I would like to replace the first three lines with text coming from a string array.
    My approach is shown in WriteToFile.vi that is attached.
    When I am executing this vi (with an empty file), everything seems to be working fine in the first place.
    The file will contain the following text:
    oneoneone
    twotwotwo
    threethreethree
    Now, when the third element in the array is shortened (lets say to "threethr") before execution,  the file will contain  the following text:
    (the file was not emptied before execution)
    oneoneone
    twotwotwo
    threethr
    three
    How can I avoid the last line being written? I have made many tests and I could not find a solution.
    One more example:
    Lets say we have an existing file, inside this file is:
    oneoneone
    twotwotwo
    three
    fourfourfour
    Now I would like to overwrite line three with "threethreethree". Therefore I execute my vi as shown in the attachment.
    What I get as a result is:
    oneoneone
    twotwotwo
    threethreethree
    ur
    So, the text in line four, which should not be touched, is "ur" instead of "fourfourfour".
    Any idea to solve this problem?
    What I basically need is replacing a line of a text file in a conveinient way.
    Thanks,
    Holger
    LV 8.5.1
    Attachments:
    WriteToFile1.jpg ‏17 KB
    WriteToFile.vi ‏11 KB

    The remaining fourth line is there because the third line has a <nl> at the end. You have not emptied the file so the rest of the file will be kept. This is because your line is shorter.
    In the scond example the third line is longer and it will overwrite the beginning of the fourth line.
    Files aren't organized in lines they are oganized in bytes. And what you write are bytes to the file even with text files.
    Replacing a single line in a file is done by reading the file line by line. All unchanged lines are written to a temporary file and the line with the new text will be written instead of the original line to the temporary file. When the writting is done rename the original file, then rename the new file into the original file and then delete the renamed original file.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • [svn] 3246: Fix fasttrack bug SDK-16910 - Simple List populated with strings throws RTE .

    Revision: 3246
    Author: [email protected]
    Date: 2008-09-17 15:31:25 -0700 (Wed, 17 Sep 2008)
    Log Message:
    Fix fasttrack bug SDK-16910 - Simple List populated with strings throws RTE. This is fallout from the Group/DataGroup split. DefaultItemRenderer now uses a TextBox instead of a Group to show the list data.
    QE: Any List tests that depended on the default item renderer to support anything other than text must be updated.
    Bugs: SDK-16910
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16910
    http://bugs.adobe.com/jira/browse/SDK-16910
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/flex/skin/DefaultItemRenderer.mxml

    BTW, I do not experience the bug you had mentioned at
    http://www.cs.rit.edu/~cxb0025/flex/TreeControlBugs.html
    Can submit a video of my actions recorded

  • Embedded fonts with rich editable text

    Hi, I am trying to use my embedded fonts in rich editable text field, but it only works for users that already have that font installed on their system.
    This is what I do.
    I embed fonts like this:
         @font-face {
                src:url("fonts/Cantarell-Regular.ttf");
                fontFamily: Cantarell;
                advancedAntiAliasing: true;
            @font-face {
                src:url("fonts/Cantarell-Bold.ttf");
                fontFamily: Cantarell;
                fontWeight: bold;
                advancedAntiAliasing: true;
    Then in my DropDownList (id=fontPicker) I add a new string entry that references my new font (in this case "Cantarell")
    I have a custom item renderer which makes sure to print out the name of the font using the font itself, so that for example font name "Cantarell" will be printed out using Cantarell font. Code in my custom font item renderer looks like this:
    <s:Label id="labelDisplay"
                 fontFamily="{data}"
                 verticalCenter="0"
                 left="3" right="3" top="6" bottom="4"/>
    And this part works, even if you dont have the font installed on your system, the name of the font is displayed propperly.
    The thing that I want to do is to select some text in my rich editable text field and change the font of the selected text depending on what user selected from the dropdownlist. I added an event which is called once user selects new font type, and it performs following code on the selection in rich editable text:
                   if(fontPicker.selectedIndex == -1){
                        //user did not select anything, we do not change the font
                        text.setFocus();
                        return;
                   //we get the text layout format of the selected text
                    var txtLayFmt:TextLayoutFormat = text.getFormatOfRange(null,text.selectionAnchorPosition,text.selectionActivePosition);
                   //we change fontFamily of the selected text to the font that we just picked
                    txtLayFmt.fontFamily = fontPicker.selectedItem;
                    // I even tryed to add those two following lines without much help
                    //txtLayFmt.fontLookup = FontLookup.EMBEDDED_CFF;
                    //txtLayFmt.renderingMode = RenderingMode.CFF;
                   // we update our selected text with new font
                    text.setFormatOfRange(txtLayFmt,text.selectionAnchorPosition,text.selectionActivePosition );
                    text.setFocus();
    This code works perfect if user has the font installed on their system but it does not work if they dont have the font even if I embed the font.
    What I am doing wrong, any suggestions, tips, links?
    Thanks,
    Dal

    Thanks I will take a look at your blogs, maybe I find some explanations.
    Once it comes to my problem, I found a solution, I just needed to add a simple style:
            .mystyle1 {
                 fontFamily:Cantarell;
    and set the styleName of my text to it:
    text.styleName = "mystyle1";
    Afterwards I can dynamically change fonts and sizes of the text selections in my rich editable text field as much as I like.
    Also I need to make sure that I set embed-as-cff: true;
          @font-face {
                src:url("fonts/Cantarell-Bold.ttf");
                fontFamily: Cantarell;
                fontWeight: bold;
                advancedAntiAliasing: true;
                embed-as-cff: true;
    I hope this helps someone.
    And if anyone has explanation to why embedded fonts work only after I change styleName of a text to a random style, please share with me.
    Cheers,
    Dal.

  • Help with string object code

    Hello,
    First off thanks in advance to anyone who helps. I am trying to write a program that using a class string object to convert this kind of "text speech" to english. For example if the user inputs "HowAreYou?", I want the program to output "How are you?" I am having too much trouble with strings for some reason. This is what I have so far and I am not sure where to go from here. Should I use a do loop to check through the input string until it is done seperating the words? And how should I go about doing that?
    import java.util.Scanner;
    public class P8
    public static void main( String args[] )
    char choice;
    String line = null;
    String answer = null;
    Scanner scan = new Scanner(System.in);
    do
    System.out.println();
    System.out.print("ENTER TextSpeak sentence(s): ");
    line = scan.nextLine();
    System.out.print( "Converted to English: \t ");
    System.out.print( textSpeaktoEng( line ) );
    System.out.println();
    System.out.print("Want more TextSpeak?\t\t ");
    answer = scan.next();
    choice = answer.charAt(0);
    if( scan.hasNextLine() )
    answer = scan.nextLine();
    }while(choice != 'N' && choice != 'n');
    public static String textSpeakToEng(String s)
    String engStr = null;
    if( Character.isUpperCase( s.charAt(j) ) )
    engStr += ? ?;
    engStr += Character.toLowerCase( s.charAt(j) );
    scan.close();
    }

    I got my program to compile and run but I have a problem. If I input something like "ThisForumIsGreat" it will output just "t f i g" in lower case letters. Any suggestions?
    import java.util.Scanner;
    public class P8
    public static void main( String args[] )
       char     choice;                          // Repeat until n or N                                             
       String line   = null;                     // Sentences to toTextSpeak
       String answer = null;                     // Repeat program scan
       Scanner scan = new Scanner(System.in);    // Read from keyboard
       do
          System.out.println();
          System.out.print("ENTER TextSpeak sentence(s): ");
          line = scan.nextLine();                // Read input line
          System.out.print( "Converted to English: \t    ");
          System.out.print( textSpeakToEng( line ) );
          System.out.println();
          System.out.print("Want more TextSpeak?\t\t ");
          answer = scan.next();                  // Read line, assign to string
          choice = answer.charAt(0);             // Assign 1st character
          if( scan.hasNextLine() )               // <ENTER> character
            answer = scan.nextLine();            // Read line, discard
      }while(choice != 'N' && choice != 'n');    // Repeat until input start n or N
    public static String textSpeakToEng(String s)
       String engStr = null;  
       int i;  
       for ( i = 0; i < s.length(); ++i )
       if( Character.isUpperCase( s.charAt(i) ) )
         engStr += " ";                                  // Append 1 blank space
         engStr += Character.toLowerCase( s.charAt(i) ); // Append lowercase
       return( engStr );
    }

  • Extract specific letters from a string of text

    Hello,
    I have an idea that I would like to implement into Numbers but I'm not quite sure how to do it, or even if it is possible. What I would like to do is replace a multitude of checkboxes with one cell. In that one cell I will have a string of text, with a letter representing a condition. From this one cell, I would like to be able to extract a certain letter into its own cell and then hide the multitude of cells.
    My idea is to eventually just be able to type the conditions into a single cell, extract the letter of the certain condition into another cell, and then extract that information into another table, all the while hiding all of the auxiliary columns in the original table. Because it would be much easier and prettier to simply type a bunch of letters into one box instead of having to check a bunch of boxes, no?
    For example Left Header Row 1 would contain the letters BMRT. Column A would return a "FALSE" value, while Column B would return "B" or "TRUE." Columns C through L return "FALSE," etc.
    In Left Header Row 2 we would have the string AJQTVZ, for instance. Column A would return "A" (or "TRUE"), and Columns B through I would return "FALSE."
    Is it possible to write such a formula? Or is there an easier way to be thinking about this problem?

    Let's start with the easy part.
    Cells on a Numbers table can contain data entered directly, or can contain a formula. They can't contain both. That means you cannot 'type the conditions into a single cell' in column A ("the left header" cell) AND have a formula which sets that cell to TRUE if the typed in data contains an "A".
    There's no problem doing this using column A as the key holder and columns B:Z to hold the TRUE/FALSE results, staring in both cases on row 2.
    Here's an example
    The column header cells (row 1) contain the letter corresponding to that column.
    The row header cells (starting at row 2) contain the 'bunch of letters' you describe. Note (A4) that the letters do not have to be entered in any particular order, and that extraneous characters (eg. a space) are ignored.
    The formula shown is entered B2, and filled down and right from there.
    =IFERROR(FIND(B$1,$A2)>0,FALSE)
    FIND returns the position of the first occurrence of the target string (in this case, the single letter at the top of the column) in the search string, then compares that with the value zero. For any letter that is included in the search string, the find value will be at least 1, so the comparison will return TRUE. If the target letter is not found, FIND returns an error. IFERROR traps this and returns FALSE.
    Since the target depends on the letter at the top of the column, all that's needed to extend the range of possible letters to the full alphabet is to enter an A in cell B1, then run through the alphabet A to Z, with Z in cell AA1.
    Depending what you want to do with the TRUE or FALSE values in these 26 columns, it may be possible to skip the auxiliary column step and use a formula similar to the one above as the condition argument of an IF(condition,do-if-true,do-if-false) statement.
    Regards,
    Barry

  • Help With String parsing

    Hey guys,
    I need some help with String Parsing. i hope experts here will help me.
    i'm reading a text file and getting data as String in this format
    *ABR, PAT MSSA        2009       7001    B   ABC       Y
    *VBR, SAT ZSSA        2008       5001    A   CED       N
    *ABC, AAT CSSA        5008       001     A   AZX       N
    *CBC, CAT FSSA        308        5001    A   XCV       N
    Now from following lines i have to extract Number data i.e. 2009 and 7001 from 1st line. 2008 and 5001 from 2nd line and so on.
    Can anyone pls suggest me any way to get the data that i want from these Strings
    Thanks for your time to read this.
    Regards,
    sam

    Thanks for the reply
    Data length can vary. ABR, PAT is the last name, First Name of the Users.
    it can be following or any other combination. i just need 2 set of numbers from the complete line rest i can ignore. Any other way to get that
    *ABRaaassd, PATfffff MSSA 2009 7001 B ABC Y
    *VBRaa, SATaa ZSSA 2008 5001 A CED N
    *ABC, AAT CSSA 5008 001 A AZX N
    *CBC, CAT FSSA 308 5001 A XCV N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Comparing data in the database with the input text

    hi there i have problem with the comparing data in the database with the input text. here is the piece of code of mine:
    //declaration
    datasourcedb.connect();
    String stcode = req.getParameter("txtCode");
    ResultSet rs = null;
    String action = req.getParameter("action");
    ResultSet portquery = null;
    if (action.equals("SELL"))
    -->portquery = datasourcedb.query("SELECT stockcode FROM portfolio where stockcode =\'"+ stcode + "\'");
    -->portquery.next();
    -->if((portquery.wasNull()) == true)
    disp = req.getRequestDispatcher("error.jsp"); }
    else */
    Status = "Sell";
    datasourcedb.close();
    with the code that i marked with --> it doesnt work since i have to compare the input text stcode with stockcode in the db. could anyone tell me how to compare it?
    regards
    virginia

    i have try to change into this code:
    if (action.equals("SELL"))
    portquery = datasourcedb.query("SELECT distinct stockcode FROM portfolio where stockcode =\'"+ stcode + "\' + and userName = \'"+ user + "\'");
    if(portquery.next()) {
    Status = "Sell";}
    else {               
    disp = req.getRequestDispatcher("error.jsp");
    but so far the coding doesnt give any result.... could anyone help me? since the coding does not reach status n the disp

  • LineBreakMeasurer with anti-aliased text

    Hello,
    I am developing an application, which needs to render anti-aliased text. The application uses LineBreakMeasurer for text layout. Without anti-aliasing, LineBreakMeasurer works perfectly. However, when I turn anti-aliasing on, the text lines returned by LineBreakMeasurer.nextLayout() are too long (that is, longer than the specified wrapping width).
    For example, if I call
    TextLayout layout = measurer.nextLayout(92.0);
    then
    layout.getAdvance()
    might return 101.0.
    Has anybody been able to make LineBreakMeasurer to work with anti-aliased text?
    Thanks,
    -Tero

    My english is not so good, I hope this help to you.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.event.*;
    import java.text.*;
    public class ParagraphLayout extends JFrame{
      public static void main(String[] args) {
        JFrame f = new ParagraphLayout("ParagraphLayout");
        f.getContentPane().add(new Test());
        f.setVisible(true);
      public ParagraphLayout(String title) {
        super(title);
        createUI();
      protected void createUI() {
        setSize(500, 400);
        center();
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            dispose();
            System.exit(0);
      public void center() {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = getSize();
        int x = (screenSize.width - frameSize.width) / 2;
        int y = (screenSize.height - frameSize.height) / 2;
        setLocation(x, y);
    class Test extends JPanel{
           public Test(){
                super();
          public void update(Graphics g){
               paintComponent(g);
          public void paintComponent(Graphics g) {
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                RenderingHints.VALUE_ANTIALIAS_ON);
            // From _One Hundred Years of Solitude_ by Gabriel Garcia Marquez.
            String s = "Jos\u00e9 Arcadio Buend\u00eda spent the long months " +
               "of the rainy season shut up in a small room that he " +
               "had built in the rear of the house so that no one " +
               "would disturb his experiments. Having completely abandoned " +
               "his domestic obligations, he spent entire nights in the " +
               "courtyard watching the course of the stars and he almost " +
               "contracted sunstroke from trying to establish an exact method " +
               "to ascertain noon. When he became an expert in the use and " +
               "manipulation of his instruments, he conceived a notion of " +
               "space that allowed him to navigate across unknown seas, " +
               "to visit uninhabited territories, and to establish " +
               "relations with splendid beings without having to leave " +
               "his study. That was the period in which he acquired the habit " +
               "of talking to himself, of walking through the house without " +
               "paying attention to anyone...";
            Font font = new Font("Serif", Font.PLAIN, 24);
            AttributedString as = new AttributedString(s);
            as.addAttribute(TextAttribute.FONT, font);
            AttributedCharacterIterator aci = as.getIterator();
            FontRenderContext frc = g2.getFontRenderContext();
            LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
            Insets insets = getInsets();
            float wrappingWidth = getSize().width - insets.left - insets.right;
            float x = insets.left;
            float y = insets.top;
            while (lbm.getPosition() < aci.getEndIndex()) {
              TextLayout textLayout = lbm.nextLayout(wrappingWidth);
              y += textLayout.getAscent();
              textLayout.draw(g2, x, y);
              y += textLayout.getDescent() + textLayout.getLeading();
              x = insets.left;
    }

  • Stopping Nested style with string

    I know this is a dumb question but I can't remember how to do this and I can't find it anywhere!
    How do you stop a nested style with a string of text versus a list.
    I have a paragraph with the same word that I want to change nested styles off of "bibliography." If I type this in if just keys off any "b" since it just looks at the word as a list.
    I thought you surrounded in quotes like any string but that doesn't work. Any help would be appreciated.
    Thanks

    If you want just the word 'bibliography' affected, and it's arbitrarily used only once in the paragraph, then you can get away with only one ENSH character. Just trigger the style to switch off through the next 'y'. If you're using CS3 and have no other nested style going on in the paragraph you can loop it so that all occurrences of '[ENSH]bibliography' are affected.

  • Array access notation with strings?

    I may be confused, but I thought you could use array access
    notation with strings. Can someone tell me why this code doesn't
    work (or suggest new code):
    the code is meant to rewrite the block of text in tText at a
    rate of one character per frame... (when the function is called
    once per frame) but it doesn't work.

    DZ-015,
    > I may be confused, but I thought you could use
    > array access notation with strings.
    It's made for objects, actually. The array access operator,
    [], allows
    you to access elements from an Array instance and also lets
    you access
    properties from any sort of object. The "trick" it provides,
    in this latter
    case, is that you can refer to these properties -- within the
    brackets --
    with strings, so it's often used to reference objects
    dynamically.
    > var sWorkingText:String = tText.text;
    Here you've declared a String variable and set it to the
    TextField.text
    property of some textfield. So far, so good.
    > var sNewText:String = oPhotoText[sPageFocus];
    Here, you've declared a String variable, but it seems that
    you're
    setting it to a property of the oPhotoText object. That's now
    how this
    works.
    The array access operator allows you to *use* strings to get
    at an
    object's properties:
    // functionally equivalent
    someObject.property1
    someObject["property" + 1];
    var x:Number = 1;
    someObject["property" + x];
    Does that help?
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

Maybe you are looking for

  • How is someone able to pair their Arc Touch Mouse with my Macbook Pro?

    I had this happen a few times now and it's both annoying me and scaring me at the same time.  I am sitting in my office working away and then all the sudden, my mouse starts moving around randomly. I quickly go up to the Bluetooth menu, and I see the

  • Need help with ODBC Connections in Adobe LiveCycle

    Hello I have designed a form for my company that uses a database to populate a few fields on the form. I am unable to get it to work correctly without acrobat pro installed. I am using using xfa.sourceSet.DataConnection but as I said it will only wor

  • Conversion Error in J1IIN

    Hi experts, We are getting dump as conversion error in J1IIN . BED field is getting negative value for that its giving conversion error. That's mean the domain value of the BED field is not accepting the negative value . Please suggest me how can i h

  • I HAVE WIFI CONECTION PROBLEM

    I HAVE IMAC BUT UNFORTUNATELY MY WIFI COANNECTION EVERY MINUTE DISCONNECT I USE VERIZON FIOS. WHAT SHOULD I DO?

  • OBIEE Data Modelling queries

    Hi, I am trying to create a data model for the OBIEE reporting from a source database. I have a fact table that looks like the below Fact-Key Customer_id Facility_id market_value_amt Coll_key Guar_key Derivative_key ==================================