Post Reply 
Scalable font for large text display in programs?
12-12-2023, 08:13 PM
Post: #1
Scalable font for large text display in programs?
Sorry my earlier post seems to have gone into the ether.

I need to display large numeric data with normal sized text. This has to be visible in the dark (telescope work) and red on black color. The built-in font for the input screen is way too small even at the "large" setting. In general, what are the font options? Is there a TTF display library around? Any of the programming environments will do. I have a rev. D Prime.

Thanks in advance.

-drl
Find all posts by this user
Quote this message in a reply
12-13-2023, 09:07 PM
Post: #2
RE: Scalable font for large text display in programs?
(12-12-2023 08:13 PM)deSitter Wrote:  I need to display large numeric data with normal sized text. This has to be visible in the dark (telescope work) and red on black color. The built-in font for the input screen is way too small even at the "large" setting. In general, what are the font options?
The Prime offers 7 different sizes for the built-in font, actually.
However even the largest font is way too small and not really worth to be called "large".

-- Ray
Find all posts by this user
Quote this message in a reply
12-14-2023, 07:17 AM (This post was last modified: 12-14-2023 07:25 AM by komame.)
Post: #3
RE: Scalable font for large text display in programs?
(12-12-2023 08:13 PM)deSitter Wrote:  I need to display large numeric data with normal sized text. This has to be visible in the dark (telescope work) and red on black color. The built-in font for the input screen is way too small even at the "large" setting.

You can use enlarged text drawing with TEXTOUT_P and BLIT_P. I've written a simple function PRINTLARGE that accomplishes this.

This is an example of usage:
Code:
PRINTLARGE(text,g,x,y,f_col,b_col)
BEGIN
  local width;
  DIMGROB_P(G9,320,30,b_col);
  width:=TEXTOUT_P(text,G9,0,0,7,f_col,320,b_col);
  BLIT_P(G0,x,y,x+width*2,y+58,G9,0,0,width,29);
END;

EXPORT LT_TEST()
BEGIN
  RECT();
  PRINTLARGE("LARGE TEXT 123",G0,0,0,RGB(0,0,255),RGB(255,255,255));
  PRINTLARGE("example",G0,70,70,RGB(255,0,0),RGB(0,0,0));
  WAIT(0);
END;

Best wishes,
Piotr
Find all posts by this user
Quote this message in a reply
12-14-2023, 08:20 PM
Post: #4
RE: Scalable font for large text display in programs?
You could at least check if PRINT2D meets your needs. But this doesn't resolve any input size problems.
Example: PRINT2D("This is a Text",7,RGB(255,0,0)) prints the string with largest available size to the terminal. Adding the flag "#1b" prints bold,e.g.:
PRINT2D("This is a Text",7,RGB(255,0,0),#1b)
You achieve a black background by switching to "dark" mode - Setup Screen 2, or at the command line enter "Theme(1):=2"

Günter
Find all posts by this user
Quote this message in a reply
12-17-2023, 07:29 AM
Post: #5
RE: Scalable font for large text display in programs?
(12-14-2023 07:17 AM)komame Wrote:  
(12-12-2023 08:13 PM)deSitter Wrote:  I need to display large numeric data with normal sized text. This has to be visible in the dark (telescope work) and red on black color. The built-in font for the input screen is way too small even at the "large" setting.

You can use enlarged text drawing with TEXTOUT_P and BLIT_P. I've written a simple function PRINTLARGE that accomplishes this.

This is an example of usage:
Code:
PRINTLARGE(text,g,x,y,f_col,b_col)
BEGIN
  local width;
  DIMGROB_P(G9,320,30,b_col);
  width:=TEXTOUT_P(text,G9,0,0,7,f_col,320,b_col);
  BLIT_P(G0,x,y,x+width*2,y+58,G9,0,0,width,29);
END;

EXPORT LT_TEST()
BEGIN
  RECT();
  PRINTLARGE("LARGE TEXT 123",G0,0,0,RGB(0,0,255),RGB(255,255,255));
  PRINTLARGE("example",G0,70,70,RGB(255,0,0),RGB(0,0,0));
  WAIT(0);
END;

Best wishes,
Piotr

Excellent thanks!

-drl
Find all posts by this user
Quote this message in a reply
Post Reply 




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