Post Reply 
Fixed width font for terminal emulator
04-10-2024, 05:14 AM
Post: #14
RE: Fixed width font for terminal emulator
(04-09-2024 07:34 PM)komame Wrote:  Of course, it would be ideal if the firmware update enabled native support, but I'm afraid it will take a very long time for that to happen. Furthermore, even if we eventually get it, the formatting capabilities probably won't be as extensive as in this emerging solution.

Hi komame
I took another look and found your 9 line code. I've implemented it with local variables below.
I also added a FREEZE command after the TEXTOUT_P.
I'm not sure I followed the whole thread on the use of your code.
It works except the font is not italics. Did I miss something?
Also the text color is black on white regardless of the color argument in BLIT_P. Did I miss something on that as well?
Thank you for your help.

-Barry

//-----------------------------------------------------------------------------

//EXPORT DRAWTEXT_P(text,x,y,font,alpha)
EXPORT DRAWTEXT_P()
BEGIN
LOCAL text:="hello folks";
LOCAL x := 20;
LOCAL y := 100;
LOCAL font:= 7; // 0-7.
LOCAL alpha:= 2000; // This is transparency.

LOCAL size=TEXTSIZE(text,font);
RECT_P("buffer");
TEXTOUT_P(text,"buffer",1,1,7); FREEZE;
BLIT_P(x,y,"buffer",1,1,size[1],size[2],#FFFFFF,alpha);
END;

ICON buffer 89504E470D0A1A0A0000000D49484452000001400000001A0100000000EE89B822000000027​4524​E5300010194FDAE0000001D494441547801EDCA31010000008230FA97D60AFEB27B6464341A8​F63​015D3D0C2DD86ED4F60000000049454E44AE426082;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fixed width font for terminal emulator - BarryW - 04-10-2024 05:14 AM



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