Default font problem

Hi, people!
I have a JTextPane with HTMLDocument.
Can anyone tell me how can I put the dafault font to this JTextPane?
I want all the text in it to displayed in some font.
I checked this forum but haven't found an answer - some offered solutions doesn't work at all.
thanks

O.K. people! Thanks you very much.
I've found what i needed:
JTextPane myTextPane=new JTextPane();
setFontAttributesToDocument(myTextPane, 0, myTextPane.getDocument().getLength(), myFont);
void setFontAttributesToDocument(JTextPane pane, int start, int end, Font fnt) {
MutableAttributeSet new_att = new SimpleAttributeSet();
StyleConstants.setFontFamily(new_att, fnt.getFamily());
StyleConstants.setFontSize(new_att, fnt.getSize());
HTMLDocument doc=(HTMLDocument)pane.getDocument();
doc.setCharacterAttributes(start,end,new_att,false);
hope it will help you too.
good luck

Similar Messages

  • Glitches in address fill-ins with nicknames; default font problem; plus other glitches in Thunderbird 31.3.0 and 31.4.0; can I roll back to an earlier version?

    I am unhappy with the recent upgrade to Thunderbird 31.3.0 and now 31.4.0. My bottom line question is whether I can roll back to the previous version, which was working well for me.
    The problems I have encountered include:
    1. I used to be able to enter a single letter in many cases in the address field, and the autocomplete would fill in the entry that I always use with that single letter. That function has been lost, as has auto fill-in based on the nicknames I have entered in my Address Book. I see there is another thread on this problem (https://support.mozilla.org/en-US/questions/1036962), but no satisfactory answer so far. Entering a single letter now pulls up completely unrelated address entries that may not even have that letter as part of the name, address or nickname for that unrelated address. I have created new nicknames to try to adapt to this problem, but even these new nicknames no longer work with the 31.4.0 upgrade yesterday, forcing me to create yet more complex and hard-to-remember nicknames to pull up my frequent addressees. This is all very frustrating to me, as I depend on speed and ease when creating messages.
    2. Also, I used to be able to enter a single letter in the address field and then use the mouse to click on the "To:" symbol to the left of the next address line to change the next entry to "Cc:"; doing so would then cause the complete address to fill in in the "To:" address field, and make the next field ready for an entry. That no longer works. If I use that technique, the shortcut that I entered in the first field gets included along with the address (if I'm lucky enough to have the address itself selected now, given the problems I've mentioned above). I now have to press "Enter" in order to get the address in the first field to "take" correctly, and then have to click on the "To:" symbol for the next line as a separate action. Just another inconvenience with the new version.
    3. While still on the subject of addresses, personally I see no reason why the address and subject fields should now be colored blue by default rather than appearing as blank, white fields. I far prefer the old look. And I suspect that changing from the blue color to a nice, clean, white field takes time and computer resources that slow things down.
    4. The default font (Times in my case) no longer "takes" when replying to or forwarding messages. I've checked Tools/Options/Composition, and Times is still shown as my default font. However, when I start to type (in a reply with the original message quoted or in a forwarded message), the result is "Variable Width". In order to get Times, I need to highlight the block of text after typing, including the lead-in to the quoted message or the header of the forwarded message, and select "Times" when "(mixed)" shows up. This is a big pain; I often forget to do so and end up having to edit the Unsent Message (which I check before sending) as New and correct the font.
    5. A minor problem: I rely on the reminder to attach a message which shows up when an "attachment-related" word is entered in the body of the message. It has been a wonderful feature of Thunderbird that has prevented me on many occasions from sending off messages without the attachments. However, in the new versions, even if I have indeed added the attachment, a pop-up comes up on sending the message saying there has been no attachment and asking if I want to add one. It's easy enough to just click "No", but it's yet one more unnecessary and distracting step that this new version is requiring of the user.
    I'm really sad to see these various changes/glitches. I love Thunderbird and it bothers me deeply to find myself mired in so many new problems that slow down my work. I would be grateful for any suggestions and advice, and, particularly, for any information as whether I can roll back to the version prior to 31.3.0 that was working well for me.

    Thank you, Zenos. I tried rolling back to v31.2.0, since I had not encountered problems prior to December. However, that didn't help. So I followed your valuable suggestion to revert to v24.6; that seems to have done the trick.
    I would like to mark this problem as "Solved" -- the rollback seems to have worked. However, since my original post was a complex mix of things, before I do that, should I post the individual problem sets that I had noted (address fields/nicknames problems -- numbers 1-3; default font problem -- number 4; attachment reminder problem -- number 5) as separate issues which have not been solved?
    Do you know if these various issues are being worked on? I'm glad to have the temporary fix of rolling back to an earlier version, but I'd like to get back on the current update schedule at some point if and when these problems have been corrected.
    Thank you again!

  • Crystal Report XI R2 Default Font Problems

    I have set the all the default font in all types to "Times New Roman" as requested by my supervisor (Although I dislike the font =.=)
    It works correctly for generated field, new text objects or drop a new database field. But whenever I type text in the text object, the inputted text becomes Arial and messed up with other part of the report and I have to manually change it everytime which is really annoying.
    In Crystal Report 10 the problem does not exist. Is there anyway to make the entered text follow the font of the text object or it is only a bug in Crystal Report ?
    btw, I wish Crystal Report can support wider range of HTML Tag like ul, which should be easy to implement but do a great help in formatted remark field in the report. It makes me so disappointed when I found the supported tag didn't grow up after so many version. I will be very happy if anyone has a solution to support ul.

    Hi,
    Have a look inside the Options.  In the Fonts tab, make sure you've set the font for Text Objects correctly.
    Good luck,
    Brian

  • Getting the default font - possible? (default fonts problem in InDesign Server CS5)

    Is there a way to decide whether a font is used as "default font" for a document?
    Or a simple way to see whether a font is used at all?
    The actual problem is that InDesign server (CS5 ver. 7.0.3.533) returns the "default font" along with all other used fonts, when looping through the document.fonts collection. This becomes a problem when the default font is never used in the document, and is also not present. Then the (name of) the default font may also become meddled by a style that does not even exist for that very font.
    This is indicated as a problem in our application... as a missing font, just as the call to InDesign server reports back. But the font (with that style) doesn't even exist.
    Running the same script on an desktop InDesign CS5 (ver 7.0.4) the unused default font of the same document is not returned at all.
    Thanks,
    Andreas

    To get the default font, just check:
    app.activeDocument.textDefaults.appliedFont
    Obviously this didn't solve the problem, since InDesign server has made up a font name that is reported as missing... and it's not equal to the default font. So there is some lack of logic in my previous description.

  • Problem with Arial/ default font

    I don't know if Mac has a default font option, but I hope they do! Last week I was working as usual when I noticed some websites were not displaying correctly. After some investigation, I realized it was my Arial font. It happens in Word and Acrobat also. What it looks like is that my default Arial font was replaced with another font. When I go to Font Book or the Fonts folder and look at my Arial font, though, it is fine. I did install some fonts recently, as I have done in the past, and this is the first time I have seen such a problem. I am content with just changing my default font to something else, if I could figure out how! Thanks.

    If you did an upgrade from Tiger to Leopard it is not uncommon to have some minor font problems and possibly one or more major problems.
    Click on Go>Applications>Font Book.
    In Font Book choose All Fonts in the 1st column, then click into the second column.
    Check for a black dot to the right of any of the fonts in the list in the second column.
    If there are any dots the click on Edit>Select All.
    Next Edit>Resolve Duplicates.
    Next File>Validate Fonts.
    Wait until it checks all the fonts and it will tell you how many have major problems and how many have minor problems.
    If you have a fairly significant number of problems you should probably reinstall the System Fonts.
    You can do that with an archive and install but there is an easier way.
    In Safari search for Pacifist.
    Download it.
    Insert your Leopard install disk while it is downloading.
    Run Pacifist and choose to have it Open Apple Install Disks.
    It will reveal the contents of the install disk.
    The fonts are located by going to Contents of EssentialSystemSoftware>Contents of BaseSystem.pkg>System>Library>Fonts.
    Click on the Fonts folder to choose it and then click on Install in the upper left corner
    This will reinstall the System Fonts and overwrite its folder.
    It will ask you if you want to overwrite the fonts, choose yes and tell it not to ask you again.
    After the reinstall, restart your computer.
    The go to Applications and run Font Book again.
    Select the second column by clicking into it and then choosing Select All from the Edit menu.
    Choose Resolve Duplicates from the Edit menu.
    Select Validate fonts from the File menu and put a checkmark to the left of any problem fonts.
    Choose Remove Checked.

  • AI CS3 default UI font problem

    Hi!
    Week ago, in my Illustrator loaded a other font in UI. Shown in this link:  http://img30.imageshack.us/img30/9651/beznazwy1vu.jpg
    Have you any ideas how fix it on default font? Unfortunately, I can't reinstall Illustrator because I need this all time.
    Thanks a lot. Best regards
    Arek

    Arek,
    You are not being ignored, but I have not found a solution for you. What operating system are you using?
    Peter
    Sorry, I see that it's Windows. I can't help you.
    Message was edited by: tromboniator

  • How to Change the Default Font in Firefox 4 ?

    How to Change the Default Font in Firefox 4 , for this >>
    http://store2.up-00.com/Mar11/AJG18655.png << ?

    Go to properties first: and set before typing anything in as shown here:
    http://screencast.com/t/ZTgzOTM3Y
    Then right click bring up this menu while inside active field and click on item with arrrow:
    http://screencast.com/t/ZTRjMWRkMzk
    Now what ever you typed should reflect the new Font setting.
    we may be as you say. But then again other people act like whats on the other side.
    We do our best. And if we fall short, well we gave it our best shot.
    Okay. In the interests of being completely clear:
    I have already tried this. Several times. This procedure will change the default for any of the fields that I place by hand. It does not change the default for any of the fields placed by the Wizard. I was unable to find a solution to the problem in any of the manuals, books, or on-line forums, which is why I posted here as a last resort. This leads to two conclusions:
    A. Your advice is incorrect
    B. There is a problem with my installation of Acrobat
    I will assume that A is not the correct conclusion. I will therefore try a re-install of my software to see if this clears up the problem. There have been other issues with other Adobe software on my machine that a re-installed has fixed nicely. Luckily, I don't have to do this at all often.

  • How to change the default font size in X11?

    I was a PC/linux user and have switched to use Mac lately (MBP Snow leopard 10.6.8).
    Everything's been running perfectly on Mac so far and I really like it, until I have to run some programs on XQuartz/X11 (XQuart 2.7.0).  
    The default font size in the Xterm is too small. And I hate it that I have to change it everytime i open a new terminal (via vt fonts menu, ctrl+right-mouse click).
    Is there a way to change the default font size "permanently" in XQuartz/X11 ??
    This may be a stupid question to ask in the developer forum but i cant really solve it.
    There's only config. file ~/.Xdefaults they have mentioned so far on Google but i really cant find it regarding to the directorty.
    Thank you very much in advance.

    You would be surprised to find out that is not like this, to get your account blocked you really need to do a lot of damage and posts are not removed unless they are illegal, and *always* it needs more than a person to delete something. That's a site managed by the community, not by some people put in place by a company.
    It is always acceptable to link to external resources as long these resources do provide additional usefull information. Clearly the thread on that side contained much more information than the one here. I observed people linking from there to this forum, but it's not so common, and that's not due to the policy, just because here is more chat and less usefull information.... you will not see endless threads of replies on with "yes, I have the same problem" there.
    Shortly, this is "discussions" and is quite different in approach than the SE model, where everythign is aimed towards getting the be answers UP and removing all the nonsense.
    I wish that Apple would invest more in discussion, and going towards making this more practical.

  • How to change the default font size in XQuartz?

    I was a PC/linux user and have switched to use Mac lately (MBP Snow leopard 10.6.8).
    Everything's been running perfectly on Mac so far and I really like it, until I have to run some programs on XQuartz/X11 (XQuart 2.7.0).   
    The default font size in the terminal is too small. And I hate it that I have to change it everytime i open a new terminal (via vt fonts menu, ctrl+right-mouse click).
    Is there a way to change the default font size "permanently" in XQuartz/X11 ??
    This may be a stupid question to ask in the developer forum but i cant really solve it.
    There's only config. file ~/.Xdefault they have mentioned so far on Google but i really cant find it regarding to the directorty.
    Thank you very much in advance.

    You would be surprised to find out that is not like this, to get your account blocked you really need to do a lot of damage and posts are not removed unless they are illegal, and *always* it needs more than a person to delete something. That's a site managed by the community, not by some people put in place by a company.
    It is always acceptable to link to external resources as long these resources do provide additional usefull information. Clearly the thread on that side contained much more information than the one here. I observed people linking from there to this forum, but it's not so common, and that's not due to the policy, just because here is more chat and less usefull information.... you will not see endless threads of replies on with "yes, I have the same problem" there.
    Shortly, this is "discussions" and is quite different in approach than the SE model, where everythign is aimed towards getting the be answers UP and removing all the nonsense.
    I wish that Apple would invest more in discussion, and going towards making this more practical.

  • How to change default fonts in Indesign

    I've tried the usual recommended steps - open InDesign, select a font, then close the program, etc. -- but nothing seems to work. Every style reverts to MetaPlus. Help!

    Respectfully, I've tried this, and I'm not looking for suggested working solutions as I have a pretty clear understanding of how to set defaults and how to utilize paragraph styles.  I'm simply pointing out that contrary to what you're saying, setting the font in the character palette does NOT change the true default font in my experience (CS4, OS10.4.11). I do understand that the default is set with no documents open by then selecting the font in the character palette.
    I'm attaching 2 screen shots to show you that I'm not making this up.  In the first you can hopefully see I've clearly set the "default" to Arial now.
    In the second I've created a new document and a new paragraph style. You can see it already considers "Arial" as deviating from the base "No Paragraph Style" and if you click on "Reset to Base" you will see that sure enough, the true default font is still Geneva (Geneva in my case as outlined in my previous post).
    Generally, this isn't much of a problem. As you've all pointed out we can accept that these additions are the new default for a new paragraph style, but it really isn't changing the true default font. Depending on your working environment and the experience of the designers this may be good enough. For my environment I'm looking for the ability to change the true default font and the only solution I've come across is the one from my previous post (deleting preferences).

  • How do you change the default font in Outlook 2013?

    I am trying to set the default font in Outlook 2013 as per the customer's request and am having no success.
    First I create a NormalEmail.dotm file and added it to the Office Customization Tool, created an msp and added it to my package. After installing Office 2013 I check and the NormalEmail.dotm
    is on the machine in %appdata%\Microsoft\Templates folder waiting to be loaded. When launching Outlook 2013 on first run it renames my NormalEmail.dotm to NormalEmail15Pre.dotm. I created the file in Word 2013 so it's not a 2010 version and it (NormalEmail15Pre.dotm)
    open cleanly in Word 2013 (it does not open in compatibility mode).  If I close Outlook and rename NormalEmail15Pre.dotm back to NormalEmail.dotm Outlook opens and uses my template without any issue. This is not a solution as I have 1000's of deployments
    and can't do this manually. One other thing, I did have this same problem with the default font in Word 2013 but by implementing a registry setting (HKCU\Software\Microsoft\Office\15.0\Word\Options\MigrateNotmalOnFirstBoot = 1) it used my Normal.dotm
    template on first run, if such a setting exists for Outlook I can't find it.
    Also I did try to set the font through the mailsettings (HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings) in the registry as we did with O2007 and O2010 but
    those do not load into Outlook when tweaked.
    http://blogs.technet.com/b/odsupport/archive/2009/04/24/how-to-deploy-specific-fonts-in-office-2007.aspx 
    Thank you for your help.

    Hi, I found out how you can set it.
    You need two registry keys to be set in order to keep the preloaded settings.(HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\MailSettings)
    These are:
    [HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\LanguageResources]
    "LangTuneUp"="OfficeCompleted"
    "OutlookChangeInstallLanguage"="Yes"
    both are String entries.

  • Xorg Fails to Start: Could Not Open Default Font 'Fixed'

    After an absence from my Arch system, I tried to fire it up today and found that Xorg7 now fails to load, telling me that it "could not open default font 'fixed'". I have done a "find" on my whole partition - there is no font file called "fixed*" at all on the system. Just for fun, since I have an older SuSE 9.3 on another partition on the same machine, I searched it too - no files called "fixed*" at all.
    Does anyone recognize this error, and know what to do about it?
    I haven't touched this partition in probably 6 months (long story). I do have a triple boot on this machine, with the SuSE I mentioned above and also Ubuntu Dapper Drake. I have been running the odd update on those two OS's - I suppose they might have crept onto my Arch partition and messed things up...
    Anyway, any and all thoughts much appreciated. I am pretty much dead in the water with Arch. I am running Arch 0.7.2, on a 3.0 GHz Pentium IV HT with 1 GB of RAM.
    Last edited by mac57 (2007-04-27 23:43:29)

    Hi Guys, thanks for the help. I haven't been able to get back to this for a bit but I finally did tonight. sh___, your tip did the trick. I did the grep and sure enough, fixed WAS on the system, it just clearly was not in the font path. I started backtracking and found that it had been commented out of the font path in xorg.conf. As soon as I uncommented it, X11 was back. Phew!
    HOWEVER, XFCE4 is totally borked. It appears that one of my Ubuntu updates wandered onto my Arch partition and kindly updated parts of XFCE4, leaving the whole completely unworkable. Happily, I also have KDE installed on Arch, and was at least able to get an X environment back from which to work on the XFCE4 problem. I am now updating XFCE4 completely to the current version - that should restore version harmony and hopefully all will be well. We shall see! Thanks again.

  • Reinstalling Default Fonts in Mountain Lion

    Hi,
    After buying the new iMac and have used it for two day I noticed that some files were in the Trash folder including the Fonts folder (don't ask me how they got there becuase I would swear I didn't move them). Since I didn't know where the Fonts folder belones to (system or user folder) I search on the internet and some people sugested doing a restore using Font Book (File>Restore Standard Fonts), but this made it worse since when it when and check it deletes the existing folders so now I only have the folder that was in the trash and I'm for sure missing one folder.
    Is there a way to reinstall the default fonts in Mountain Lion without reinstalling the operating system?
    This is the only thing I found but this will reinstall the OS.
    https://discussions.apple.com/thread/4201528?start=0&tstart=0
    Thanks a lot

    You can use FontBook to find and delete duplicates.
    Have you checked for updates for your iWork?
    I did use FontBook to delete the duplicates.
    The applications were working fine before the reinstall, I checked for updates but it doesn’t show any for these applications.
    My problem with this is that I cannot reinstall these applications since I have them in a DVD and my computer doesn’t have a DVD drive.  I installed them sharing the DVD drive from my old MacBook but I sold it two days ago, the only thing I have is an Acer laptop but I don’t know if it is possible to share the drive.
    Is there a way to somehow put my DVDs in a USB drive, so I can install them without needing a DVD drive (assuming I can barrow my nephews Mac which has a DVD drive)?
    Thanks a lot for your help!

  • Defaulting fonts when viewing DPS articles in Adobe Content Viewer

    Hi.
    My fonts are defaulting throughout my folio when I view articles in Adobe content viewer.
    This folio is a PDF. I have published before and not had this issue.
    Is the problem with Content Viewer?
    Will the type display correctly when I publish this folio and view in app?
    Thank you.

    When a font is missing or unlinked that font shows up as a default font.
    The fonts in these documents are not missing or unlinked.
    When I update the article it fixes the problem, but only temporarily.
    The fonts default the next time I view the article.

  • Body text appearing as TNR, not the default font

    I'm having a problem with the font settings with mail sent from Mail.
    I've set the default font to Arial, but all emails sent to other people (using Outlook under WinXP) see it as Times New Roman. I've even specifically selected Arial from the Font Pallete and it still comes up as TNR. If I select another font, like say Verdana, they see that fine. It's only Arial that screws up.
    I also have Arial in my signature, but that comes up fine - even at the same time as the body text is screwing up

    Try setting the default in Mail preferences to something else other than Arial, then change the font to Arial in the message via the Font Palette.

Maybe you are looking for