Custom Text Formatting (Previously: Getting long results in a program)
|
03-26-2024, 07:03 AM
(This post was last modified: 03-26-2024 07:07 AM by komame.)
Post: #11
|
|||
|
|||
RE: Getting long results in Program
(03-24-2024 04:28 PM)Tyann Wrote: Hello Komame Hi Tyann, To display text written in italics, you first need to buffer the text, for example in G9, and then move it to the target area (G0?) using BLIT_P in groups of a few lines (to avoid too steep an angle), shifting them by one pixel to the right. Let's assume that in variables sx and sy, you have the dimensions of the text (obtained using TEXTSIZE), and in G9 at position (0, 0), you have your text displayed using TEXTOUT_P. You start from the bottom, and you directly move the last 3 lines from G9 to G0 at (x, y+sy), then the next 3 lines to (x+1, y+sy-3), the next 3 to (x+2, y+sy-6), and so on. Because HP Prime applies antialiasing during text rendering, it's important to consider whether the text will also be displayed on other objects. If the background under the text doesn't need to be preserved (e.g., when the background under the text is of a uniform color), the matter is simple. But if you want to preserve it, you must additionally copy a portion of the target area from G0 to G9, on which you will display the text, moving it in groups of lines one pixel in the other direction (i.e., to the left), even before displaying the text on G9 using TEXTOUT_P, because otherwise, color distortions will appear on the edges of the text or distortions of the background. Hah, before I finished writing this description, I realized that in the time I spent on it, I could have already completed the implementation of this solution If you need help, let me know, because it's already working in my head... Piotr Kowalewski |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 62 Guest(s)