Post Reply 
Custom Text Formatting (Previously: Getting long results in a program)
04-07-2024, 11:32 AM
Post: #49
RE: Getting long results in Program
(04-07-2024 09:31 AM)Tyann Wrote:  I'd prefer to have 2 atextout_p functions, one with 8 parameters and the other with 9, because we'll have the s,g,x,y....etc variables directly.
Whereas with a single atextout_p function and a list, all the programming is going to be done using 'l(x)', which is less readable and more cumbersome, isn't it?
For ATEXTSIZE, I've noted the height of each font because it's not linear, sometimes it increases by 2 and other times by 4 pixels.
Then I think that CEILLING(height,3)+width provided by TEXTSIZE should do the trick for italic mode?

I understand your argument regarding the issue with the list as a parameter. However, for me, the best solution would be to create only one function "atextout_p", which always takes 9 parameters and contains all the drawing logic once, without breaking it down into different cases. Since it's an internal function anyway, the last parameter can be handled in many ways internally. However, if you prefer two functions, I won't insist on anything.
Regarding ATEXTSIZE, after all, the height of the selected font can be measured using TEXTSIZE, so it doesn't matter that it doesn't change linearly. By applying formatting, we only change the width, which can be calculated for italics considering the previously measured height. And for bold, we add an additional 1 pixel. This way, it can be done very precisely.

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-07-2024 11:32 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: 2 Guest(s)