Compositing text modifications with font size modifications for undo

Hey TLF gurus,
So here's my situation.  I have a text flow.  The user starts typing "The lazy brown dog..." and after each character is typed I'm modifying the font size of all the text to make it fit inside the container.  Here's how I'm doing that: http://aaronhardy.com/flex/size-text-to-container/ (you can right-click the app to see the source).
That all works well, but undo isn't working so well.  When I hit undo, I would like it to remove the text.  But when I call undo on the undo manager, it gets to EditManager.performUndo() where it checks to see if operation.endGeneration is different than textFlow.generation.  In my case, they aren't the same because I updated the font size after the last keystroke.  Because they're different, the undo fails.  Because I updated the font size after the last text insert, TextFlow.processModelChanged() was called and increased the text flow's generation while the insert text operation's end generation stayed the same.
Ultimately I think I want to create a composite operation that contains any text modifications with their following text auto-sizing.  Either that or I want to prevent my font auto-sizing operation from affecting the text flow generation.  Either way, I'm not sure how to go about pulling it off.  I'm sure I can make some sweet hacks but I'd really appreciate some guidance.  Thanks.
Aaron

I'm able to successfully merge the sizing operations with the text operations.  I did it in a round-about way but afterward I found a more appropriate way: executing the ApplyFormatOperation by calling back into EditManager.doOperation when the FlowOperationEvent.FLOW_OPERATION_END event is dispatched from TextFlow (essentially making it recursive).  This way the EditManager will composite the operations.  This is described pretty well in the code and documentation of EditManager.doInternal().  I didn't test it, however.
Instead, for a couple reasons I decided not to go with that plan at all but instead went with my Plan B which was to prevent my font auto-sizing operation from affecting the text flow generation.  I essentially want the auto-sizing to occur without it going into the undo history, modifying the text flow generation, etc., etc.  I want it to go incognito.  The way I did this was to store the text flow's generation, make the font size modifications, then set the text flow's generation back to what it was before the font size was applied.  This may have some negative repercussions but for now I think it's the best approach for my needs.
Thanks for letting me talk to myself!  Feel free to add ideas.

Similar Messages

  • How to define the same font size,color for a text field label

    hi all,
    In my project i need to define the same font size & color for all the text field lables in the application.how do we can achieve this?
    Thanks & regards,

    ...or you could use declarative components....
    Not sure if skinning would prevent developers from overriding a look and feel??? hmmm not sure..
    Grant

  • Problem with font size, not showing up as expected.

    I've been wrestling with this for a few weeks now, but surely must be getting closer to having it resolved. It's just a problem with font size on just this one page.
    http://www.kgngroup.net/logos_and_packaging.html
    I want the body text to be 10px, but after two weeks, have played with every conceivable way, altering body font size in CSS and in the document itself. I've viewing it in Safari but others on Windows machines tell me that it is out of whack also.
    My main problem is that I can change the font size to extremes but it still shows up as the same size in the browser (about 12px.) I know changes can be made because I can modify the wording and that does change online. It's just a problem with the font size. Oh, and in the third column, the one to the right, in Dreamweaver, the font looks like it is miniscule, cannot even be read, but in the browser, since the style11 is applied, all three columns look equal size.
    Not sure where to go from here. I just want to get the body font down to 10 pixels.
    TIA,
    Ken

    John Waller wrote:
    I guess this a follow up to your earlier thread
    http://forums.adobe.com/message/3627681
    What would really help you in diagnosing issues such as this is to install the Firebug add-in for Firefox (as suggested in the earlier thread).
    Firebug shows you visually what CSS rules apply to whatever element you click on the screen.
    In this case, you have a confusion of CSS font sizes cascading on top of each other and that's confused again by mixing units for no real reason. .style11 is unnecessarily applied to lots of individual <p> tags. Remove those classes and delete the rule.
    e.g.
    The tiny font in the RHS column is affected first by
    .style8 {
    font-size: 0.5em;
    affecting the <td> then by
    .style11 {font-size: 75%}
    affecting the <p> tag.
    End result = tiny text (approx 2px).
    In these cases of mass confusion, my approach is to strip out all font sizing from the CSS and start over.
    Avoid %. Use px.
    Apply font sizing rules logically starting from the <body> tag downwards.
    That'll give you a solid baseline without weird effects.
    Ah, I find your answer worth repeating.
    Very cool that you have diagnosed so well and spelled it out here.
    I will get the Firefox add-on you mention, plus, print out this response and follow it like a recipe.
    It makes perfect sense and you have saved me from the 'clutter' of being wound up in too many directions with this because I could not make all of the connections that you have done here. I appreciate your help very much.
    Thank You,
    Ken

  • HELP WITH FONT SIZE

    Hello,
    In Dreamweaver, how do I change the dropdown menu of font size to ENUMERATED? I went into the CODE FORMAT and could not do it there. I would rather work with the numbers for font size than the small, medium, large, etc. Any help appreciated.
    [email protected]

    You'll get better cross browser results with ems or pixels.
    CSS
    html {font-size: 100%}
    body {font-size: 1em}
    h1 {font-size: 2.5em;}     /* 40px/16=2.5em */
    h2 {font-size: 1.875em;} /* 30px/16=1.875em */
    p {font-size: 0.875em;}  /* 14px/16=0.875em */
    or
    h1 {font-size:40px;}
    h2 {font-size:30px;}
    p {font-size:14px;}
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • When I put Pages in fullscreen my bar with fonts, size, and format disappears

    in old pages, in fullscreen i could scroll my mouse up and i would get the fonts, size, and formant, etc. bar. but now it just disapeares?  
                                                                     |
                                                                     |
                                                                    V

    Are other apps working fine in full screen? Just Pages?
    It is working for me, so perhaps a restart to see if that helps?
    But like many, I am sticking with the old Pages for now.

  • Added large text but small font size ?

    I've used 48 pt text on my document, yet now it is showing as 9 pt even though the size of the text is still big.  Why is that?

    Text(Type) is very complex and pt size is very confusing it can be set to 72 points per inch or 72.27 points per inch and inches is relative to document resolution.  Text(Type) can also be set to Pixel which is an absolute value, set to millimeters a unit relative to resolution  or set set to point units which has one or another value which are relative to inche when inches is relative to resolution  pixel size.  In scripting the only way I seem to be able to do any calculations is to first save a document current resolution. Then change the document resolution to 72 pixels per inch, use type units set to points, Have Photoshop point  value set to 72 per inch  not  72.27 points per inch.  So there are 72 Pixels per inch and there are 72 pixel per inch.  Pixels and Point are currently the same size and number.   I then can seem to do the math add the text the size I want. I then  can restore the document to its original resolution and let Pixels and points go their the merry way.  It all make my head spin and ache.   It is simple to see how complex text is. Look at you Photoshop's Preference units page,  record an action that add a simple text layer.  Expand that action's "make text layer" step to get an idea of how complex text is. Even to record an action with a goot font size you need to know the document inches size. note the script is user to record the documents resolution into its metadata the Image size scale the image to a known width resample is not checked only the document resolution is changes pixels do not.  The add test let font size works foul image that are that known width.   Later that script is used again  by the action to remove the saved resolution recorded in the meta data and restores the document to its origional resolution size.

  • I am experiencing an issue with font size on a calender... see below

    Apple discovered an issue with the file you submitted. The font is
    inconsistent in places, and we want to make sure your calendar turns
    out just the way you designed it.  We’ve canceled your order— you won’t
    be charged, and we have some suggestions for correcting the issue.
    Please update iPhoto, change the theme of your calendar, then change it
    back to the original theme.
    Once completed, confirm the issue has been resolved by previewing your
    calendar in iPhoto. Then place the order again once you’re satisfied
    with how the calendar appears in preview.
    If the issue persists after changing the theme, please contact Apple
    Support for assistance. Just visit
    <http://www.apple.com/support/iphoto/> and click “Get started” in the
    upper-right hand corner of the page.
    the fix is not working, I am using iPhoto 11, latest version, and trying to build a picture camera. Essentially the dates have gone really small. I can share a PDF.

    See the More Like This section at the right.  One user explained how to edit a file in the application to fix the problem of date and day fonts reverting to 6 pt. if any font size was changed.
    OT

  • Is iOS 7 making email font size inconsistent for anyone else?

    Since I installed iOS 7 to my iPhone 5, my incoming emails are varying wildly in font size. Some of them are normal and some are tiny. If I enlarge the text size in settings, the normal emails and all my text messages take on a huge font size.
    Is anyone else having this problem, and what do I do?
    Thanks. 

    Yes and it's annoying.

  • PhotoShop Elements 10...I need help with font size for watermark in Processing Multiple Files.....

    I have PhotoShop Elements 10, and I am trying to watermark some of my photos, I have successfully added them one at a time with a font large enough to be seen. Now I am trying to add it using the "process multiple files" , I can do that but the font even at 72 the largest setting is so small on the photo you can barely read it! Can anyone help me the size larger on my photos?

    Thank you, Michael. I just watched the Russell Brown video again for CS6 and looked real closely at his settings in ACR and he was using 240ppi. I changed my file in image size to 240 ppi and then ran the script and the layer didn't change size this time when I ran the script.
    It is kind of annoying to have to change the image size everytime I want to run this script and then change it back again as most of my files are 300 ppi. I used to run his script for edit in ARC in CS5 and recall that if I just remembered to change the settings in ARC to 300 ppi while the script was playing and before pressing 'open' that the image wouldn't change size during the raw processing, but this doesn't seem to be working in CS6. Do you know of a way to use this script and not have to change the ppi for the image to 240?
    Thanks again.

  • Forms: How to set a maximum size in Text Fields with automatic size

    ¡Hi!
    When I set a text field on my forms and I use automatic size for te text that the user can write, if the user don't need more space than the field size, when the text appears, Adobe Acrobat Pro always set the text-size to 14 or higher. How can I set a maximum size for that text? For example... 12 or 10...
    Thank you very much,
    Best regards from Spain,
    David.

    Ok. If I use a single line text field, changing the height of the field seems to be a simple way to solve the problem, but... what should I do when the fields are multi-lineal?
    Thanx for your quick answer.

  • How do I reduce the font size & icons for mailboxes?

    I use a LOT of mailboxes and subfolders. In Yosemite, these have become too big. How do I make the mailbox icons and fonts smaller?

    Can you attach a [http://en.wikipedia.org/wiki/Screenshot screenshot]?
    Use a compressed image type like PNG or JPG to save the screenshot and make sure that you do not exceed the maximum file size (1 MB) and do not click Preview after you have attached the image.
    The default system font that is used in all programs is used on the title bar.<br />
    If that doesn't show properly then you may have a problem with the used font
    Control Panel > Display: Appearance > Advanced > Active Title Bar

  • CS6 menu font size change for QHD screens windows 8.1?

    all menus etc too small to read on laptop with qhd screen (3200 x 1800) Other software is all OK, just CS6 and a few others that cannot adapt. is there a solution?

    Trevor only Photoshop CS6 for Mac OS released an update for HiDPI displays.  You can find additional details at HiDPI and retina display support FAQ.

  • ¿Custom button with different size/shape for rollover state in Muse?

    Hello, i'm trying to make a custom button, that has one size/shape when normal, and other size/shape when rollover.
    The problem is that the area not visible in normal state is a hot area, so when then mouse rollover anywhere near, activates the button rollover state.
    So i think what i need is mask or something like that
    Is there a work around to do this? Is even possible in normal CSS - HTML5?
    Here is the website:
    http://www.audime.com/prueba/
    And here what i'm talking about:
    Thanks in advance!

    I'm not fully understanding the screenshot, but what you're describing sounds more like a Composition:Tooltip widget than a button.

  • Text box-different font sizes in one box

    Sorry. I am new to final cut.
    I am trying to put text but want the citation underneath to be much smaller. How do I do this?

    Use Boris Title 3D.  Built in...

  • Will Adobe ever fix the UI text font size issues in CS6 apps?

    Having recently installed CS6 on my new Windows computer, I find some serious issues with font sizes in the user interface (and not only in Dreamweaver, but in several--but not all--the applicaitons). You'd think that with a 27-inch screen, font sizes wouldn't be a problem. And you'd be wrong.
    The irony is that some text is properly sized. Commands in the menus. For example. But the menu names are not. The text of items in the File tab is correctly sized, but the name of the File tab is not. In the Manage Sites dialog box, the title bar text is properly sized, but the text within, including button labels, is not. IN almost all of these cases, text is just plain way too small to read. It looks like the programmers made a HUGE boo-boo: they sized text in pixels, not only a no-no in web diesgn, but a no-no in applicaiton design.
    Because on a 27-inch screen with a resolution of 1920x1080, UI text in Dreamweaver is all plenty large and readable, while on a 27-inch screen with a resolution of 2560x1440, UI text all over the applicaiton is too tiny to read--and made worse by putting the text on a gray background, reducing contrast, yet another design no-no.
    CC is NOT an option--and properly should not be for any occasional user. Do not even think of suggesting it as a "solution."
    This is clearly a bug (did Adobe do any testing on higher-resolution screens before releaseing CS6?), and one I wonder if it is unique to Windows systems (as Apple has had similarly high-resolutiopn screen for its displays and iMac lines for quite some time now). Or is it uniquely a Windows 8 issue?
    Finally, is there at all a workaround? I can find nothing in the Settings dialog box that would control the size of UI text. Perhaps there is a text-based configuration file that could be modified to change the size of UI text. (Yeah, having configured autoexec.bat, config.sys, win.ini, and similar files back in the day, I do know my way around configuration files--if they are still used.)

    twritersf wrote:
    Having recently installed CS6 on my new Windows computer, I find some serious issues with font sizes in the user interface (and not only in Dreamweaver, but in several--but not all--the applicaitons). You'd think that with a 27-inch screen, font sizes wouldn't be a problem. And you'd be wrong.
    (and not only in Dreamweaver, but in several--but not all--the applicaitons).
    What made you think that you should complain to Adobe about Windows display problem?  Adobe and Microsoft are two different companies competing against each other.
    However, you might have display problem and the best way to resolve this is by going to:
    Control Panel >> Display
    Follow the online instructions.
    Please not, you go to control Panel from within the windows itself NOT from DW.
    Hope this gets you started or you can ask in the Windows Forum on Microsoft Website.

Maybe you are looking for