Post Reply 
RPL That Stack
Yesterday, 10:04 PM
Post: #6
RE: RPL That Stack
(12-19-2024 09:17 PM)raprism Wrote:  After reading about a PAD program in HP50g AUR to produce padded text I wondered how to get some kind of print command PrLn with right-aligned output.

Some bad news, some good news:

The bad news first: the default fonts on DB48x are variable-width, and there is no function to measure the width of a glyph or the width of some text. So making the computation of the width ahead of time is not possible with the current software.

The good news: The DISP / DrawText command has options to control horizontal and vertical alignment for text. There is even an example in the demo file:

Code:

    0 GRAY Foreground 1 GRAY Background
    " Align left "     { 10#000 10#120 2 true true  1  0 } Disp
    " Align Right "     { 10#400 10#120 2 true true -1  0 } Disp
    " Center "     { 10#200 10#120 2 true true  0  0 } Disp
    " Align Top "     { 10#200 10#000 2 true true  0  1 } Disp
    " Align Bottom " { 10#200 10#240 2 true true  0 -1 } Disp

Fractional input is allowed, so you can align "one quarter to the left".

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RPL That Stack - raprism - 11-23-2024, 05:07 PM
RE: RPL That Stack - c3d - 11-29-2024, 07:51 PM
RE: RPL That Stack - raprism - 11-29-2024, 08:39 PM
RE: RPL That Stack - raprism - 12-19-2024, 09:17 PM
RE: RPL That Stack - c3d - Yesterday 10:04 PM



User(s) browsing this thread: twdeckard, 2 Guest(s)