How to set the physical font in JEditorPane with HTMLEditorKit

I am now creating a swing application which use JEditorKit to make a HMTL editor by the following code:
JEditorPane editor = new JEditorPane();
HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = new HTMLDocument();
editor.setEditorKit(kit);
editor.setDocument(doc);
editor.setContentType("text/html; charset="+sEncoding);
editor.getDocument();
u can see that the encoding of the html file is generated dynamically. At the same time, I also hope that the font is also set dynamically. Moreover, I don't want the font to be installed on each platform, so I am using the following code:
FileInputStream fis = new FileInputStream("Cyberbit.ttf");
Font font = Font.createFont(Font.TRUETYPE_FONT, fis);
Therefore, I can use this font in the Java application. However, how can I make the html file can use this font also? How can I make the HTML file to use this font in the JVM? thx!
Stephen

However, how can I make the html file can use this font also? How can I make the HTML file to use this font in the JVM? thx!This is my exact problem!
Hope you would have got the solution , could you give me some sugesstion..pls?

Similar Messages

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

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

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

  • How to set the physical inventory tolerance ?

    Hello
    We need to set the tolerance limit such us more than 20 % or more or less than  nos qty can only be posted in the physical inventory process.10 in stock means the user cannot post less than 8 etc. how to  achieve it .Any help will be highly appreciated

    Hi Nick,
    pls. have a look at the following document:
    http://help.sap.com/bp_bblibrary/600/Documentation/J73_BB_ConfigGuide_EN_DE.doc
    and search for tolerance within the document, it should tell you what you are looking for.
    Pls. reward if helpful.
    Best regards,
    Enrico

  • How to set the fields invisible/visible dynamically with screen-exits

    <b>Goal:</b> I am changing the subscreen from standard screen for mobile device interface, i.e. function group LMOB. With a scanner I am to read a material number and have it confirmed by the SAP system. For this I need an input field which is already supplied by the standard program. The users require the screen to be dynamic, i.e. I can not do the settings in the screen-painter.
    <b>Problem occurred:</b> After I have changed to use the customized subscreen 1202 in function group XLRF, not all the fields are displayed. It seems that the values for setting the screen elements are lost when calling the subscreen (3202, copy of screen 2202). For instance, it does not show my input field. Somewhere there need to be a list that contains all these parameter switches? I know how “Loop at screen” works but can’t find the values that are supposed to be passed over to the subscreen.
    Would be grateful for some help.

    Hi Niklas!
    Unfortunately I don't know the transaction you're working on, but I had a similar problem once.
    You have to use the commands <b>LOOP AT SCREEN</b> and <b>MODIFY SCREEN</b>. I found some online help here: <a href="http://help.sap.com/saphelp_470/helpdata/en/9f/dba70535c111d1829f0000e829fbfe/frameset.htm">SAP Online Help</a>. The fields of the pseudo-table <b>SCREEN</b> can be found here: <a href="http://help.sap.com/saphelp_470/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/frameset.htm">SAP Online Help</a>. I think you have to set <b>INVISIBLE</b> to 'X' - but you may have to experiment.
    Another thing to look out for is that you have to call this method in the <b>PBO</b> section of the dynpro. Take care no SAP logic is executed after your modification that changes your settings...
    Hope this helps (please reward me if it does),
    Joerg

  • Is it possible to set the default font in Pages with Workgroup Manager?

    School district. We use iWorks '09 (currently) and several teachers would like the default font for all students to be a specific font (Comic Sans because of the shape of the letter 'a' and the number '4').
    I know about creating the template and using the template, but that must be done for all student accounts, and must be done again for any incoming new students.
    I would prefer there to be a way of setting this in WorkGroup Manager? I don't see that it is possible though. Or am I missing something?

    You might also consider using color groups with Illustrator. Let me know what you think. It may help you out with projects that use the same color preferences.
    Check out the tutorial here:
    http://www.adobe.com/designcenter/illustrator/articles/lrvid4019_ai.html
    Let me know if this helps you.
    Vicente Tulliano

  • How to set the data in af:selectOrderShuttle with reorderOnly "true"

    I created codes like below, but after the page is loaded, there is not any data in the list. even I added a String array(employeeMB.columns) with some value in the managed bean, nothing did I get. How can I set the initial data in the list with reorderOnly set to "true"? I am using JDeveloper 11.1.1.2.0. Thanks.
    +<af:selectOrderShuttle value="#{employeeMB.columns}"+
    reorderOnly="true" id="colsMonitor">
    +<af:selectItem label="Empno" value="Empno"/>+
    +<af:selectItem label="Name" value="Ename"/>+
    +<af:selectItem label="Job" value="Job"/>+
    +<af:selectItem label="Department" value="Deptno"/>+
    +<af:selectItem label="Hiredate" value="Hiredate"/>+
    +<af:selectItem label="Salary" value="Sal"/>+
    +<af:selectItem label="Commission" value="Comm"/>+
    +<af:selectItem label="Manager" value="Mgr"/>+
    +</af:selectOrderShuttle>+

    Hi,
    A helpful thread for you:----
    Dynamically Change Data Provider in Anaylsis Grid in Bex Workbook 7.0
    Regards,
    Suman

  • How to set the size of a control with the mouse ?

    hi all,
    i am writing a sort of ide (editor which creates applets very easy....) - for this purpose i need some hints from you guys:
    of course i need to create some controls like buttons...
    no prob - i am able to create buttons and place them at any place.
    BUT WHAT ABOUT THE SIZE ?
    ok, i have some ideas to realize this but what i want is a thick border arround the control with spots at each corner - when i place the cursor at one of these spots, my mouse cursor should change and it must be able to change the size of the control (while pressing and moving the mouse - you all know that from any ide).
    so how to do that?
    go on brains!!!
    THANX,
    andi

    I thought about creating dynamically resizable components, but gave it up as the effort seems too much for the benefit. I did a search for info on it and found a lot of people who wanted to do it, but not any who had actually done it completely. Here's some of my thoughts on the subject. You are right on about creating 'sizing handles', it seems to me the way to do this is to create your own container for any component (extend JPanel?) which can switch between no border and your new sizing border at some event. You will need to respond to mouse clicks on this border and follow the 'drag' event to find out where it was dropped. The java drag/drop events probably won't be of any use to you because each component will need an event handler. You need to catch them all.
    Finally, you need to figure out how to interact with some LayoutManager or write your own. Most LayoutManagers want to do their own resizing and you will have to deal with this. For example, GridBagLayout will not only resize all of the other components on the affected row and column, but unless you resize the other components, you won't be able to drag the top higher or the left lefter?

  • How to set the Font size of Label?????

    Hello everyone.
    I want to knoe how to set the Font size of the Label???
    Please help..
    Thanks a lot.
    Gloria

    Label myLabel = new Label("Hello World");
    //Font(String name, int style, int size)
    myLabel.setFont(new Font("Arial", Font.PLAIN, 12));

  • How to set the fonts in the user profile(very urgent)

    Hi All,
    Can anyone please tell how to set the fonts in the user profile.
    We have a requirement where currently all the data is being displayed in a font and the user want to change that font permanently.
    I hope you have got the requirement.
    Points will be surely awarded.
    Thank you.

    Hi,
    U can do this in SU02.
    Kishi.

  • How to set the BARCODE width and length for label printing..

    Hi All,
    How to set the Code 39 barcode label format in the sizxe of 0.20" * 1.4". By default while printing barcode size exceeds my current requirement. Please let me know to customize the size of barcode labels.
    Thanks.

    I don't know what you mean by "Code 39" because my Output Designer software doesn't offer that barcode (or do you mean "code 3 of 9?). In any case, are you trying to control the size of the text (which is what I think of when you refer to "label")? If you are, then just change the font & size. If you are wanting to modify the physical characteristics of the barcode itself (height & length for a certain number of characters) then you are probably out of luck. Or at least in for some trial & error.
    There are a series of "barcode.xxx" files in the 'config' folder where Output Designer was installed to. These are text files that contain the physical characteristics of the various barcodes for various printers. The parameters that you would be interested in is the height and width of the bars (black & white). For example, a barcode might be defined as .400 high with narrow bars 3 "dots" wide, wide bars 9 "dots" wide and white space the same or different. Presumably changing these values would affect the generated barcode. For example, in this example the wide bars are 3 times the width of the narrow bars so I would assume that relationship would have to remain. To make the resulting barcode shorter you would then use 2 for the narrow and 6 for the wide.
    You would have to make the change in the file(s) that would be used for your printer(s).
    There are four width values for each of the parameters. Most of the barcodes only use 2 but some have 4. I'm assuming that when there are 4, like in "4 8 12 16", that the barcode definition has 4 different widths of bars and/or spaces.
    There is no guarantee that the scanning hardware & software will "see" and interpret the resulting barcode correctly.

  • 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 embed the needed fonts in a pdf file

    Dear Sir/Mam,
    We had purchased licenced version of adobe acrobat x pro
    We are facing issues while embedding the font in the pdf file
    Please find the below mentioned requirement
    Requirement:
    We have a pdf file (template) with some static images and static text in it
    We need to populate dynamic data in the pdf file for this we may use text boxes
    We need to set the font name for the text box and embed that font in the pdf template (Eg:Font to be used in textboxes is "RotisSansSerif-Bold")
    Queries
    Please let us know how to embed the needed fonts in the pdf file?
    Once user exports the pdf file, even if user doesnot have the fonts installed in his system the text need to be displayed in the same fonts,how to acheive this?Eg:if we define "RotisSansSerif-Bold" as font in the textboxes,after exporting the data the text need to be in the same font.
    Note:
    Fonts will only installed in the application server and not in the client system
    The mentioned requirement need to work on below mentioned specifications
    OS:Windiows-XP,  Browser:IE
    OS:Mac osx, Browser:Safari
    Regards,
    S.N.Prasad

    There is a similar post just a few away from yours. I will suggest what I would try. Open your job settings file (press or print preferred to get all fonts) and then select the properties and the font tab. At your font to the always embed list and you will likely need to uncheck the subset box. Then save your job settings (give it a name that is meaningful to you, you can not use the settings file you started with as they are read only and I do not recommend changing that). Maybe that will do the job. Of course that is for the creation of the PDF, I forgot you were talking about a form. You might check the form field properties, but I suspect you have already tried that. Guess I don't play with forms enough. Others may be by to answer.

  • How to set the user who can access to repository

    Hi,
    I know we can create user and group in the tools->security.And if this users is belong to Administrators Group, it can access to RPD and do some modify..
    Can we create group or user who can access RPD in some situation(like mentioned in HELP, A can access to repository on Mondays and Wednesdays, B can access to repository on Saturdays and Sundays) and how to set the privilege..
    Thanks
    anne

    Hi Anne,
    The example specified in Help is about restricting query execution on weekdays/weekends for a particular webgroup. Inorder to configure such access ,
    Double click on the web group name -> Query Limits tab ->Click on Restrict button provided against the physical connection pool ->Select Allow/Disallow by selecting a particular time period.
    Rgds,
    Dpka

  • How to set the extra component to horizontal scrollbar position

    How to set the component to position of horizontal scrollbar , that position contain two component horizontal scrollbar and any component (JButton , JLabel ) like that.. Ms-Word scrollbar ,
    Like that bellow fig.
    <!--[if !mso]>
    <style>
    v\:* {behavior:url(#default#VML);}
    o\:* {behavior:url(#default#VML);}
    w\:* {behavior:url(#default#VML);}
    .shape {behavior:url(#default#VML);}
    </style>
    <![endif]--><!--[if gte mso 9]><xml>
    <w:WordDocument>
    <w:View>Normal</w:View>
    <w:Zoom>0</w:Zoom>
    <w:PunctuationKerning/>
    <w:ValidateAgainstSchemas/>
    <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
    <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
    <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
    <w:Compatibility>
    <w:BreakWrappedTables/>
    <w:SnapToGridInCell/>
    <w:WrapTextWithPunct/>
    <w:UseAsianBreakRules/>
    <w:DontGrowAutofit/>
    </w:Compatibility>
    <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
    </w:WordDocument>
    </xml><![endif]--><!--[if gte mso 9]><xml>
    <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
    </w:LatentStyles>
    </xml><![endif]-->
    <!--
    /* Style Definitions */
    p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0in;
    margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:"Times New Roman";}
    @page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.25in 1.0in 1.25in;
    mso-header-margin:.5in;
    mso-footer-margin:.5in;
    mso-paper-source:0;}
    div.Section1
    {page:Section1;}
    -->
    <!--[if gte mso 10]>
    <style>
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:10.0pt;
    font-family:"Times New Roman";
    mso-ansi-language:#0400;
    mso-fareast-language:#0400;
    mso-bidi-language:#0400;}
    </style>
    <![endif]-->{font:'Times New Roman'}{size:12pt}<!--[if gte vml 1]><v:shapetype id="_x0000_t75"
    coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
    filled="f" stroked="f">
    <v:stroke joinstyle="miter"/>
    <v:formulas>
    <v:f eqn="if lineDrawn pixelLineWidth 0"/>
    <v:f eqn="sum @0 1 0"/>
    <v:f eqn="sum 0 0 @1"/>
    <v:f eqn="prod @2 1 2"/>
    <v:f eqn="prod @3 21600 pixelWidth"/>
    <v:f eqn="prod @3 21600 pixelHeight"/>
    <v:f eqn="sum @0 0 1"/>
    <v:f eqn="prod @6 1 2"/>
    <v:f eqn="prod @7 21600 pixelWidth"/>
    <v:f eqn="sum @8 21600 0"/>
    <v:f eqn="prod @7 21600 pixelHeight"/>
    <v:f eqn="sum @10 21600 0"/>
    </v:formulas>
    <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
    <o:lock v:ext="edit" aspectratio="t"/>
    </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:453pt;
    height:26.25pt'>
    <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\04\clip_image001.png"
    o:title=""/>
    </v:shape><![endif]--><!--[if !vml]--><img src="file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/04/clip_image002.jpg" alt="" width="485" height="27" /><!--[endif]-->{size}{font}
    How to design ?

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

  • How to extract the Physical Query(database Query)

    Hi ,
    How to extract the Physical Query(database Query) from obiee which was fired in obiee
    Regards
    Ranga

    Hi Ranganath,
    Have a look the following links.
    Setting Logging level:
    http://gerardnico.com/wiki/dat/obiee/loglevel
    How to see physical query:
    http://gerardnico.com/wiki/dat/obiee/manage_session_log
    If you are new to OBIEE, spend some hours on the following blog to learn from basics to advanced level.
    http://gerardnico.com/wiki/
    http://obiee101.blogspot.com/
    http://www.rittmanmead.com/blog/
    Hope it helps you.
    Regards,
    Kalyan Chukkapalli
    http://123obi.com

Maybe you are looking for

  • How to extract a field from Binary object

    Hi Guys, I have a Binary object in custom aggregator and I would like to extract a field from the Binary object without de-serializing the Binary object. I know this can be done but figure out how.. Appreciate your help. Have tried this PofValue valu

  • P13/Profile data sharing between two WLP instance

    We are using WLP 10.3 with oracle as our portal database, we have lot of users in QA and their user profile data stored in one of our WLP-1 instance, now there is need of another WLP instance that we would like to use. Here is what we did 1. We clone

  • SAP Portal Integration with Documentum

    Hello All - I am Documentum person and new to SAP Portal and Integration. I need to know can we Integration the SAP Portal with Documentum 6.7. If yes, What all components required from SAP product and my requriement is below. a. Create Forms / GUI t

  • How to know last run time and who ran the query

    Hi I am doing the analysis for all the queries , their last run time and who ran the query Since there are almost 6000 queries , is there any way to find out last run time and who ran the query in one step or through any transaction else It would hug

  • Problem in Installing BlackBerry Desktop Carrier Version.

    Hi. Everytime I try to install Blackberry Desktop for carrier I alway get a error. " Error reading setup initialization file." Is there any solution to it. Operating System : Windows 7.