Post Reply 
Fixed width font for terminal emulator
04-10-2024, 04:31 PM (This post was last modified: 04-12-2024 06:04 PM by komame.)
Post: #15
RE: Fixed width font for terminal emulator
(04-10-2024 05:14 AM)BarryW Wrote:  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?
[...]

The code you referred to was written to demonstrate the use of ICON as a graphic buffer. Here is a basic version of the code displaying text in italics:
Code:
ICON buffer 89504E470D0A1A0A0000000D49484452000001400000001E01000000007518FA34000000027​4524E5300010194FDAE0000001E494441547801EDCA310100000C0220FB97DE2A787AC04DAE248AA​2381D1F3A46AB8D6A43110D0000000049454E44AE426082;
EXPORT DIT_P(text,g,x,y,f,c)
BEGIN
  LOCAL size:=TEXTSIZE(text,f)+{1,3}, i, j=0, p=0;
  BLIT_P("buffer",G0,x,y,x+size[1],y+size[2]);
  TEXTOUT_P(text,"buffer",1,2,f,c);
  FOR i:=size[2]-4 DOWNTO 0 STEP 3 DO
    BLIT_P(g,x+j,y+i,"buffer",1,i,size[1],i+4);
    j:=j+1;
  END;
END;

However, this is a very simple solution that only allows displaying text on a uniform background (if the background behind the text is not uniform, it will be distorted). If you need a more advanced version, you'll have to wait until the completion of that mini-project.

Piotr Kowalewski
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 - komame - 04-10-2024 04:31 PM



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