Post Reply 
Custom Text Formatting (Previously: Getting long results in a program)
04-18-2024, 05:36 AM
Post: #92
RE: Custom Text Formatting (Previously: Getting long results in a program)
Tyann,

(04-17-2024 08:42 PM)Tyann Wrote:  The buffer is not at the right size in the listing, I think 29 pixels should fit (my calculations are based on this value: font height n°7 + 3).

Today I have to leave and I will only be back late in the evening. However, after quick tests, I can say that the buffer must have 31 pixels because the largest text placed at position 0,0 of the buffer is 27 pixels high (the first row of pixels is then empty), additionally, we need to consider the relief (1 pixel) and 3 pixels of descent to accommodate accents for small fonts. At the moment, the solution clips the bottom part of letters such as "g" or "y" and the underline (if defined) regardless of the font size.

For example:
ATEXTOUT_P("ABÓgy123",40,40,7,0,2);

(04-17-2024 08:42 PM)Tyann Wrote:  For BLIT_P in transparency mode, I had initially set the front colour to alpha 0 (black) but this gives a strange result. Setting the colour to the same value as the alpha works correctly, I'm not sure why.

In the case of BLIT_P, you made a mistake regarding the value of the [c] parameter, which we discussed earlier. The issue is that the [c] parameter is required when specifying the [alpha] parameter. To avoid hiding pixels, the [c] parameter was supposed to have transparency defined statically, for example {0,255}, but you substituted it with "t", so from the BLIT_P perspective, it's a normal color for which pixels are not supposed to be copied, so it couldn't work correctly. You should invoke it like this:
BLIT_P(g,x,y-d,"buffer",j,h-d,j+l,h,{0,255},t)
without using EXPR and then your variable "ft" is unnecessary.

(04-17-2024 08:42 PM)Tyann Wrote:  Maybe it's finally time to publish?

Not yet Wink

(04-17-2024 08:42 PM)Tyann Wrote:  Congratulations on your new status on this forum.

Thanks!

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


Messages In This Thread
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
RE: Custom Text Formatting (Previously: Getting long results in a program) - komame - 04-18-2024 05:36 AM



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