Post Reply 
Fixed width font for terminal emulator
05-06-2021, 05:35 AM
Post: #2
RE: Fixed width font for terminal emulator
Hello,

Correct the font are variable width.
There is, I think, a way to print monospace using the extended form of TEXTOUT.
Unfortunately, looking at the online help, I notice that I have NOT updated said help... so you could not know about it...

Here is the updated help: Notice flag bit 10 which should allow to print monospaced...
Honestly, I have not tested it, so I am not sure it works!
But basically with this version of TEXTOUT, you, as a user, now has full access to the underlying C textout function with all the options, bells and whistles...

Cyrille

Syntax:
TEXTOUT_P(text, [G], x, y, [font], [textColor], [width], [backgroundColor])
TEXTOUT_P(text, [G], x, y, {["2D"], [{print flags as in the STRING command}], [font], [textColor], [width], [backgroundColor],flags})

Draws text on graphic G at position (x, y) using font and textColor. Paints the background before drawing the text using color backgroundColor. If width is specified, does not draw text more than width pixels wide. If backgroundColor is not specified, the background is not erased.

The sizes for font are:

0=current font (default)
1=font 10
2=font 12 (Small)
3=font 14 (Medium)
4=font 16 (Large)
5=font 18
6=font 20
7=font 22

The 2nd form allows you to print in 2D if you add the "2D" string. It also allows you to control how numbers are transformed into a string (see the STRING command for more info on this. The format is the same as the arguements after the "expression").
Finally, it allows you to select a number of "display" options with flags:
flags is a 1 bit, one function set of 12 options with the following bits controling the following options
bit 0(1): elipsis
bit 1(2): NoPadding
bit 2(4): ClipLastChar
bit 3(8): centered
bit 4(16): rightaligned
bit 5(32): PointIsNotTopLeft
bit 6(64): Underline
bit 7(128): StrikeThrough
bit 8(256): Bold
bit 9(512): italic
bit 10(1024): mono
bit 11(2048): EraseFullWidth

Returns the X coordinate at which the next character of the string should be drawn if the string had more characters

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fixed width font for terminal emulator - cyrille de brébisson - 05-06-2021 05:35 AM



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