Loading ...
Sorry, an error occurred while loading the content.

Re: Text box font size problem

Expand Messages
  • JanetTerra
    Did you issue a font command to the main window or the textbox? It may simply be that the default fonts are set differently on the computers. Janet ...
    Message 1 of 11 , Oct 31, 2006
    • 0 Attachment
      Did you issue a font command to the main window or the textbox? It
      may simply be that the default fonts are set differently on the
      computers.

      Janet

      --- In libertybasic@yahoogroups.com, "Bob - K9ZLU" <pilot398rl@...>
      wrote:
      >
      > Using the same LB4 program on different computers generates
      different
      > letter sizes in the text boxes. This causes some text boxes to not
      > display all of the text. What can I do to generate the same text box
      > text size on all computers using the same LB program. This text box
      > letter size problem happens using LB4 with a .bas file or an LB4
      > application .exe file made from the .bas file.
      >
      > Thanks for any suggestions.
      >
      > Bob
      >
    • Richard Russell
      ... The DPI (dots-per-inch) value is set under Display Properties... Settings... Advanced . You can get there by right-clicking on the desktop or via Control
      Message 2 of 11 , Nov 1, 2006
      • 0 Attachment
        --- In libertybasic@yahoogroups.com, Chergarj@... wrote:
        > Your description sounds familiar. Find the DPI settings - can't
        > remember how to find its path

        The DPI (dots-per-inch) value is set under Display Properties...
        Settings... Advanced . You can get there by right-clicking on the
        desktop or via Control Panel.

        However don't be tempted to change the DPI value to 'fix' the text
        size problem. The optimum value is determined by the screen size
        and resolution (see table below) and if you change it all programs
        will be affected, potentially making text harder to read and
        breaking other applications.

        The best way to tackle this issue is to find the current DPI setting
        using the GetDeviceCaps API call, and adjust the font size to suit:

        open "Example" for window as #main
        hwnd = hwnd(#main)
        calldll #user32, "GetDC", hwnd As long, hdc As long
        calldll #gdi32, "GetDeviceCaps", hdc As long, 88 As long, dpi As long
        PRINT dpi

        (There's probably an easier way to do this - I'm not an LB expert).

        Richard.

        Table relating DPI value to screen size and resolution:

        800 x 600: 10.4" diagonal at 96dpi, 8.3" diagonal at 120dpi
        1024 x 768: 13.3" diagonal at 96dpi, 10.7" diagonal at 120dpi
        1152 x 864: 15.0" diagonal at 96dpi, 12.0" diagonal at 120dpi
        1400 x 1050: 18.2" diagonal at 96dpi, 14.6" diagonal at 120dpi
        1600 x 1200: 20.8" diagonal at 96dpi, 16.7" diagonal at 120dpi
      • Stefan Pendl
        Message 3 of 11 , Nov 1, 2006
        • 0 Attachment
          >
          > Did you issue a font command to the main window or the
          > textbox? It may simply be that the default fonts are set
          > differently on the computers.
          >
          > Janet
          >

          Use the function below to get the DPI settings of the current display.
          Use the returned value to scale the window size, control size and text size.

          '---code start
          print GetScreenScale()
          end

          function GetScreenScale()
          calldll #user32, "GetDC",_
          0 as ulong,_ ' entire screen
          hDC as ulong

          nIndex = _LOGPIXELSX

          calldll #gdi32, "GetDeviceCaps",_
          hDC as ulong,_
          nIndex as ulong,_
          dpi as ulong

          calldll #user32, "ReleaseDC",_
          0 as ulong,_ ' entire screen
          hDC as ulong,_
          result as ulong ' 1 = success

          select case dpi
          case 72
          GetScreenScale = .75
          case 96
          GetScreenScale = 1
          case 120
          GetScreenScale = 1.25
          case 144
          GetScreenScale = 1.5
          case 192
          GetScreenScale = 2
          end select
          end function
          '---code end

          ---
          Stefan Pendl



          ___________________________________________________________
          Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
        • Bob - K9ZLU
          Thanks to all who commented on my question. All computers I used are set to 1024 by 768. I will dig into the text box and graphics font set up. I built a
          Message 4 of 11 , Nov 1, 2006
          • 0 Attachment
            Thanks to all who commented on my question. All computers I used are
            set to 1024 by 768. I will dig into the text box and graphics font
            set up. I built a "Sales Demo Kit" which will test the automotive
            sensors manufactured by my employer and then generate a transfer
            function or error function plot that can be used for marketing
            functions. Everything in the LB4 program, even the USB DAQ, worked
            just fine until I tried to put the LB4 application .exe program files
            on two Sony laptop computers ( model year 2002). The graphics plotting
            routine works just fine but the text boxes did not display all of the
            text.

            Thanks again,
            Bob
          • Stefan Pendl
            Message 5 of 11 , Nov 1, 2006
            • 0 Attachment
              >
              > Thanks to all who commented on my question. All computers I
              > used are set to 1024 by 768.
              ---snip
              > The graphics plotting
              > routine works just fine but the text boxes did not display
              > all of the text.
              >
              > Thanks again,
              > Bob
              >

              Bob,
              the problem is not the screen resolution, it is the font size
              scalling, that can be applied by the graphic adapter to allow bigger fonts.

              Did you run the demo I posted on each of those machines and compared the
              output ???

              ---
              Stefan Pendl



              ___________________________________________________________
              Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
            • Stefan Pendl
              Message 6 of 11 , Nov 1, 2006
              • 0 Attachment
                >
                > Bob,
                > the problem is not the screen resolution, it is the font size
                > scalling, that can be applied by the graphic adapter to allow
                > bigger fonts.
                >
                > Did you run the demo I posted on each of those machines and
                > compared the
                > output ???
                >
                > ---
                > Stefan Pendl
                >

                Bob,
                there are some diferences between Windows versions too, because each
                Windows version uses a diferent library for controls.
                This is aswell dependent on the version of IE you have installed on each
                machine.

                ---
                Stefan Pendl



                ___________________________________________________________
                Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
              • Robert Luetzow
                Stefan: The computers that work are set to 1 The two Sony s are set to 1.25. How do I set the two Sonys to 1 . Bob ... From: Stefan Pendl
                Message 7 of 11 , Nov 1, 2006
                • 0 Attachment
                  Stefan:

                  The computers that work are set to 1
                  The two Sony's are set to 1.25.
                  How do I set the two Sonys to "1".

                  Bob


                  ----- Original Message ----
                  From: Stefan Pendl <pendl2megabit@...>
                  To: libertybasic@yahoogroups.com
                  Sent: Wednesday, November 1, 2006 5:06:26 AM
                  Subject: AW: [libertybasic] Text box font size problem


                  >
                  > Did you issue a font command to the main window or the
                  > textbox? It may simply be that the default fonts are set
                  > differently on the computers.
                  >
                  > Janet
                  >

                  Use the function below to get the DPI settings of the current display.
                  Use the returned value to scale the window size, control size and text size.

                  '---code start
                  print GetScreenScale()
                  end

                  function GetScreenScale()
                  calldll #user32, "GetDC",_
                  0 as ulong,_ ' entire screen
                  hDC as ulong

                  nIndex = _LOGPIXELSX

                  calldll #gdi32, "GetDeviceCaps",_
                  hDC as ulong,_
                  nIndex as ulong,_
                  dpi as ulong

                  calldll #user32, "ReleaseDC",_
                  0 as ulong,_ ' entire screen
                  hDC as ulong,_
                  result as ulong ' 1 = success

                  select case dpi
                  case 72
                  GetScreenScale = .75
                  case 96
                  GetScreenScale = 1
                  case 120
                  GetScreenScale = 1.25
                  case 144
                  GetScreenScale = 1.5
                  case 192
                  GetScreenScale = 2
                  end select
                  end function
                  '---code end

                  ---
                  Stefan Pendl



                  ___________________________________________________________
                  Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de



                  Yahoo! Groups Links
                • Stefan Pendl
                  Message 8 of 11 , Nov 1, 2006
                  • 0 Attachment
                    >
                    > Stefan:
                    >
                    > The computers that work are set to 1
                    > The two Sony's are set to 1.25.
                    > How do I set the two Sonys to "1".
                    >
                    > Bob
                    >

                    Bob,
                    usualy the DPI setting is done for a special purpose by the user.
                    If you set the current setting of 120 DPI to 96 DPI, then all fonts will
                    display smaller than before.

                    See Richards post at
                    http://groups.yahoo.com/group/libertybasic/message/32260

                    ---
                    Stefan Pendl



                    ___________________________________________________________
                    Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
                  • Richard Russell
                    ... It is not a good idea to do so. If you change the DPI value it will affect all other applications and very likely make text difficult to read. For
                    Message 9 of 11 , Nov 1, 2006
                    • 0 Attachment
                      --- In libertybasic@yahoogroups.com, Robert Luetzow wrote:
                      > The computers that work are set to 1
                      > The two Sony's are set to 1.25.
                      > How do I set the two Sonys to "1".

                      It is not a good idea to do so. If you change the DPI value it will
                      affect all other applications and very likely make text difficult to
                      read. For example every dialog box in every application will shrink
                      to 80% of its previous size.

                      The DPI values (and hence scaling values) are different for a good
                      reason: they compensate for the different sized pixels. It is far
                      better to adapt your program to cope with different DPI values than
                      to change the DPI value to suit your program.

                      Richard.
                    Your message has been successfully submitted and would be delivered to recipients shortly.