Post Reply 
Custom Text Formatting (Previously: Getting long results in a program)
04-04-2024, 02:50 AM (This post was last modified: 04-04-2024 04:00 AM by komame.)
Post: #38
RE: Getting long results in Program
(04-03-2024 08:53 PM)Tyann Wrote:  Using a single function with a variable list would be very similar to what I was doing with DEFTETXT, which used a list for the parameters.
But this involves a lot of testing and I wanted to try another approach with separate functions and I have the impression that this simplifies the code a lot.

Why do you think so? Are you sure you understood my suggestion regarding the use of EXECON and the ellipsis parameter? (by the way, I've never seen anyone use an ellipsis in a PPL program before). In this approach, each function's place is replaced by just one IF statement (which is the same as writing a function header) and no additional tests are needed.
Could you show the code of your DEFTEXT function? Maybe I'm misunderstanding something.

(04-03-2024 08:53 PM)Tyann Wrote:  Another problem that I don't know how to deal with at the moment is the limited width with italic text?
If I display "TYANN" with, say, a width of 50 in normal and then in italics: because of the offset I'll be missing part of the last character displayed.
Should I keep the characters or the width in pixels?
What do you think?

The same issue applies to the bolding you apply because it widens the text by 1 pixel, so there's also a possibility that the last pixel will be "cut off", right? In my opinion, "width" is crucial because if I have 50 pixels allocated for text in my program (among other graphical elements), and the text turns out to be longer, it should truncate it to 50 pixels to prevent it from overlapping other graphical elements (at least that's how I understand this limitation).

In the future, it's probably worth considering also writing an additional function that will return the dimensionss of the text after formatting, something like an extended version of TEXTSIZE.

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Getting long results in Program - komame - 04-04-2024 02:50 AM
RE: Custom Text Formatting - Tyann - 04-15-2024, 06:55 PM
RE: Custom Text Formatting - komame - 04-15-2024, 07:42 PM
RE: Custom Text Formatting - Tyann - 04-16-2024, 04:38 AM
RE: Custom Text Formatting - komame - 04-16-2024, 06:02 AM



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