HP Forums

Full Version: How do I Use Monospace Option of STRING?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to print numbers monospaced and it looks like the STRING function can do that but no combination of parameters I've tried has worked and the manual is a mess. Can anyone show me a simple example of STRING that would print the value of PI monospaced?

TIA

Tom L
(03-29-2017 07:50 PM)toml_12953 Wrote: [ -> ]I'm trying to print numbers monospaced and it looks like the STRING function can do that but no combination of parameters I've tried has worked and the manual is a mess. Can anyone show me a simple example of STRING that would print the value of PI monospaced?

TIA

Tom L

I dont think there is a monospaced font. What you can do is to split the string into chars and draw each letter "monospaced"
STRING does not print out characters. Rather, it is meant to be used in conjunction with a TEXTOUT call to write to the screen. If you pass it flags, it will do some automatic sizing of numbers to "make things fit" within your given limits. The returned string should then "fit" within the space you specified to best extent possible.

However, at the moment TEXTOUT does not support passing those flags in. The net result is that at this time you will not be able to print anything in a user program using the italic, bold, or monospaced font.

Improvements to the text printing is definitely on the list of enhancements, but as always I cannot say when or if it will be implemented.
I have an example of a custom font implemented in a game if you are interested in reading some (uncommented) code: http://www.hpmuseum.org/forum/thread-396...ht=columns

I used the ICON command, but it would not be too difficult to switch over to a PNG file.

cMakeWordV() and cMakeWordH() will print a string vertically or horizontally.
(03-29-2017 08:34 PM)Tim Wessman Wrote: [ -> ]STRING does not print out characters. Rather, it is meant to be used in conjunction with a TEXTOUT call to write to the screen. If you pass it flags, it will do some automatic sizing of numbers to "make things fit" within your given limits. The returned string should then "fit" within the space you specified to best extent possible.

However, at the moment TEXTOUT does not support passing those flags in. The net result is that at this time you will not be able to print anything in a user program using the italic, bold, or monospaced font.

Improvements to the text printing is definitely on the list of enhancements, but as always I cannot say when or if it will be implemented.

I was trying to figure out how the formatting options of STRING worked, and found this old post.

Is the TEXTOUT / STRING interaction incorporated yet? I'm getting errors, so I'm guessing the answer is no. I would love more text formatting capability in my program than just the system small and large fonts provided by TEXTOUT.

Geoff
Reference URL's