Recommendations on using fonts on a string

I am building a chat application and I know that I want to make it so that the user can change the formatting of his message on the fly (bold, italic, sizing, etc.). I need to pass this information between the client and the server. I was wondering if there were any java classes that would help me accomplish this (aside from String and Font obviously). I guess what I'm looking for is some sort of formatted string class that allows you to store a string with associated font information. I don't have a problem building this myself, I just don't want to unnecessarily reinvent the wheel.
One idea is to take the formatted string from the GUI and convert it to plain text (something along the lines of BB code that you see on many forums), pass that information as just a string, then convert it back to formatted text on the receiver's GUI.
Another idea is to have a special class that holds a list of string-font pairs that would allow for the string to be formatted in such a way that the user doesn't have to have his entire string formatted the same (msn messenger-style) but could have different parts of the string formatted in different fonts. I could pass that object to the server to be distributed to the other client and relatively minimal code would need to be written. The down side of this is that it would increase the network traffic on the system, which I'm not too keen on.
Any ideas/recommendations will be greatly appreciated.

Darryl.Burke wrote:
It beats un/wrapping everyones text in HTML.Hmm.. a JEditorPane constructed with type as "text/html" returns the underlying html from a call to getText () and displays formatted text by calling setText with the html Strng as a argument.
dbok, but if this is an IM program does that mean people have to enter their text as html?
if i type "how are *you* friend" into the IM box and hit send, he'll have to convert it to html:
"<html>how are <br>you</br> friend</html>".
the "DefaultStyledDocument" is already Serializable.

Similar Messages

  • The case structure is not working well on comaring two strings using true or false string matching VI

    I need an execution of commands after the reply from the instrument matches with the string I provided for that i used true or false string match VI on which the true string the matching command and the string is the reply from the instrument. And I put the further executionable commands in frame after frame of sequence loop in the true of the case structure. Amd finally I given all the output strings to the concatenate string to get all the replies as one loop. But when I execute the program the desired result is not available. So kindly please help me to overcome this problem.  
    Attachments:
    basic serial with changes.vi ‏24 KB

    You VI makes absolutely no sense and I would recommend you start with a few simple LabVIEW tutorials before trying to tackle this.
    What is the point of the FOR loop with 1 iteration, it might as well not even be there, same difference.
    Why is there an abort primitive in the FOR loop, this mean the program will unconditionally stop abort before any downstream code will ever go into action. The program will never get past the FOR loop.
    You created a circular data dependency and LabVIEW inserted a feedback node automatically, making things even worse. (see also)
    You need to learn about dataflow, execution order, and data dependency.
    You need to learn about the various types of tunnels (plain, autoindexing, etc.)
    There is a tremendous amount of duplicate code. Large code sections are the same, differeing only by a string. You should only have one copy of that code inside a proper state machine. Have a look at the design templates and examples that ship with LabVIEW.
    LabVIEW Champion . Do more with less code and in less time .

  • Getting list of used fonts in TextFlow

    Hi!
    I'm wondering how i can get a list of fonts used in a TextFlow - especially usefull, when working with embedded fonts loaded
    at runtime.
    The idea is to be able when loading new content into textflow, to preload the used fonts before the text is shown.
    Any suggestions? - looking at the API, i have not been able to come up with any solution.
    Kindly regards
    // Netphreak

    There's no single place you get can a list of fonts, but it wouldn't be too hard to generate one. Iterate through all the leaf nodes, and get the font from the computedFormat. I'm thinking something like this would work:
    function getFontList(textFlow:TextFlow)
         var leaf:FlowLeafElement = textFlow.getFirstLeaf();
         while (leaf)
              var fontFamily:String = leaf.computedFormat.fontFamily;    
              // add fontFamily to list if its not already there
              leaf = leaf.getNextLeaf();
    If you want to, you could check for InlineGraphicElement and ignore their fontFamily settings.
    - robin

  • Size of fonts on a String

    Hi All!
    I am really struggling with Java these days, as I am not good at programming but need to finish an assignment at college by using it. Could somebody tell me how I could set the size of fonts on a String and how I would be able to format it, as it'll be a paragraph? Many thanks!
    Saulo

    Strings are plain text. If you need to add typographical attributes you need to use AttributedString.
    http://java.sun.com/j2se/1.4.1/docs/api/java/text/AttributedString.html

  • Using fonts from illustrator in a logo

    Are you free to use fonts from illustrator/photoshop in business logo's?

    On behalf of Adobe Systems Incorporated ...
    This (that “you can copy and send the fonts for a reproduction house for the sole purpose of reproducing that particular piece or job”) is absolutely not true! In fact it is not true for any of Adobe's fonts!
    What is true is that your ability to send, share, or even embed fonts is dependent upon the EULA (End User License Agreement) for each and every font you use in your content. And, by the way, any restrictions in the EULA legally override any embedding permissions that might be set in the font itself for TrueType and OpenType fonts!
    Other than for fonts that are explicitly labeled as public domain or freeware, it is exceptionally uncommon for any font foundry – and that includes Adobe and Monotype (Monotype now includes Linotype, ITC, and Bitstream) – to permit licensees to simply package and send fonts along with the base document (Illustrator .AI, InDesign .INDD, etc.) and other digital assets to a print service provider with one exception. That exception – and that exception is not universal but does apply to fonts licensed from Adobe – is that such fonts may be sent to a print service provider as long as the print service provider is also licensed for those fonts. Well, what good is that you may ask? The reason for this is that there are subtle differences between versions of fonts released over time including improvements and corrections. Adobe does allow users to make local modifications of fonts as well while maintaining actually ownership of the fonts. To deal with both these cases, Adobe does allow fonts to be sent with original source files to print service providers if and only if the print service provider also has a license for such fonts. The need for such a license is exactly why Adobe markets its Font Folio product to print service providers; it fulfills the licensing requirement for their customers sending original documents with fonts to them either for reproduction and/or editing.
    One of the reasons why Adobe has been so much behind PDF workflows is that for many fonts (including all those licensed from Adobe), you may embed the fonts in the PDF files you create from you content, send the resultant PDF file to your print service provider for reproduction or to a publication for embedding in their content (such as for advertisements) and neither you nor the recipient needs to pay any further licensing fee.
    However, you should note one further restriction. Some font foundries (including all the font brands of Monotype) allow for fonts to be embedded in PDF files, but except for private distribution of such PDF files (including to print service providers and publishers), requirement additional royalty payments for distribution of PDF files in which their fonts are embedded! Note that Adobe has no such restrictions on any fonts the fonts it licenses!
    I know that the above information may conflict with both what many in the industry practice and believe is true, but those licenses are indeed legally enforceable. We are in fact aware of font foundries that run webbots looking for PDF files with their fonts embedded for which royalties have not been paid. The fact that many content providers and print service providers have blatantly ignored the font licenses in the past does not provide a tenable legal excuse for ignoring font licenses now.
              - Dov
    PS:     To address the original question in this thread, you may use the fonts provided with any Adobe software in your content such as logos (even if they are created with non-Adobe software while you are licensed for the Adobe software) and you may distribute such artwork to others with the fonts as long as that is distributed in the form of either PDF files or EPS files with the fonts embedded. (Adobe most strongly recommends PDF over EPS for modern, reliable workflows!)

  • I want to set up the Time Machine and I would love to use the Time  Capsule but since I already have a wireless router I need suggestions on  what other external disks Apple could recommend to use with the Time Machine and  how to configure that disk

    I want to set up the Time Machine and I would love to use the Time
    Capsule but since I already have a wireless router I need suggestions on
    what other
    external disks Apple could recommend to use with the Time Machine and
    how to configure that disk.
    A complication that I need to resolve is the fact that I am using Vmware
    Fusion to be able to use Windows on my Mac. Now it seems that Time
    Machine is not backing up my files
    on that virtual Windows without additional configuration and my question
    is whether you can advise me here or whether this is only a matter for
    the Fusion virtual machine.

    If you want to use Time Capsule you can.. you simply bridge it and plug it into the existing router.. wireless can be either turned off or used to reinforce the existing wireless.. eg use 5ghz in the TC which is much faster than your 2.4ghz.
    You can also use a NAS.. many brands available but the top brands are synology, qnap and netgear readynas  series. These will all do Time Machine backups although how well always depends on Apple sticking to a standard. There are cheaper ones.. I bought a single disk zyxel which was rebadged and sold through my local supermarket. It actually works very well for TM at least on Snow Leopard. Major changes were made in Lion and again ML so do not instantly think it will work on later versions. I haven't tried it yet with those versions.
    Any external drive can be plugged into the mac. Use the one with the fastest connection or cheapest price according to your budget. USB2 drives are cheap and plentiful. But no where near as fast as USB3 or FW800. So just pick whichever suits the ports on your Mac. Interesting Apple finally moved to USB3 on their latest computers.
    TM should exclude the VM partition file.. it is useless backing it up from Mac OS side.. and will slow TM as it needs to backup that partition everyday for no purpose.. TM cannot see the files inside it to backup just the changes.
    You need to backup windows from windows. Use MSbackup to external drive.. if you have pro or ultimate versions you can backup to network drive. But MSbackup is a dog.. at least until the latest version it cannot restore the partition without first loading windows. There are about a zillion backup software versions for windows.. look up reviews and buy one which works for you. I use a free one Macrium Reflect which does full disk backups and is easy to restore.. to do incremental backups though you have to pay for it.

  • Is it not recommended to use a partitioned external hard drive for time machine?

    1. i hv a 1 tb seagate  back up plus hard disc ..,,i want to make partitions for  using it for time machine, mac, and window repectively . is it not recommended to use a partitioned drive for time machine? some where i have red that time machine wont be able to restore data from external partioned hard drive  in case internal hard drive crashes.
    2. if i use the seagate back up plus 1tb for mac only and use time machine to take backup (roughly 250 GB) , then the rest space i cant use to transfer movies, pictures from a PC
    3. how should i best use the seagate back up plus hard drive (not seagate back up plus for mac) in a way that i use it for back up , and to work with both mac and PC?

    I use a partitioned external drive for Time Machine as well as other things.
    How you partition it is a function of yoru needs.
    Barry

  • Font in GTK2 apps are not using font smoothing in cinnamon. GTK3 does.

    Hi,
    My GTK2 apps like GIMP, chromium fonts are not really using font smoothing but GTK3 apps look fine.
    Any help is appreciated.

    Chazza wrote:Does the following application help at all? Link: http://qt-apps.org/content/show.php/Qt5 … ent=168066
    Yes, unfortunately this did not fix the problem. I did put the environmental variable in .profile and relogged, the result was unfortunately the same. I've managed to fix fonts in Clementine using qtconfig-qt4 after some fiddling, but applications like Docky and Chromium still have the monospace font.
    cedeel wrote:Eh, Chromium isn't a Qt application.
    Ah, my bad. Do you know of a way to fix that problem anyway?

  • Is it recommended to use HSRP or multiple default between Core Layer Switch and Customer Edge Router?

    My client is asking me for following
    Client is using Router as edge device. 2  WAN links from different service provider ( each 20 Mbps)  are getting terminated on the router. There are internal servers present in the network. Client want to make setup such that even if one wan link fails  internet users should be able to access web server. Moreover if the edge router fails there should be secondary edge device so that there is device redundancy ?
    As per my understanding, in this scenario we need to do static one - to - one natting(belonging to WAN interface subnet). If we use two routers as Customer edge ans if we connect core layer switch to these two router, is it recommended to use HSRP/VRRP/GLBP or two default route on core switch pointing to two routers with equal ad value. we will also track the wan link with help of ip sla.
    which is recommended solution  Router redundancy protocol or Default routes.?

    Just had another read of this post and some other points have come up.
    1) I assumed your secondary link was for redundancy but you talk about terminating both SP links on the same router in your first paragraph.
    Did you mean this or are you going to be terminating a link per router ?
    2) are you using the second router purely for backup ?
    3) something you didn't ask about but is relevant is the IP addressing. Are you using provider independent addressing or does each SP provide you with an address block.
    If it is the second then you are going to have an issue with the web server. The problem is which provider's IP do you use for the web server ie.
    if you use the primary provider IP then that will be the DNS record on the internet. If the primary router fails then the IP address will change on the secondary router but DNS will still be handing out the primary IP.
    If you enter both IPs (primary and secondary) into DNS then you would get load balancing but this means both links will be used and the secondary would not just be backup.
    In addition if one of the links fails then DNS does not know this so it will still be handing out the failed address as well as the address that is still up which means some connections will work and some won't.
    Jon

  • Using & in a text string

    How can I use & in a text string so that the system doesn't ask for the user to enter a value. eg the string is Joe Blogs & Co. Currently the system asks for the user to enter text.

    Ferris
    An other option is to change your 'define'-character within SQL*Plus:
    SQL> sho define
    define "&" (hex 26)
    SQL> select 'AAA & BBB' from dual
    2 ;
    Enter value for bbb:
    SQL> set define #
    SQL> sho define
    define "#" (hex 23)
    SQL> select 'AAA & BBB' from dual
    2 ;
    'AAA&BBB'
    AAA & BBB
    1 row selected.
    Martin

  • I need to clarify how I can use adobe as a host for my site for free. I see where business catalyst is supposed to be temporary as well as it is recommended to use as the better alternative to launch my muse site. But then I have to use the long

    I need to clarify how I can use adobe as a host for my site for free. I see where business catalyst is supposed to be temporary as well as it is recommended to use as the better alternative to launch my muse site. But then I have to use the long extension of "businesscatalyst" in addition to the domain name I'd prefer. How exactly can I take it live? do I have to use a third party hosting?

    Hi,
    Once you are done with your sitet, Click on Publish in Muse, select New Site from the drop down, It will ask you a name for your site, which will be used for  site url, you will get a url like mysite.businesscatalyst.com, then go to the browser and login to the admin panel, mysite.businesscatalyst.com/admin and on Dashboard, click Launch site. This will push your site live, and you can then add your custom domain.
    Also make sure that you have completed all these actions mentioned here
    User manual
    Do let me know if you have any question.

  • I created a brochure in pages and exported it to a pdf format. The pdf looks and opens perfectly using preview but when opened in adobe reader (which my printer uses), fonts look odd, transparencies don't display...etc. Tells me error exists on page?

    I created a brochure in pages and exported it to a pdf format. The pdf looks and opens perfectly using preview but when opened in adobe reader (which my printer uses), fonts look odd, transparencies don't display...etc. Tells me error exists on page?

    Does this essentially mean there is no way to fix this problem on my end? It's a pity because the design and branding of my brochure will suffer if I remove transparencies and use different fonts. It also concerns me moving forward because it means the quality of print on my pieces will be significantly lower because most commercial printers use Adobe products.

  • Is there a way to scan a string containing % (percent symbols) using the "Scan from String" function?

    I am communicating serially with a chilled mirror device and the input string syntax contains this text: "%RH=<input value>"
    I have not been able to figure out how to tell the function that the percent here is not a format specifier. Is this possible, or should I just try to use a different function?
    Thanks.
    Mitch
    Solved!
    Go to Solution.

    Use %% in your format string so that it knows to use the percent literally.  So %%RH=%f
    EDIT:  Darin got one in there ahead of me.  It looks like either \% and %% both work.
    Attachments:
    Example_VI.png ‏10 KB

  • Monitor Recommendations for Use with Captivate

    Anyone have any monitor recommendations for use with Captivate? Size and resolution?

    The formal adobe  recommendation is as posted 1024x768 is fine.
    But, monitors are not that expensive, so for productivity and better work environment I recommend at least one wide screen 22" with resolution  1600X1200 or more  and that supports 1080 for video.
    You need the  wide screen ( or  two monitors) so you can work with all the tools in one view.  

  • Barcode using fonts

    Hi friends,
    I am using oracle Report 6i and Oracle DB 10g.
    Windows for (my pc) development and linux for the OAS
    I need to show some numbers in barcode 'format' in web. I have a table with a column named Code (number type),
    I need to show this number like a barcode in my report.
    Between the options for my task I chose the apparently easy way, so I installed a True Type Font (IDAutomationHC39M.ttf) on my PC (Windows) and test my report, and it was ok, because it show the number like barcodes.
    I also add the font to my OAS server (linux).
    So, I send my report to OAS (with CoreFTP) and then test the report in web, and for my surprise my report just show numbers.
    I've tried to solved my problem:
    1. I add * to the numbers
    2. add this code to the file uifont.ali
    [ PDF:Subset ]
    IDAutomationHC39M = "IDAutomationHC39M.ttf"And try changes some configurations files ... but nothing works
    I need to know what is the correct procedure to add font to OAS, or maybe there is a problem with my procedure?.
    Remember that what I really need is to show numbers like barcode (in my report) in web using fonts .
    Thanks for helping!

    Well, like I said, I've tried differents changes but nothing seems to work.
    I also check this link before: http://www.idautomation.com/kb/unix-finst.html
    I need to know where is the real problem, so I need the complete steps to achieve the task.

Maybe you are looking for