Set the size of the police according to PPI or similar (BB10 vs PlayBook device)

Hey everybody,

I wanted a PlayBook App to BB10, the port ran my code in the Simulator and all seemed well (+ it even worked except a few places where I've hardcoded, adjusting the position of the images). I was happy, as it was perfectly in the Simulator, until I realized that the BB10 devices will be only about a third of the size of the PlayBook, respectively one-third that of what we see in the Simulator.

So if I create a label with size 16, it may seem well on the PlayBook and the Simulator, but on the real device, it will be like 16/3, which allows small. How do you communicate or géreriez you it? I don't want to rely on stageWidth, stageHeight reading saying: "oh, that is 1024 x 600, must be a PlayBook, so I use the normal font" (because we do not know which devices will come in the future)

Or y at - it a way to get the PPI or something similar by programming? Anything that could be used

You can get the RFP to:

Capabilities.screenDPI;

Of

import flash.system.Capabilities;

I use the PlayBook screen as the basis of BB10 phones for reports.  So I have a centralized function to return:

public function get tabletRatio() : Number
{
    return this.dpi / 170.0; // 170 being that of the playbook
}

Which is about 2 x for BB10 devices.  Seems to work quite well for fonts and nothing else.

When BB10 is available for the phone and the PlayBook, I mighrate on CSS style sheets to help with all this.

Tags: BlackBerry Developers

Similar Questions

  • Make the size of the police according to different screen resolutions

    Hi all

    I'm developing an application that needs to run on the two devices OS 6 and 7. There are a number of devices that fall into that category, I need to standardize the sizes of police across all screen resolutions.

    A few messages in the support forum, I understand that I need to use UNITS_pt as the police unit in order to standardize the size of police across all resolutions.

    But my client gave me sizes of fonts to use in pixels. Should have sizes from photoshop. What I need now, is to convert the font size of the pixels into points. I created a method that you can find below, for this conversion, but I don't know if it will work or not. I need an expert advisor.

    public static Font getFontPlain(int fontSizeInPixels) {
            try {
                fontFamily = FontFamily.forName("Helvetica");
            } catch (ClassNotFoundException e) {
                Logger.blackBerryErrorLog("Error creating font", e);
            }
            int size = Ui.convertSize(fontSizeInPixels, Ui.UNITS_px, Ui.UNITS_pt);
            Font font = fontFamily.getFont(Font.PLAIN, size, Ui.UNITS_pt);
            return font;
        }
    

    Any help on this will be appreciated.

    Thank you much in advance.

    "Should have sizes from photoshop".

    Unfortunately, it's a potential problem.  I've been in this situation before, and the size of the pixel depends on the size of the image that the designer uses to work up the screenshots.

    I had a designer who has very well used 72 dpi in the development of its screenshots and therefore the size of the pixel corresponding points, a point is 1/72nd of an inch.  This could be the case here.  What device has been the designer develops for and what size have been specified for the various policies?

  • How to set the police page for a reason that my page is showing at 16 pxl and im half blind. I need resized.

    somehow, the police of the page has changed and it is wayyy too small. I just need to know how to go and resize pixels for the page appears just or normal rental.

    You can use an extension to set a page zoom and the size of the default font on the web pages.

  • How to set the police Chinese in the output PDF report 12 c

    Hi all

    Form 12 c can call report 12 c, but Chinese display font can't correctly, someone has config guide how set the font Chinese in the PDF report 12 c output. Thank you!

    After installation of Patch for Bug: 22224336, can display Chinese fonts properly.

  • How to set the police custom in the BI Publisher

    Hi all

    I use BI publisher (5.6 Build 45) and MS word (2010) presentation of the data.
    The generated pdf file must have Verdana as its police force. So I changed the font Verdana in rtf.
    But when I generate pdf from this template, the police is automatically converted to Helvetica.
    How can I generate pdf using Verdana as font?


    Help, please.

    Thank you

    Here's the documentation to implement external policies:

    http://www.Oracle.com/technetwork/middleware/bi-Publisher/learnmore/demo-library-TOC-173301.html

    Good luck!

    Thank you
    Pradeep

  • Animate the edge - sets the resizable text animated along (it is useful for all devices)

    Hello

    I built a walk produced through demo using edge animate, in this demo I put stage the percentage, but when I see my ipad demo, the text remains its original size.

    Please help me, how the text according to my persentage of scene.

    Concerning

    E. Ku Muduli

    If you want that two separate text with two sizes of separate text boxes, your code would look like this:

    set the originals

    var originalWinWidth = $(window) () .width;

    set the font size as original

    var originalFontSize = 20;

    var headingFontSize = 30;

    Set the ratio of change, each change of size

    var ratioOfChange = 50;

    set the font size using jquery

    SYM. $("conteneur") .css ("font size", originalFontSize);

    SYM. $("rubrique") .css ("font size", headingFontSize);

    $(window) .resize (function)

    {

    get the width and height as the window resizes

    winWidth var = $(window) () .width;

    get the width difference

    var winWidth = widthDiff - originalWinWidth;

    check if the window is larger or smaller than the original

    If (widthDiff > 0)

    {

    our window is larger than the original so to increase the font size

    var pixelsToIncrease = Math.round(widthDiff / ratioOfChange);

    calculate the new font size

    var newFontSize = originalFontSize + pixelsToIncrease;

    var newHeadingFontSize = headingFontSize + pixelsToIncrease;

    new font size Set

    SYM. $("conteneur") .css ("font size", newFontSize);

    SYM. $("rubrique") .css ("font size", newHeadingFontSize);

    }

    on the other

    {

    our window is smaller that the original so decrease the font size

    var pixelsToDecrease = Math.round (Math.abs (widthDiff) / ratioOfChange);

    calculate the new font size

    var newFontSize = originalFontSize - pixelsToDecrease;

    var newHeadingFontSize = headingFontSize - pixelsToDecrease;

    Set the new font size

    SYM. $("conteneur") .css ("font size", newFontSize);

    SYM. $("rubrique") .css ("font size", newHeadingFontSize);

    }

    })

  • Exhibitor do not reduce the size of police accordingly

    I have InDesign CS6 (PC) and I am working on a document created by our parent company in Germany. When I add the trademark and make exposing, it moves, but it does not reduce the size of the font of the actual registered mark. When I create one in a new file, it will work correctly. I tried to copy and paste into the existing document and it is up to the rear. I don't know there is a setting somewhere that needs to be changed. I hope someone out there has had experience with this and can help.

    It comes to the existing document. The first is earlier makes exposing. The 2nd is after that that she has made exposing. It moves upwards, it does not reduce the size of the font of the trademark accordingly symbol.

    It comes to the new document.

    Go to the InDesign / Edit menu and click on Preferences followed by advanced Type and percent correct.

  • How to dynamically set the width of the bitmap as mobile size and adjust accordingly the photo.

    I have the bitmap image. Now, I want the bitmap to the screen but its size should be as mobile width and adjust the picture accordingly. For the former I enlarge it should look like small small mobile screen.

    My code but its not working.

    public static BitmapField getHeader() throws NullPointerException {}
    Bitmap b = Bitmap.getBitmapResource("img/logo.jpg");
    return (new BitmapField (b, Field.FIELD_HCENTER) {})
    Protected Sub layout (int width, int height) {}
    setExtent (365, 80);
    }
    });
    }

    You will need to put the image yourself to match the dimensions you need.

    Watch Bitmap.scaleInto)

    If you have transparent images, then watch this:

    http://supportforums.BlackBerry.com/T5/Java-development/resizing-transparent-bitmaps/Ta-p/703239

  • How to set the font size of the title to different screens in fluid layout?

    Build a fluid layout (Responsive Web design), and could I please know how to set the font size of title (h1, h2, h3 etc.) and other mobile police, tab size and wallpapers?

    I use no px values.  I generally use the % font size in the selector body inside my queries.  Adjust the dimensions accordingly.

    / Special rules for mobile phones. */

    @media only screen and (max-width: 481px) {}

    Body {size are: 85 %}}

    }

    / Special rules for tablets * /.

    @media only screen and (min-width: 482px) {}

    Body {make-size: 100% ;}}

    }

    / * Special rules that apply to workstations * /.

    @media only screen and (min-width: 1050px) {}

    Body {make-size: 135% ;}}

    }

    Nancy O.

  • How to get to 'see' to be able to set the font size? Too small, can't read, especially in Facebook.

    Suddenly, it seems that the police got so small, that I can hardly read it. I have good eyesight and a 21 or 22 "screen. But Firefox has only a single drop-down list, not others he used to have. I need to be able to define the size of the content on the screen. Help! Thank you!

    To the menu 'View' try to press 'Alt' + 'V' on the keyboard.

    To set the default zoom: "Ctrl" + "0" (zero)

    To display the menus again, right-click on the left end of the address bar (where there is an icon of the current web page) and select "Menu Bar".

  • Set the font size for the target PCs ONLY

    I know that I have to include a custom ini file to specify the name of the font AND size for target PCs (those where the EXE is executed).

    For example

    appFont = "Tahoma" 13

    dialogFont = "Tahoma" 13

    systemFont = "Tahoma" 13

    Is there a way to specify only the size of the police and not the name? (i.e. I want to use the specific font for a given PC, but I would like to put its size).

    I tried with

    appFont = 13

    but this setting is ignored.

    When I used

    appFont = '0' 13

    the size was successfully set, but what is the '0 '?

    Hey Vix,

    Yes, I think it will work.

    You could confirm the fact,

    The default Application police is the police of the Box of Message which is respectively Segoi UI and Tahoma for XP machines with Windows VISTA. To check this on a Windows XP-based computer, follow these steps:

    1. "" "Open Start" settings "Control Panel" display
    2. Click on the appearance tab, Advanced
    3. Select the Area of Message of the point: drop-down menu
    4. The police will appear in the are: drop-down menu

    .. the police exchange between '0' and Tahoma for example...

  • How to set the size of text with the report generator

    Hello.

    I'm trying to set the size of the text with the report generator, but I find that I can't do this. Here is an example of the code that I use. Can someone tell me what I'm doing wrong please?

    Thank you, Alec

    I was generation from a word template.

    I hacked my version of the Toolbox to give me maunal indicator control "model? He had obtained his permenatly self stuck on "T". I exposed this flag outside the API, so I can control under certain weather conditions I may or may not use the model police.

    Does anyone know how to use this toolkit, or I did the right thing?

    Cheers, Alec

  • How to set the size of plot-legend with properties?

    Hello

    in the screeenshot I create 10 plots that are displayed in a xy chart.

    According to the number of plots of the legend is updated.

    How can we set the legend is highest of 5 plots and other plots 5 (or more) is visible if you are using the scroll bar?

    Thank you

    Solved.

    Name of the property is under: legend + size + high

  • How to set the size of my screen?

    Original title: maintenance

    How to set the size of the screen

    Norm 21

    How to set the standard for screen size 21

    Resolution:
    Right-click on a free space of the desktop > Personalize > Display Setings > move the slider to the left or right to set the resolution. Check your user manual, see if she tells you what resolution is for your computer. My laptop is using 1280 x 800 pixels.

    Here is a table of the guide line:

    You can also try this method...
    Re - set DPI:
    Right-click on a free space of the desktop > customize > column to the left, adjust the size of police (in PPP) > uac prompt > click default scale (96 DPI).

    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • Is there a way to set the font size as default in WordPad - Windows 7?

    In Windows 7, is there a way to set the default value in WordPad to Courier 10? I see no place to set the default value. I save my changes and when I close and reopen the document it's back to Courier 11 and the spacing is all off. I create documents for customers who need very specific settings (including a 10 - PT font.) to copy and paste resumes to online applications. Once I have send the plain text for them, they, also, versions I can save these specific parameters. It's extremely frustrating; in XP and Vista, I was able to save 10-PT policy documents. I don't see why this was changed. Any suggestions? Anyone at MS have the power to solve this problem?

    I created a document called a new Doc - highlighted space vacuum-made my the font changes and size and saved.  So when I want a document with my size settings and the police, I opened my new Doc.  Make sure that when you save it you rename this new Doc remains empty.  I created a shortcut on the desktop and open the new Doc instead of WordPad.   I guess you can do your employees.  I hope this helps.

Maybe you are looking for

  • Could not open the page error

    This error occurs when I click on the link in an email that I received.  Then I tried to open Facebook.com in general, it does not open I can't log on Facebook, or the New York Times site NYT.com.  I think it's something to do with cookies from the s

  • random display of XP screensaver

    How do I change a regular order random display screen saver?

  • Locked - can't access the "rocket"

    I have a new Sansa Fuze and it's messed up.  I can turn it on and off and accessing some program (podcast) is first up, finally one that I was actually listening to, but does not have the up/down button.  I can move files on the left and right, howev

  • Least expensive way to add products to my existing account

    I have the plan $ 9.99 right now with Photoshop and Lightroom, but I want to add Premiere Pro and possibly another (affects perhaps) as well.  What is the least expensive way to do so as I have Photoshop, Lightroom, Premiere Pro and another?

  • convert 3 minutes of each file.

    We need to encode the QT to H264 files, but we only need exactly 3 minutes at the beginning of each file.  Is it possible to configure the SOUL to automatically convert 3 minutes of each file? without having to enter each clip and set in and out poin