HP Forums
Scalable font for large text display in programs? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Scalable font for large text display in programs? (/thread-20976.html)



Scalable font for large text display in programs? - deSitter - 12-12-2023 08:13 PM

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


RE: Scalable font for large text display in programs? - Raymond Del Tondo - 12-13-2023 09:07 PM

(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".


RE: Scalable font for large text display in programs? - komame - 12-14-2023 07:17 AM

(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


RE: Scalable font for large text display in programs? - Guenter Schink - 12-14-2023 08:20 PM

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


RE: Scalable font for large text display in programs? - deSitter - 12-17-2023 07:29 AM

(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