Home · All Classes · Grouped Classes · Annotated · Functions

Setting Display Size

Introduction

Qtopia provides a resolution independent UI so that it appears as close as possible to its intended design, regardless of the resolution and physical dimensions of the display.

The physical display size can be specified as part of the Qtopia Core display specification. The mmWidth and mmHeight parameters specify the width and height of the display in millimeters. This allows Qtopia to determine the correct font and icon size for the display. For example, a display with a 35mm x 45mm display can be specified as:

    export QWS_DISPLAY="LinuxFb:mmWidth35:mmHeight45:0"

QWS_DISPLAY can also be set in the QVFb skin being used by Qtopia Core's Virtual Framebuffer. For additional information on how this ties into Qtopia's startup also see Running Qtopia.

Font Sizes

The default Qtopia configuration installs many font sizes, however it is only necessary to install a small selection. The standard Qtopia font size is 9 point (1 point = 1/72inch). In addition, several other fonts sizes are used. A recommended selection of point sizes is: 5, 7, 9, 11, 14.

The .qpf font files included in Qtopia are specified by pixel size. Qtopia Core will use the nearest pixel size available if the exact size is not present. In order to determine the desired pixel sizes to be installed on the device the following formulas can be used:

  1. Determine DPI of the display
            DPI = 25.4 * resY / mmHeight
    
            Consider a 240x320 display with 35mm x 45mm physical size:
    
            DPI = 25.4 * 320 / 45 = 180dpi
  2. Determine the font pixel size
            pixelSize = DPI * pointSize / 72
    
            Consider a 9pt font on the above display:
    
            pixelSize = 180 * 9 / 72 = 22pixels

Once the desired font pixels sizes have been determined, they can be passed to configure via the -font switch. For example to use the DejaVu font with the pixel sizes of 10, 12, 16 and 28:

        configure -font dejavu_sans_condensed:10,12,16,28:50


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3