How to apply different fonts to text (words) in the same field

Please help, how to apply different fonts to text (words) in the same field. I want to select text and apply the font, size and color on the selected text in the field, this code below, the setFont method changes all the text in a field (message) of a select statement to the police. Help, please

        message = new AutoTextEditField("","",maxNumChars,editableStyle)
        {
            protected void layout(int width, int height)
            {
                super.layout(width, height);
                this.setExtent(550, 250);
            }
        };
        message.setBorder(border);
        message.setMargin(xyEdgeForMargin);
        message.setPadding(xyEdgeForPadding);
        message.setFont(_menuFont);

Just write your edit as field

SerializableAttribute public class RichEditField extends BasicEditFields

{

int [] offsets = null;

Are police [] = null;

String text = null;

RichEditField (label As String, String text, int [] offsets, make police [])

{

Super (label, text);

This.Text = Text;

This.Label = Label;

Offsets = this.offsets;

This.font = do;

Add validation for offsets and text here

}

RichEditField (label As String, String text)

{

Super (label, text);

This.Text = Text;

This.Label = Label;

This.offsets = {0};

This.font = {g.getDefaultFont ()};

Add validation for offsets and text here

}

/ * Here is a method to add customization of fonts as

setFont (offset, length);

setFont (offset);

public void paint (Graphics g)

{

g, Clear ();

for (int i = 0; i)<>

{

calculate it according to x, y using offset

int length = 0;

g.setFont (do [i]);

If (i<>

length = offset [i + 1] - offset [i];

on the other

Length = Text.length () - offset [i];

g.drawText (text.substring (0, length), x, y);

Super.Paint (g);

}

}

This method is not compiled may have errors and may have many features according to your needs.

Tags: BlackBerry Developers

Similar Questions

  • How to apply different Skins in a single list

    How to apply different Skins in a single list

    See post on:

    http://supportforums.BlackBerry.com/T5/Tablet-OS-SDK-for-Adobe-Air/customized-list/TD-p/648335/page/...

  • In the same field of text using several web fonts

    I know that I can do something like that when you call more weight in a web font:

    SYM. $("copier") .html ("< span style =" make-weight: 700;) "> </span > adobe | Who we are ')

    And the word Adobe will be bolder than our subject. But what about using more than one font in the same text field? I tried this:

    SYM. $("copier") .html ("< span style =" font family: "Open without", without serif;) "> </Span > UHLIG |" Who we are ')

    Now it does not work and I get a SyntaxError: missing) after the argument list

    I then tried

    SYM. $("copier") .html ("< span style =" font family: "Open without", without serif;) "> </Span > UHLIG |" Who we are ')

    and the text returned, but all that has been selected in the menu fonts was what that displayed.

    Is there a way to get around this to display two different fonts, web fonts or not, in the same field?

    Actually, I just found who. So instead of using the family of police at all, instead I did this:

    SYM. $('tête') .html ("Heading1 |") Title2');

    and then assigned a style called headEdge (or other) in an external style sheet that I used for other styles. Worked.

    As we have said before, regardless of the path we can get!

  • different text color in the same line for staticText ScriptUI?

    is it possible to have different text color in the same line for staticText ScriptUI?

    for example, I don't want red color for the word 'RED' text below in the SAME line.

    var l is new window ('dialog', 'Sélection');.

    var s = w.add ('statictext', undefined, "It's a RED pen");
    w.Show ();

    Thank you!!

    Simple,

    var w = new Window ("dialog","Selection"),
         g = w.add('group'),
         s1 = g.add('statictext', undefined,"This is a"),
         s2 = g.add('statictext', undefined,"RED"),
         s3 = g.add('statictext', undefined,"pen");
    g.spacing = 4;
    s2.graphics.foregroundColor = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[1,0,0],  1);
    w.show();
    

    I'm sure that's the answer makes sense "only".

    Trevor

  • When I send a text message and mobile data are off, it is not given, but I do not see this message for a few minutes. I can then refer using "send as a text message. How can I 'send as a text message' in the first place?

    When I send a text message and mobile data are off, it is not given, but I do not see this message for a few minutes. I can then refer using "send as a text message. How can I 'send as a text message' in the first place?

    Disable the iMessage?

  • Two different language versions of Firefox at the same time?

    I am running Windows 7 Home Premium. I have two accounts, one for me and one for my wife. She uses Firefox (Japanese), and I've been using another browser. But I would like to firstly using Firefox (in English).

    Is it possible to run two different language versions of Firefox on the same computer? I want to be able to run both at the same time... (So if I navigate and she wants to check an auction quickly it can without my duty close my browser).

    Can be done with relative ease?

    Make sure that each of you has their own Firefox profile folder.

    See:

    You can add - no.-distance to the command line to open another instance of Firefox with its own profile and run multiple instances of Firefox at the same time.

  • How many users can connect to Apple TV at the same time?

    How many users can connect to Apple TV at the same time?

    Your question is a little vague, what do you mean by "users that connect to AppleTV?

  • How can I work with two icloud ID on the same pc?

    How can I work with two icloud ID on the same pc?

    Define "work".

    What exactly do you want to accomplish?

    You can use the iCloud Panel to connect to iCloud account and use a browser to go to icloud.com and sign in with another account.

  • Printing pictures, is possible to print different pictures on one page at the same time?

    When you print pictures, is it possible to print different pictures on one page at the same time? If this is not the case, the photo paper is lost because you can't get your full 4 prints if you do individually. There is a similar question on the change of the position of the image, that might work. However, the answer is not helpful at all.

    The following steps may be worth a try:

    In Windows Live Photo Gallery... Hold your Ctrl key
    and left click / Select the four pix you want to print...

    In your toolbar left click... Print... Print / Next...

    Now you should see the selection of the photo screen
    the photo printing wizard with the 4 pix selected.

    Left click... ... Left click... "Print options".
    and choose the Type of paper and quality parameters.

    Left click... Next... now you should be on the layout
    Screen.   Scroll and select... 3.5 x 5 cut
    prints cropped and rotation to fit.

    The 4 different pix should appear on the print template.

    Click next and your pix should start printing.

  • Are Microsoft Word and Microsoft Word Processer the same?

    original title: Word

    Are Microsoft Word and Microsoft Works Word Processer the same?

    Friday, October 1, 2010 19:56:09 + 0000, Duchness wrote:

    Are Microsoft Word and Microsoft Word Processer the same?

    No, not exactly.

    Microsoft Word is the name of a word processor of Microsoft.
    There is no product called "Microsoft Word Processer."

    Ken Blake, Microsoft MVP

  • How to share files & folders with other users on the same PC

    We have 2 users on our PC I can find how to 'share' on a network, but not on the same PC (I'm a user 'low tech') all the headings of 'aid' seemed to refer to a network of more than 1 PC

    Files/folders that you want to share between users on the same machine should be placed in the Public, C:\Users\Public directory. That is what concerns the Public directory. MS - MVP - Elephant Boy computers - don't panic!

  • How many times can I reinstall windows 7 on the same computer by using a product key?

    OT: Reinstall Windows 7.

    How many times can I reinstall windows 7 on the same computer by using a product key?

    How many times can I reinstall windows 7 on the same computer by using a product key?

    You can reinstall on the same computer as many times as you want.

    Eventually you may need to activate by using the telephone option.

    Concerning

  • before I unpack my 7520 one.how while many pages will be it scan at the same time

    before I unpack my 7520 one.how while many pages will be it scan at the same time

    Maybe a maximum of 50 sheets of paper are loaded in the ADF feeder at the same time.

  • How can I copy and paste a page in the same DC Adobe .pdf?

    How can I copy and paste a page in the same DC Adobe .pdf?

    Open the Page thumbnails. You can select the pages and then drag the pages. When you hold down the CTRL key you can copy pages.

  • How can I animate various mouse Tracker points at the same time during a recording?

    Hey,.

    I'm trying to animate my character so that his left arm cross out his right elbow, and then the fear character and she jumps on the side. I can't animate the arms at the same time in a single record. How can I animate various mouse Tracker points at the same time?

    Playing right now I seem to be only able to animate a point Tracker of mouse at the same time (i.e. his right arm) and when I return to 're-save' so I can animated left arm, right arm recording is saved on and now only point left mouse Tracker.

    Hope that makes sense, let me know if you need me to develop. Thank you.

    Currently, you'll want to separate Tracker mouse behaviors for each hand. Select the puppet in the project Panel, and then add the second behavior mouse Tracker via the add behavior button ("+") in the properties panel. Then, during recording, make sure to disarm one of them so that other behaviors can control the hand that you drag. We are studying ways to improve this workflow for future versions overview.

Maybe you are looking for

  • A40: What is the name of the memory?

    Hi I recently got a laptop sat pro a40.It shows 240 RAM and I want to add more memory to speed up the game of lineage 2. Question is what is the name of the memory, I need it please?love Kate xxx

  • HP Slate &amp; voice tab - load problem

    After a month of purchase, the tab shows probem when you plug in the charger. I use the original charger HP as well as the tab provided.  The tab does not recognize the charger in the on mode. When the charger is connected, there is no indication of

  • Problem adding new map video to p6-2310

    I have the Pavilion P6-2310 (8.1 Windows 64-bit) and I would like to add a new video card in the empty PCI-E slot in the machine.  I would also like to keep the embedded video feature that I am looking to drive 3 monitors.  I have an older GeForce 73

  • 15 HP laptop: ERROR DRIVER_IRQL_NOT_LESS_OR_EQUAL

    yesterday I updated my window and then ERROR DRIVER_IRQL_NOT_LESS_OR_EQUAL came and restarted my pc.

  • HP G60 notebook PC laptop - model VM803UA #ABA

    -a lately a rattling noise that lasts about one second at a time. This isn't a warning message. Would it maybe the hard drive?