How do I Use Monospace Option of STRING? - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: How do I Use Monospace Option of STRING? (/thread-8058.html) |
How do I Use Monospace Option of STRING? - toml_12953 - 03-29-2017 07:50 PM 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 RE: How do I Use Monospace Option of STRING? - eried - 03-29-2017 08:01 PM (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? I dont think there is a monospaced font. What you can do is to split the string into chars and draw each letter "monospaced" RE: How do I Use Monospace Option of STRING? - Tim Wessman - 03-29-2017 08:34 PM 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. RE: How do I Use Monospace Option of STRING? - Han - 03-29-2017 08:49 PM 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.html?highlight=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. RE: How do I Use Monospace Option of STRING? - Geoff - 09-27-2018 01:01 AM (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. 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 |