Post Reply 
How do I Use Monospace Option of STRING?
03-29-2017, 07:50 PM
Post: #1
How do I Use Monospace Option of STRING?
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

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
03-29-2017, 08:01 PM
Post: #2
RE: How do I Use Monospace Option of STRING?
(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"

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
03-29-2017, 08:34 PM
Post: #3
RE: How do I Use Monospace Option of STRING?
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.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-29-2017, 08:49 PM (This post was last modified: 03-29-2017 08:50 PM by Han.)
Post: #4
RE: How do I Use Monospace Option of STRING?
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.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
09-27-2018, 01:01 AM
Post: #5
RE: How do I Use Monospace Option of STRING?
(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
Find all posts by this user
Quote this message in a reply
Post Reply 




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