Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::Gui how to change font in DC?

Status
Not open for further replies.

mikeprestim

Programmer
Joined
Mar 1, 2001
Messages
21
Location
GB
Hi

I have been away from perl programming for a long while now and have started to look at win32::gui.

I am creating a drawing application using DC. I can draw, add text etc, etc with no worries.

My question is how do you set or change the text font before calling:
$Screen->TextOut($txt_st, $t_pos, 1);

I have tried $Screen->Change(-font => $Font);

$Screen is the DC window and $Dw is the top level window for the project.

Any help would be great.

Thanks

Mike
 
Try it, I haven't tested

# "font, size, codepage" - the third argument is Windows #font codepage
# 0-westerneuropean

$Screen->SetFont("Times New Roman Bold, 12, 0");

Cheers,


dmazzini
GSM System and Telecomm Consultant

 
Thanks for the reply dmazzini. I've been off sick for a few days so only just got back to it. SetFont is a no go it reports object not found.

but I have had another go today and cracked it and below works
$Screen->SelectObject($Font_6);

SelectObject was one of those TBD in the win32 documentation.

Thanks for your help

Regards
Mike
 
Good! Cheers!


dmazzini
GSM System and Telecomm Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top