Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the Screen Font

289 views
Skip to first unread message

Randy H.

unread,
Sep 12, 2009, 2:00:21 PM9/12/09
to
Anybody,

Is there a function for changing the Screen Font and/or Size
on a CRT Mode Screen? I know you use SETMODE
to change the size of the whole screen, but can you change
the Font or FontSize without changing the whole screen?
I'm guessing the answer is NO, but hoping otherwise.

Thank you.

- Randy Howe


N:dlzc D:aol T:com (dlzc)

unread,
Sep 12, 2009, 5:00:25 PM9/12/09
to
Dear Randy H.:

"Randy H." <soft...@charter.net> wrote in message
news:ZkRqm.49173$Y83....@newsfe21.iad...


> Anybody,
>
> Is there a function for changing the Screen Font and/or
> Size on a CRT Mode Screen?

Yes. You may be limited in the choice of font, and choosing a
larger / smaller font on either height or width... will change
the screen size..

> I know you use SETMODE to change the size of the
> whole screen, but can you change the Font or FontSize
> without changing the whole screen?

In general, no.

> I'm guessing the answer is NO, but hoping otherwise.

If you choose a font that is twice as tall, then cut the number
of rows in half, the net screen size height will be about the
same.

I believe one of the GT libraries does this. I think commercial
xHarbour implements most of Clipper Tools, which has several font
functions:
http://www.itlnet.net/programming/program/Reference/tools1-3/ng6e113.html

With What32, one or more of these functions should have been
implemented:
http://msdn.microsoft.com/en-us/library/aa302340.aspx#win32map_fontandtextfunctions

David A. Smith


Mario H. Sabado

unread,
Sep 12, 2009, 8:40:28 PM9/12/09
to
Hi Randy,

If you're using GTWVT, you may use the following:

Hb_GtInfo( HB_GTI_FONTNAME , cFont )
Hb_GtInfo( HB_GTI_FONTWIDTH, nWidth )
Hb_GtInfo( HB_GTI_FONTSIZE , nHeight )


Regards,
Mario

hot.eye

unread,
Nov 8, 2017, 6:24:50 AM11/8/17
to
Hi,

I have created a procedure to set font/size and save it in the registry. My query is that most fonts do not work!

Use cursor keys to adjust the size, - and = to select defined fonts, F to enter a font name, and return to save settings and return to the main program.

I have installed the fonts in the array, however, only Courier, Lucida and Consolas actually display, others just use Courier! Any ideas?

I'm trying to find the extra symbols in the ASCII range 1..31, i.e. arrows!


Store in your ch
// Location Kit stores stuff in the registry
#define MYREGISTRY 'Software\progname'



static procedure SetFont
local nPoint, nFontWidth, nFont
local aFont:={'-default-', 'Courier New', 'Lucida Console', 'Consolas', 'Noto Mono Regular', 'Secret Code', 'Px437 IBM BIOS Regular', 'Px437 VGA SquarePx'}

if Hb_GtVersion()=='WIN'
WarnWindow('Not supported in GTWIN!;Use Properties of the console window to adjust font.')
return
endif

nFont:=ascan(aFont, GetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'Font'))
if nFont==0
nFont:=1
endif

nPoint:=GetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'FontPointSize')
if nPoint==NIL
nPoint:=24
endif

nFontWidth:=GetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'FontWidth')
if nFontWidth==NIL
nFontWidth:=MyFontWidth(nPoint)
endif

while TRUE
@0,10 say str(nPoint,3)+str(nFontWidth,3)
@0,18 say pad(aFont[nFont],30)
k:=MyInkey(20)
if k==0 .or. k==K_ESC
exit

elseif k==K_UP
if nPoint<50
nPoint++
endif

elseif k==K_DOWN
if nPoint>10
nPoint--
endif

elseif k==K_LEFT
nFontWidth--
if nFontWidth<2
nFontWidth:=2
endif

elseif k==K_RIGHT
nFontWidth++
if nFontWidth>nPoint
nFontWidth:=nPoint
endif

elseif chr(k)$'Ff'

aFont[len(aFont)]:=trim(GetString('Font',60,pad(aFont[len(aFont)],60)))
nFont:=len(aFont)
elseif chr(k)$'-'
nFont--
if nFont<2
nFont:=2
endif

elseif chr(k)$'='
nFont++
if nFont>len(aFont)
nFont:=len(aFont)
endif

elseif k==K_RETURN

SetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'Font', aFont[nFont])
SetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'FontPointSize', nPoint)
SetRegistry(HKEY_CURRENT_USER, MYREGISTRY, 'FontWidth', nFontWidth)
exit
endif

if nFont>1
Hb_gtInfo(HB_GTI_FONTNAME, aFont[nFont])
endif
Hb_gtInfo(GTI_FONTWIDTH, nFontWidth)
Hb_gtInfo(GTI_FONTSIZE , nPoint )

end


Kind regards
Philip

hot.eye

unread,
Nov 8, 2017, 6:33:13 AM11/8/17
to
Forgot to add that I am using WVT driver.

Philip

Sudip

unread,
Nov 9, 2017, 2:35:04 AM11/9/17
to
Hello Philip,

Long time ago I used GTWVW library. Found this code in an old prg file:

Wvw_SetFont(, 'Courier New', 16, - 8 )

I shall be happy if it will be helpful to you.

Kind regards,

Sudip
xHarbour.com

Ariel Paredes

unread,
Nov 9, 2017, 2:18:14 PM11/9/17
to
Hello


I use this
// Wvt
HB_GTInfo( HB_GTI_WINTITLE , cNOM_EMP )
HB_GtInfo( HB_GTI_RESIZABLE, .T. )
HB_GTInfo( HB_GTI_CLOSABLE , .F. )
HB_gtInfo(HB_GTI_CLIPBOARDDATA )
HB_gtInfo(HB_GTI_SELECTCOPY, .T. )

how do I do the same with
//Wvw
Wvw_SetFont(, 'Courier New', 16, - 8 )

compiling together break

use Xharbour comercial

regards

otto

unread,
Nov 10, 2017, 7:37:46 AM11/10/17
to
On Wed, 8 Nov 2017 03:24:47 -0800 (PST), "hot.eye" <phi...@espritelectronics.com> wrote:

For me wvw_SetFont() work well

Small example:
SetMode(25,80)
nNewHeight=int(ScreenHeight/maxrow() * 0.85)
nNewWidth=Int( ScreenWidth/maxcol()-.5)
wvw_SetFont(, 'Courier New', nNewHeight, nNewWidth, 400) // 400 Normal / 900 Bold

Regards
Otto

hot.eye

unread,
Nov 15, 2017, 10:27:40 AM11/15/17
to
Hi All,
Thanks for your replies, however, WVW is very different from WVT.

My code works for some fonts, it still puzzles me why some fonts work and some do not!

Does anyone in xHarbour know why?

Kind regards
Philip
0 new messages