Custom font size

In my Application needs to apply policies external name (sathu.ttf). I tried after the code, but the font size is not changed as my given size. can you suggest me if iam using the right?

final class SathuLabelBox extends LabelField
{

    int color = Color.BLACK;
    int fntSize = 18;
    int _width = 300;

    public SathuLabelBox(String caption,int TxtColor,int fsize,int width){
        super(caption);
        color = TxtColor;
        fntSize = fsize;
        _width = width;
        if (FontManager.getInstance().load("Sathu.ttf", "MyFont", FontManager.APPLICATION_FONT) == FontManager.SUCCESS)
        {
            try
            {
                FontFamily typeface = FontFamily.forName("MyFont");
                Font myFont = typeface.getFont(Font.PLAIN, fntSize);
                this.setFont(myFont);
            }
            catch (ClassNotFoundException e)
            {
                System.out.println(e.getMessage());
            }
        }
    }

    protected void onFocus(int direction){
        color = Color.GREEN;
        fntSize = 22;
        invalidate();
    }
    protected void onUnfocus(){
        color = Color.BLACK;
        invalidate();
    }
    public void paint(Graphics graphics) {
        graphics.setColor(color);
        super.paint(graphics);
    }
    protected void drawFocus(Graphics graphics, boolean on)
    {
        if (on)
        {
            //Get the field size that is available from its manager.
            XYRect rect = this.getManager().getContentRect();         

            graphics.setGlobalAlpha(50);
        }
    }
    public int getPreferredWidth(){
        return _width;
    }
}

replace
fntSize = 22;
with setFont (xxx)

Tags: BlackBerry Developers

Similar Questions

  • Custom fonts: min and max maximum size on the font file?

    Hello

    What is the limit of file size (max and min) on the font file for loading custom fonts?

    I have search the Forum and found a comment by Peter_strange.

    "The documentation says 60 K or 90K depending on how load you, 90 K if you load a an InputStream memory."

    But I want to be sure, share please if someone has the info.

    Thank you.

    Pradeep thanks for your clarification.

    Now, I checked that there is no limit of min file size and maximum file size limit is 90 KB for load of cases and 60 KB in case of direct load flow.

    I also have a resource good sample by peter_strange -.

    http://supportforums.BlackBerry.com/T5/Java-development/font-loader-Manager-utility/m-p/592647#M1223...

  • Custom in a font size/color list

    Hi all!

    Just try to set a custom font in a list control size/color, I am currently using a cell render customized with the following code. The text should be red and the size of 18 points, but nothing happens. Any suggestion?

    override protected function drawLabel():void {
    
    // Text format
    var myTF:TextFormat = new TextFormat();
    myTF.color = 0xff0000;
    myTF.size = 18;    
    
    myTextField = new TextField();
    myTextField.setTextFormat(myTF);
    myTextField.width = 200;
    myTextField.height = 30;
    addChild(myTextField);
    
    }
    

    Thank you!

    Try

    myTextField.format = new TextFormat (null, 18, 0xFF0000);

    ...

    I guess the myTextField is an attribute of the class.

    And you can use the Label QNX class here, unless there is another reason, you use the TextField object.

  • In Safari 10 minimum font size

    Hi people,

    Is there a way to restore the minimum font size setting 9 Safari Safari 10? Zoom the entire page is not as useful as the increase in the minimum size of text. To return to the 18pt size I had before, I up to 150%, which increases all the parts of the page, making it too large to render correctly.

    Minimum size was certainly not perfect, but it was the best option in my situation of low vision.

    Rgds,

    There is circumvention via CSS custom solutions, you can find online.

    I am facing the same problem and have sent feedback to Apple. It borders on the hostile user behaviour, discrimination against people with a weak eyesight and seems to be a crazy interface simplification exercise.

    My only solution is to go back to chrome until Apple decides to solve this problem.

  • Want to change the WordPad default values for font size and line spacing

    I use WordPad quite heavily because it is simple and fast.  But the new version of W - 7 seems to not allow you to change the default values for the font, size and line spacing.  The default values are not suitable for a large part of what I do and I'd like to find a way of quickly and easily, either make the changes permanent or change this to open with a single click of mouse or at most two.  Any suggestions?

    It is the "best" solution to workaround.  After you change your Default.rtf custom, simply move it to your system32 directory and add the "Default.rtf" at the end of the location of your target on the property sheet for your file WordPad.exe.

    Every time that you open its default location in the directory c:\program files\windows NT\Accessoires WordPad.exe, it defaults to now your Default.rtf custom.

  • Too small font size

    Windows did a update on my computer and now all the fonts are too small to play d and no matter what I do I can't get it back to the original font size without being blurry.  I followed the recommendations in the control panel which is 1600 X 900, but all that is extremely small police.  The resolutions of 1024 x 786 and other shrinking my screen or do the police is blurred.  How can I solve this problem?  Everything was going fine until Windows did an automatic update.  I have Windows 7 Home Premium.

    Click Start, type: make text and other items more or less

    Press enter on your keyboard

    Under: Make it easier to read what is on your screen, choose between 100, 125, or 150.

    You can also set custom text size by clicking on the link to it on the Control Panel Home pane.

    Releasing it's easy: with Windows | ActiveWin | Laptops | Microsoft MVP

  • How to increase the font size on the screen of welcome/Login?

    I use Windows 7 Premium on Acer Revo 3610 HTPC connected to a screen LCD of Toshiba 32AV502RZ (720 p). I change the font settings to use the large font size (150%), which seemed to work fine for the account administrator by default, but after that I have created the accounts of additional users for the members of my family, the elements of welcome/login screen becomes really small. I can hardly read the names of the users at a distance of 3-4 meters. Is it possible to increase the size of fonts (and possibly icons) on the welcome/Login screen? Also, is there a way to make fonts same Benoit that the option of customizing Office 150%? (Note: I don't want to reduce the resolution of the screen.) Thank you.

    To set the font size on the screen of welcome from 100% / 125%, 150%, use the respective reg file:

    If you don't know how to import one of these in your Windows registry database, you probably should not mess with the registry at all and instead ask someone who knows... But if you want to try anyway, here's how:

    1. Select the text for one of the files above (just text &, not the name of file) and copy it to the Clipboard (Ctrl + C)
    2. Open Notepad
    3. In the 'Edit' menu, choose 'Paste' (Ctrl + V)
    4. In the 'File' menu, choose ' save under... ". »
    5. In the drop-down list of "save under", choose "All files".
    6. Enter the name of the file
    7. Click on the Save"" button.
    8. In Windows Explorer, locate the file that you just created, and then double-click
    9. Confirm the UAC warnings and RegEdit

    WARNING: Serious problems can occur if you modify the registry incorrectly by using the registry editor or by using another method. These problems may require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk. See How to back up and restore the registry

    Greetings from Bavaria :-)

  • Choose the screen resolution, or customize the font size 125%?

    About to buy 2 new larger monitors.

    Currently have 2 20 "1920 x 1080 running to the font size of 125% of W7 - poor old eyes now need more large text/icons/menus etc, but still need to see the same or more things on screen - so more large monitors reqd.

    In my opinion, to my laptop, which runs 125% or 150% can get down certain pages of fall off the screen, so can not scroll or reach the buttons.

    2 questions:

    It is best to run strictly to the font size of 100% (default)?

    If so, then I need to choose the size of the screen and the resolution to give the desired size of the text/icons/menus 100% font size.

    For my calc, 27 "1920x1080s clocked at 100% of W7 WD gives even font size size text/icons/menus on the screen as if this 20" went to the font size of 135% of W7. This cd (135 vs 125) be the extra size that I need.

    Or shd I get 27 "2560x1440s and W7 just crank up to 125% or 150%?

    Personally, I use 115 dpi and 125% zoom page

    This is a sweet spot for me it down personal preference and a combination of the two,

    Too much dpi dpi of 125% is a little too for other programs to follow or use, I found.

    But using the default dpi 100% and 150% zoom seems to just break up of clarity of the text, unless you up to dpi as my example the custom of 115% PPP,

    Increase the dpi literally means that you can use the page zoom, less

    See you soon.

  • How to change font size text DialogBox

    I want to change the size of the font of dialogbox and its happen if I manually change the font size in the menu Option.

    I want to change it by the code. Please someone help me.

    (I am able to change the font size of labelfield and another textfield but could not get any method to change the font size of the dialog box)

    I solved my problem by using PushModelScreen and custom dialog screen.

  • Windows 7 change randomly font size of my office between Small (100%), medium (125%) and Large (150%).

    I tried to create a customized (like 130%) font size to see if it would stick.  Every time I have restart or shut down my computer, desktop change font size again.  Recently, my computer completely freezes (frozen, all frozen pointer) and the activity led to the CPU on my laptop would show no activity whatsoever.  Then the fan would be instantly and not turn off.  This could be related to a problem with Firefox, which I am trying to determine in a separate proceeding.  But this ice could be related to my font size change randomly, since I have to cold - restart my computer after each freeze-up.

    Hey Bartman,

    Welcome to the Microsoft Answers site!

    The change if the font size could occur if the user account you are using is corrupt. You can try to create a new user account and check if that helps.

    To create a user account

    1. To open user accounts, click the Start button, select Control Panel, click user accounts and family safety, and then click user accounts.
    2. Click Manage another account.

    If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    1. Click create a new account.
    2. Type the name that you want to assign to the user account, click an account type, and then click create an account.

    For more details follow the link.

    Create a user account

    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Displays a text ("sample application") Logo and Description ("this is a sample application") with different font size

    Hello


    I use the universal theme of apex 5.0 and tries to display logo text ("sample application") and description ("This is a sample application") with different font size.


    Type of logo - text

    Logo - sample application - this is a sample application.

    I want to display the description in the smallest font size, so I changed the Logo below

    Logo - < span style = "" are-size: 3.8 rem; ' > Sample App </span > - < span style = "" Dimensions are: 1.8 rem; "> this is a sample application </span >" "

    But I have following problem.

    1 - the font size for both is the same (why the size is not different?, because I gave the size of different font within the span tag)

    2 - the text of the whole logo whose description is displayed twice.

    -Once in place of the actual logo and

    -the second on the left upper tree navigation. (just below the text of the actual logo)

    I tried to use the logo attribute, but what makes the whole logo & its description with the same size. I need size of different font for both, so it is unusable.

    Attribute logo - style = "" are-size: 3.8 rem; ""

    Really appreaciate help.

    Thank you

    Deepak

    DeepakJ wrote:

    I use the universal theme of apex 5.0 and tries to display the text of the logo ("sample application") and description ("this is a sample application") with different font size.


    Type of logo - text

    Logo - sample application - this is a sample application.

    I want to display the description in the smallest font size, so I changed the Logo below

    Logo - application example - This is an example of application.

    But I have following problem.

    1 - the font size for both is the same (why the size is not different?, because I gave the size of different font within the span tag)

    Cannot reproduce. Using the code above results in different format text as expected. (He looks terrible IMO)

    2 - the text of the whole logo whose description is displayed twice.

    -Once in place of the actual logo and

    -the second on the left upper tree navigation. (just below the text of the actual logo)

    Including HTML tags in text in the 5.0/theme 42 APEX logos results in this behavior. I consider this as a bug as (a) it says nowhere that it is not possible to do so; (b) the text of the logo is not HTML - or attribute-escaped when used in the page.

    See How to avoid to show the logo on the navigation bar to get an explanation of the underlying cause and a workaround to allow the common use cases include the text and a picture in the logo. This particular solution is of no use here. The solution to this problem requires a custom with the theme the theme roller style sheet, which is the preferred way and support to customize and extend the universal theme.

    • Click the Thème Roller on the developer toolbar.
    • Expand the CSS custom section.
    • Add this style custom rule:
    .t-Header-logo a span {
      font-size: 3.8rem;
    }
    .t-Header-logo a span:after {
      font-size: 1.8rem;
      content: " - This is a sample application.";
    }
    
    • The page will automatically preview changes.
    • Click on record under and type a name for the style of custom theme.
    • Topic close Roller
    • I hope that decide that it is not a good idea and cancel the mods.
  • PDF FORMS - can you assign a font size of a text field greater than 300pt?

    I create forms PDF from InDesign so that a customer can use as a model for in-store signage. It must be a PDF file so that one of their stores can simply change the wording of the text and print it. For smaller signs, I didn't have a problem, open the form in Acrobat and adjusting the text field properties to suit design styles I prescribed. But on signs largest where they must be legible from a distance, I can't get the size of the font to work above 300. For one of the signs I need the police to be as big as 930.

    Does anyone have a solution for this? Is there a way I could use a script to adjust the font size.

    Whatever the solution is, it should be ready to print.

    Thank you.

    Yes, you can use a script, something like:

    Change the font size of a field

    getField("Text1").textSize = 930;

    but replace "Text1" with the actual name of the field. You can run this in the JavaScript console interactive, or of the mouse event to the top of a temporary button.

  • Font size set to auto but sounds different when the data are populated compared to typed manually

    I have a form where all the size of the font of fields is set to auto. When data are filled in the form in a custom program the font size appears different to the name and first name fields. When the same names are typed manually in the form (not filled in the custom program) the font size remains uniform. There is no coding in the personalized program to manipulate the fonts or the font settings. What could be the cause of the change in the appearance of the font size. Another interesting is that after the program fills in the data, I can click in the areas affected by this problem and the police will change to what it should be but set in the right size once I have quit the field. I also see that some fields when filled will not be characters fat even if the police is set to a bold font.

    When a font of a field is set to Auto, Acrobat/Reader dynamically adjust the font size to match what is entered. When not using Acrobat/Reader to populate a field, it belongs to the program to properly set the font size based on the value of the field. Adobe does not publish any algorithm they use to determine the exact size (depending on the font used and the coordinates of field), so that a third party should use a better estimate (or not even trying at all), that looks like what is happening in your case. When you click within a field by using Acrobat/Reader, the font size is adjusted dynamically, but because the value of the field does not change, it is not defined when the field loses focus.

    A possible solution would be to use JavaScript to record all the field values, reset the form and then fill in the form using the saved values, this would cause Acrobat correctly define the appearances of field.

  • The font size to the watermarks

    Hello.  I am tattoo photos, and even though I chose the larger font size 72 police appears tiny on the images.  I don't know what I did but have the watermark in large print in the past so I know it works.  Can anyone help please?

    lorainea52756690 wrote:

    Yes, you are entered in the character Panel, but did not say where to find the character Panel.  Photoshop is user hostile.

    Hi Loraine

    I feel for you faced with what is one of the more complex software on the planet.  All of us out of our hair and banged my head against the wall at the same time.  But I promise you that, once you get the basics, like in the way things work in general terms, your progress will get faster and faster.

    One thing you could do is to put in place a custom workspace. Go to the window menu and open all the minor signs, including the character Panel and add them one at a time to the vertical column under history and properties.  Drag until you see a blue line at the top and output.  When you have an arrangement anything remotely like below.  Click on Essentials (top-right), then new workspace and give a name.  You can see that I called it Essentials 2

    The point of this exercise is that 1) you can easily access these panels and 2) it requires you to know they exist.

    There are a lot of little tricks to remember concerning dialog boxes of Photoshop (applied to windows in need of the user).  You have thought of the size dialog box type in what concerns the use of the drop-down menu options, but you can also click in the window size, press the up arrow to select its content and type any number you like.  Alternatively, you can fly over the to the left of the size of the window and left-click, drag right to increase in size and left to decrease.  The important thing to remember, is the same trick works in countless other areas of Photoshop.

    Use the tab key a) commit values that you simply enter and b) switch to the next window.

    Escape fate you almost anything.

  • Font size today AR open in Nice, went to 'preferences' and then made changes, nothing works, what is the problem?

    Font size today AR open in Nice, went to 'preferences' and then made changes, nothing works, what is the problem?  Someone help please.  Thank you!

    As of today (version 11.0.7) the only way to put a custom value uses the registry as described above in this thread and now the Adobe Community Help:

    Hi PPP, retina display support. Acrobat, Reader

    Feedback from users, we could change that very soon.

    Thank you

    Luke

Maybe you are looking for

  • MacBook Pro crashed are unable to restore the system.

    Hello, my MacBook Pro comes crashing and for some reason any using the command r does not open OS X Utilities with reset. When I do this the progress bar goes to halfway, then the screen goes white/grey but nothing else. I am running Yosemite passing

  • Update of the ICS Xoom?

    How can you become part of the impregnation study I'm registered, but have not received anything?

  • 20/01/11 Windows preparing to set up Windows

    Last night all our Win 7 Machines did an update and it takes me to restart the computer, once we rebooted the systems that they all were stuck to prepare to set up Windows screen for more than 6 hours, I could understand 1, but so far we have 6 syste

  • I am trying to remove security obsolete updates__

    I have a laptop with a small disk hard due to the fact that it's used a lot I have xp security updates from 2007-2008-2009 and I think I'm for 2010 so, how do I know which ones of these security updates are is most needed to keep running my xp.  I ne

  • How can I remove my usb writable drive protégé?

    How to remove write protection from my USB on my netbook, I can't erase my USB on my computer.