SetFont ActiveRichTextField Bold

How do you define an activerichtextfield to use a bold font?  I tried to do this and it does not work.  In the API, he said setFont is inherited from RichTextField.

Font font_Bold=Font.getDefault().derive(Font.BOLD);
ActiveRichTextField mo_Art_text = new ActiveRichTextField( "text" );
mo_Art_text.setFont(font_Bold);

ActiveRichTextField is much more complicated - it keeps the tables of fonts and colors that harmonize with the regions (start and end offsets) in control and.

I guess you can define an array of police and this will be affected in the region with zero shift. See the documentation for the API for RichTextField.

Tags: BlackBerry Developers

Similar Questions

  • EditField specific text in bold

    Hello

    I want "BOLD" of specific letters in my EditField.

    public void changeToBold() {}
    try {}
    alphaSans = FontFamily.forName ("without BBAlpha");
    Police = alphaSans.getFont (Font.BOLD, 9, Ui.UNITS_pt);
    editField.setFont (do);
    } catch (ClassNotFoundException e) {}
    Dialog.Alert ("Alert");
    }
    }
        
    public void changeToPlain() {}
    try {}
    alphaSans = FontFamily.forName ("without BBAlpha");
    Police = alphaSans.getFont (Font.PLAIN, 9, Ui.UNITS_pt);
    editField.setFont (do);
    } catch (ClassNotFoundException e) {}
    Dialog.Alert ("Alert");
    }
    }

    I add the text to the EditField since a sqlite database.

    While (C1. Next() & {c2.next ()}
    R1 = c1.getRow ();
    R2 = c2.getRow ();
    Temp = r2.getString (0);
             
    changeToBold();
    Letexte += temp;
    changeToPlain();
    Letexte += r.1getString (0);
    }

    * Maybe there is a way to create a LabelField, which contains the text I want to "BOLD", and then add it at the same time to the EditField?

    Thank you

    You can do this by using a RichtextField.

    The text of a RichTextField

    http://supportforums.BlackBerry.com/T5/Java-development/format-text-in-a-RichTextField/Ta-p/445038

  • field.setFont () seems to have no effect.

    I try to have several AutoTextEditField which were the outcome of different font families.  To do this, I call FontFamily.forName then FontFamily.getFont () and then calling field.setFont () on the desired field.  While the options I convey in getFont(), height and style are working properly, the FontFamily is unchanged as the image below shows.

    If I'm doing something wrong please let me know.

    The source code for my program example is below:

       //MainScreen is the basic screen or frame class of the RIM UI.
            MainScreen mainScreen = new MainScreen();
            VerticalFieldManager vert = new VerticalFieldManager();
            HorizontalFieldManager hor1 = new HorizontalFieldManager();
            HorizontalFieldManager hor2 = new HorizontalFieldManager();
    
            FontFamily fontFamily1;
            try{
                fontFamily1 = FontFamily.forName("BB Casual");
            } catch(ClassNotFoundException e) {
                    fontFamily1 = Font.getDefault().getFontFamily();
            }
            Font font1 = fontFamily1.getFont(Font.BOLD,14);
            FontFamily fontFamily2;
            try{
                fontFamily2 = FontFamily.forName("BB Millbank Tall");
            } catch(ClassNotFoundException e) {
                    fontFamily2 = Font.getDefault().getFontFamily();
            }
    
            Font font2 = fontFamily2.getFont(Font.BOLD,14);
            AutoTextEditField field1 = new AutoTextEditField("Example1: ","Value1");
            AutoTextEditField field2 = new AutoTextEditField("Example2: ","Value2");
            field1.setFont(font1);
            field2.setFont(font2);
            hor1.add(field1);
            hor2.add(field2);
            vert.add(hor1);
            vert.add(hor2);
            HorizontalFieldManager hor3 = new HorizontalFieldManager();
            HorizontalFieldManager hor4 = new HorizontalFieldManager();
    
            FontFamily fontFamily3;
            try{
                fontFamily3 = FontFamily.forName("BB Casual");
            } catch(ClassNotFoundException e) {
                    fontFamily3 = Font.getDefault().getFontFamily();
            }
            Font font3 = fontFamily3.getFont(Font.ITALIC,34);
            FontFamily fontFamily4;
            try{
                fontFamily4 = FontFamily.forName("BB Millbank Tall");
            } catch(ClassNotFoundException e) {
                    fontFamily4 = Font.getDefault().getFontFamily();
            }
    
            Font font4 = fontFamily4.getFont(Font.ITALIC,34);
            AutoTextEditField field3 = new AutoTextEditField("Example3: ","Value3");
            AutoTextEditField field4 = new AutoTextEditField("Example4: ","Value4");
            field3.setFont(font3);
            field4.setFont(font4);
            hor3.add(field3);
            hor4.add(field4);
            vert.add(hor3);
            vert.add(hor4);
            mainScreen.add(vert);
    
            //We've completed construction of our UI objects. Push the MainScreen instance onto the UI stack for rendering.
            pushScreen(mainScreen);
    

    There is no space in the name of the font.  Search for 'BBCasual' instead of 'BB Casual'.

  • More small font of J2ME on Blackberry "BOLD"? small proportional, plain?

    Hello, what is the smallest police achievable J2ME on the Blackberry Bold? I ask this, because

    style = "plain" face = "proportional" size = "small".

    seems to be already very large and very bold? Is there a way to get a smaller font, without leaving the environment "J2ME"?

    I would first like to say Java and GNU license gave me a very big heart. This whole community has helped me tremendously to learn how to code, and give in return is the least I could do. I hope that the community in turn help me when I reached the rough places in the future. Don't forget I've been working on this code and it took me hours of exhaustian and works well and I am now it give for free, so please do the same for others. It is the idea not the code that makes money.

    That said, I present to you:

    How to solve the problem of police of blackberry in 5 minutes of coding a moped.

    (please link to this topic as much as possible)

    Step 1: Analyze what is happening between the 2 separate API and why it is so difficult to change fonts.

    Step 2: Ask how are packages come into conflict with each other?

    Step 3: Ask you... can I change the font in general?

    Step 4: Run the text following preference somewhere in the constructor... and somewhere off of the paint method.

    final FontFamily fontFamily[] = FontFamily.getFontFamilies();
    
        font10 = fontFamily[0].getFont(FontFamily.CBTF_FONT, 16);
        Font.setDefaultFont(font10);
    

    Keep in mind that you must have the good net_rim_api.jar installed (or the appropriate folder and configuration via the Toolbox correctly)... and in my case, the following code is at the top of my class file and I use an external library on my toolbox.

    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.FontFamily;
    

    now, it's just a natural function used for user interface of blackberry and midlets applications using the Blackberry net_rim_api.jar as an external module.

    Those of you who are running a blackberrycanvas or a touch event for the blackberry storm should automatically know what I speak. Send me an Email if you are at all confused, that I'll get back to you.

    Anyway go...

    Run this natural function and go ahead and test it using a common g.drawString ("Hello World", 20,20, g.TOP | g.LEFT);

    Here you should notice that your policy has changed the font specified by Font.setDefaultFont (font10);

    This is because the static method changes all fonts... including police BlackBerryMenu I might add.

    Then, perform the following steps:

    Step 5: Ask yourself... but what happens if I separated from the places that need separate policies?

    Good question... I had this one for awhile and found a brilliant answer.

    Note the following points:

    Font BBFont = javax.microedition.lcdui.Font.getDefaultFont();
    

    Here is what just happened, the above code catches the current default font defined for the lcdui police. Or in our case, the police of the Midlet. As I looked into it... There is no method to create a nice font that corresponds to the blackberry one again... but after calling

    Font.setDefaultFont (font10);

    in this case the police is referenced as...

    net.rim.device.api.ui.Font

    It amends the police for both the system and the

    javax.microedition.lcdui.Font

    It is signifigant for us because now, because we can store the new settings, we can make the magic happen.

    Step 6: Perform magic with the fonts.

    Store any desired blackberry font using the following...

    final FontFamily fontFamily[] = FontFamily.getFontFamilies();
    
        Font font10 = fontFamily[4].getFont(FontFamily.CBTF_FONT, 16);
        Font.setDefaultFont(font10);
        javax.microedition.lcdui.Font bbfont = javax.microedition.lcdui.Font.getDefaultFont();
    

    do not hesitate to make the police a variable, you can reference from the whole class... or keep it in another class if you wish.

    then do this in the paint method...

    protected void paint(Graphics g){
    
    g.setFont(bbfont);
    g.drawString("Hello World",20,20,g.TOP|g.LEFT);
    
    }
    

    You should find that the police has changed very nicely your new font... here make a function out of it, change the fonts to the top.

    Step 7: bask in the glory of magic.

    So you tell me if I call Font.setDefaultFont (myfont);

    and I use a blackberry police... it will change the current font... then I can go then enter this police and store it and then call at a later date, and it will use this font?

    I mean that Times New Roman!

    Well, if they have Times New Roman can be my guest...

    but later I want to black Ariel...

    Yes same process be my guest...

    But man according to the forums, I can't do that...

    Yes, and you can quote me on this one there according to JavaLover53 you can use what font you want, as long as you do the police first... and it is strongly recommended that you do outside the paint function and you store fonts in one easy to access place in memory, namely the Summit also recommended

    import net.rim.device.api.ui.Font;import net.rim.device.api.ui.FontFamily;import javax.microedition.lcdui.*;public class BBFontCanvas extends Canvas {javax.microedition.lcdui.Font timesnewroman;javax.microedition.lcdui.Font bbalphasans;
    
    public BBFontCanvas(){  final FontFamily fontFamily[] = FontFamily.getFontFamilies();
    
       font10 = fontFamily[4].getFont(FontFamily.CBTF_FONT, 16); Font.setDefaultFont(font10);  bbalphasans = javax.microedition.lcdui.Font.getDefaultFont();
    
    //have fun and make another font...      font10 = fontFamily[0].getFont(FontFamily.CBTF_FONT, 20); Font.setDefaultFont(font10);      timesnewroman = javax.microedition.lcdui.Font.getDefaultFont();}
    
    public void changeFont(int fontnum){
    
    //i figure from here you can do a switch statement to change the font...//or idk perhaps just do it by fontnum//you guys gotta code that up haha.//it'll probably look like this though...   //public void changeFont(int fontnum,javax.microedition.lcdui.Font thefont){}//or maybe you wanta return a new font so....//public javax.microedition.lcdui.Font getNewFont(int fontnum,javax.microedition.lcdui.Font thefont){}
    
    //then make like a switch statement, and then call this to establish the fonts you want in advance and store //these fonts use them for classes you have for classes you've made like void setFont(Font myfont); <--- in//that case your midlet class never even heard of the blackberry font so you're passing a normal lcdui font.//anyways point being as long as g.setFont(myfont); has the proper font this stuff works. :-)
    
     font10 = fontFamily[2].getFont(FontFamily.CBTF_FONT, 16); Font.setDefaultFont(font10);  bbalphasans = javax.microedition.lcdui.Font.getDefaultFont();}     public void paint(Graphics g){     g.setColor(0,0,0);     g.fillRect(500,500);     g.setColor(255,255,255);
    
    //set the font to bbalphasans or in this case fontFamily[4] from the constructor...     g.setFont(bbalphasans);     g.drawString("Hello World",20,20,g.TOP|g.LEFT);     }}
    

    and for those of you who don't like comments... just look at this code instead...

    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.FontFamily;
    import javax.microedition.lcdui.*;
    public class BBFontCanvas extends Canvas {
    javax.microedition.lcdui.Font timesnewroman;
    javax.microedition.lcdui.Font bbalphasans;
    
    public BBFontCanvas(){
        final FontFamily fontFamily[] = FontFamily.getFontFamilies();
    
        font10 = fontFamily[4].getFont(FontFamily.CBTF_FONT, 16);
        Font.setDefaultFont(font10);
        bbalphasans = javax.microedition.lcdui.Font.getDefaultFont();
    
          font10 = fontFamily[0].getFont(FontFamily.CBTF_FONT, 20);
        Font.setDefaultFont(font10);
          timesnewroman = javax.microedition.lcdui.Font.getDefaultFont();
    }
    
    public void changeFont(int fontnum){
    
        font10 = fontFamily[2].getFont(FontFamily.CBTF_FONT, 16);
        Font.setDefaultFont(font10);
        bbalphasans = javax.microedition.lcdui.Font.getDefaultFont();
    }
         public void paint(Graphics g){
         g.setColor(0,0,0);
         g.fillRect(500,500);
         g.setColor(255,255,255);
    
         g.setFont(bbalphasans);
         g.drawString("Hello World",20,20,g.TOP|g.LEFT);
         }
    }
    

    in any case this is my tutorial police and I currently have surprising good labour code. I am so happy to finally use the blackberry fonts and it proves just everyone and everything that can make an application user interface, unless of course the components made... a midlet can do as well on a blackberry.

    They don't call it Java for nothing, if you know the ins and outs, it's like a cup of coffee it'll get you WIRED!

    Take advantage and ask me questions if you cannot get the fonts you want. This should solve any problems for those of you who have worked hard on your midlets and problems of police... and for those of you who are lazy... Simply change the default system font, and all will be the police.

    -JLover53

  • "BOLD" format for fields

    Hi team,

    I have the following screen.

    I need to format the "status" and "First to know" fields with the "BOLD" format. I don't need the word 'Status' not the word "Taken".

    I have a following code:

    / * Format for text * /.
    Police font_bold_title = this.getFont () .derive (Font.BOLD);

    _first_aware_title. SetFont (font_bold_title);

    _status_title. SetFont (font_bold_title);

    Add (_firstAwareField);

    Add (_Status);

    Any suggestions?

    Please refer to this sample.

    Comment - formatting text in a RichTextField
    Article number: DB-00124

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

  • Why Keynote warn the font GillSans light and "BOLD" missing?

    For several years now, I got an error of central point which is more one annoyance than other. And recently, I created a presentation that using one of the models of stock of Keynote (with Keynote 6.6.2, although I have experienced this problem with previous versions) and encountered the same error.

    My presentation was very simple, so I do not have any changes to the Slide Master. I used the showroom model.

    This model uses only the font Helvetica and which does not change during the preparation of my presentation. I've worked on Friday, saved (several times), then it opened Sunday to continue to work on that.

    When you open the presentation, I received a box of error dialog warning me that GillSans light and bold GillSans lacked. This scenario often occurs when I use Keynote, and it's the source of my boredom.

    What is causing this error appear? If a particular font GillSans, why this error pops up when opening it does not use a Keynote presentation?

    I use Suitcase Fusion to manage my fonts and keep GillSans essentially disabled, unless specifically, I want to use this font. Keynote intrinsically search and require the GillSans for any presentation, even if the presentation does not use the police?

    Thank you for your time.

    I think that all users have this problem.

    We, the users don't know how his cause and Apple don't give advice on errors in the software here.

    So the best advice is to choose her "Don't warn again" option in the warning message and do not think it's a fault with your file.

  • How to turn off bold/italic/underlined in displayed as plain text HTML mail?

    Hello!

    I use Thunderbird on a workplace where HTML mail is fairly regular, but I
    prefer to hide all the HTML formatting and display as plain text, which can
    be easily done by choosing View > Message body as > plain text, but it seems
    to convert the original HTML formatting to this simple text formatting,
    which means that surround it in * for "BOLD", _ to highlight, and / for italics, which
    I find it embarrassing, because often, it makes the message more difficult to read, for example
    inserts many formatting consecutively: "* reason for the software.
    "Replacement * decision: *", sometimes inside words and generally done more
    harm than good. It also breaks URL, because they are displayed like this:
    '_ https://google.com _' and back treated Thunderbird pointed out in
    URL, so the links are incorrect.

    Can this formatting everything be placed when displaying HTML in plain text?

    I wrote the question, I found my answer in register configuration of Thunderbird, but I decided to publish it anyway, as I've found that asking one elsewhere. The solution is to go to Preferences > advanced > Config Editor and the option 'converter.html2txt.structs' set to false.

  • Blurry text "BOLD" in the list of messages not read and Board calendar and list files

    After the update of TB to 38.2.0 "BOLD" of fonts on the Panel with the list of folders, unread messages appear in bold in the list of received messages and all text with a font in bold in the calendar Panel has become blurred and almost unreadable. All the solutions proposed in the branch with the similar issue 4 months ago were not useful. Someone knows how to fix this?

    Two questions you can answer:

    (a) what version do you use?

    (b) there is a definition of the 'hardware acceleration' options | Advanced | General - what happens if you reverse this check box (if it is the turn it, if it is off turn it)?

  • I need assistance with my auto signature and why my emails when I answer you are only bolded?

    I can't my auto signature of normal appearance. Every time now that I'm going to answer an email, he makes bold all the e-mail.
    Can you please help?
    Thank you

    If the police is important, then you must do all of this as an image. E-mail cannot guarantee to display in your policy chosen; your font may not be not installed or available on the machine of the recipient and in all cases, the beneficiary may replace or ignore your font settings.

    You say you tried 'all options' but that does not tell us what you have, and more importantly, have not tried.

    Yet once, how did you create your signature?

  • Problem with fonts. If enable hardware acceleration "BOLD" fonts look weird, but if I turn it off, "BOLD" fonts seem good, but normal fonts look weird

    Title.

    With hardware acceleration: http://imgur.com/jHRk6Yl words 'empty' look and really weird air instead of being "BOLD". But if I disable it, normal fonts look "weird" in some Web sites (not all) and are difficult to read.
    Any solution?

    Thank you!

    Hmm, another user Windows 10 reported this after installing some Helvetica fonts.

    In your screenshot, the text 'blue indicated' is the following style rule:

    font-family: "helvetica neue",arial,helvetica,sans-serif;
    

    So I guess you have Helvetica Neue installed locally, which seems to have strange problems in Firefox.

    If you don't want to remove this font on your system, you can use custom style rules for Firefox overrides Arial, which is what I see on Windows 7 on this page. I saw the first time that documented in this article (from 2010!):

    Helvetica on Firefox: the substitution of fonts with CSS | Keyvan Minoukadeh

  • Is it possible to put the words in bold or underline things in email in thunderbird?

    When you send a note with the name of the books for example, I would like to highlight the name of the book which is the right thing to do, but I can't find anywhere in Thunderbird where I can use this option. Also, I can't find how to use italics or bold to emphasize something. Please notify. Thank you. Billie Matelski

    Perhaps you composed in HTML.

    Right-click on the account, in the folders pane, select settings and in composition and correct select compose in HTML.

  • turn off bold

    text entered in the search window is bolded. implement non-bold.

    HI IainElliott,
    Update your plugins to the latest version. Make sure you are aware:

    If you see problems see also:

  • When composing an email and by selecting "BOLD" police, why the FAT aspect disappears so later at the end of a sentence.

    This aspect has been a problem forever, and it's frustrating. Before I start typing a sentence, I select "BOLD" and the font size. Lets say that I go back to the middle of the sentence to make a correction, then place the cursor at the end of the sentence or select the end key to continue typing, the aspect "BOLD" disappeared.

    And it's frustrating that support Thunderbird does not take possession to allow direct communication with them rather going in this direction. They will not be disturbed. I'm about to kick on the road and go with a different email provider.

    Probably because when you go at the end of the sentence, your insertion point (read: slider) is outside the HTML tag that defines the area in bold text formatting. How would be able to tell if you want to stay in the "BOLD" area, or go outside it Thunderbird?

    My approach with this is to place the cursor inside the part already "BOLD" and type, fix if necessary existing text, or move to a html source viewer item to be more precise about the location of the cursor. I see no easy way for the system to tell us if the cursor is in the box "BOLD" or not. Ideally, there could be an indicator in time real tell us what the formatting is at the location of the cursor, but consider how many combinations of fonts, color, size, weight, style etc it could be that should be answered to be really useful.

    I have all the same trouble in Word and free Office; It is intrinsic to the use of the supplement, isn't strange, IMHO, to Thunderbird.

  • Police on Google, Facebook and many other sites, but not all, is "BOLD", no matter what I do.

    Since I installed Firefox on my newly-fixed computer (has been completely annihilated, installed FF 06/05 / 15), fonts for several sites has been "BOLD", regardless of how I set my preferences. It comes to Facebook, Google and Gmail. If I say not to allow pages to choose their own fonts, this problem is solved, but the characters such as arrows do not appear on other sites.

    What I really want is to be able to see that I read something by having make it back to normal, rather than "BOLD". The only way I can do it is by prohibiting the pages to choose their own fonts. Is it possible to fix this?

    You can try to disable hardware acceleration in Firefox.

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    You will need to close and restart Firefox after enabling/disabling this setting.

    Some display drivers also have parameters that can affect the appearance of fonts.

    Were you able to find which fonts are assigned by the police test?

  • How can I change the fonts, is it "BOLD", etc. in a new message?

    I use TB 31.5.0. When you compose a new message in HTML, I don't see a way to easily change the fonts, the font size, "BOLD", etc. I have 'compose messages in HTML format' ticked. My wife says she thinks this device used to be there in earlier versions of TB.

    Thank you
    Thom

    Your formatting bar is turned on.

    In the entry window Menu bar select View-Toolbars and check.

    No menu bar? Press the ALT key.

Maybe you are looking for

  • How can I get mozilla firewall

    I was told that mozilla has the best firewall and I get a lot of pop-up windows. I heard that your firewall is what I need, but since I'm not very computer I don't know how to check that I had the firewall when I downloaded mozilla. I have

  • HP service plugin - nexus 7

    Hi all I had a nexus 7 (android 4.4.2) with hp service plugin pre-installed. I had a wifi hp officejet 6700 printer connected via wifi. I had a word (.doc) document in QuickOffice. I click the button print in QuickOffice and he has shown the Sub scre

  • Removal of noise from charge related? -E2 Bike LTE

    I use an app 3rd - party for the specific purpose of change/activation of the related fresh sounds. While it works fine when I plug my phone in & when my battery reaches 100%, the disconnection is interrupted, or rather to silence as it turns off. "L

  • OR USB-6009 with op-amp to amplify the analogue output

    Hello. I use an NI USB-6009 data acquisition to send a signal to a proportional pressure regulator which varies the pressure of pneumatic system. Unfortunately, the controller of pressure requires a signal of order analog 0 - 10V and the 6009 can 0 -

  • cluster connection does not work

    Please see my picture. Can someone help me solve this cut wire? The error tells me the bunches are of two different sizes, but that makes no sense. Thank you