473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

win32ui.CreateFont() question

I am rewriting an antique BASIC program in Python for a
customer. The main feature of the program is printing a
work order for a particular assembly; the BASIC program
uses IBM OEM line-drawing characters.

The new program must reproduce the work order as closely as
possible but be able to print to brainless inkjet printers.
I found the MS Linedraw font online, and am able to print
the line-drawing characters with it under Windows XP but
the same code fails to work in Windows 98, printing
international characters instead.

I'm not sure what code to post from the application (the
printing code is a bit long to post), but if nobody has
an easy answer I'll see what I can boil down.

I'm calling CreateFont using this function:

LOGPIXELSY = 90

def getfont(dc, name, size):
scaley = dc.GetDeviceCaps(LOGPIXELSY) / 72.0
return win32ui.CreateFont({
"name": name,
"height": int(1.0 * scaley * size),
})

If there is a better/more correct way I'd be happy to
see it.

Also: How do you know what font Windows actually chose?
The PyCFont returned by win32ui.CreateFont() does not have
any properties or methods as far as I can tell, so no way
to access the underlying MFC CFont object.

Chris Gonnerman -- ch*************@newcenturycomputers.net
http://newcenturycomputers.net
Jul 18 '05 #1
0 2221

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen...
0
by: Howard Lightstone | last post by:
I am trying to use the CreatePrintDialog routine to initialize a device context for the (default) printer but ..... I can't figure out the arguments. win32ui.CreatePrintDialog The first...
1
by: EricP | last post by:
I get the following error when I run this script to open a file dialog. I've searched the web and news groups for this issue and have not found any references. I get the same behavior when I run...
2
by: Darcy Kahle | last post by:
I am trying to do some advanced printing in python using the win32ui module, and have run into an issue. I need to print a page landscape. As I could not determine how to specify the orientation...
3
by: MsKitty | last post by:
My client is used to clicking on the script name on her PC and getting a windows command line box which it runs in. Not fancy but did the job until recently... Now it can take up to 4 minutes...
1
by: Chris Lambacher | last post by:
Hi, This question has come up a few times on the list with no one giving a public answer. How do you use CreatePrintDialog from win32ui? About a year ago someone posted that: dlg =...
4
by: Joey C. | last post by:
Hello. I'm writing a program that creates a series of batch operations to convert movies to be used on iPodLinux. The programs that do the encoding and conversions are seperate from mine and all...
3
by: robert | last post by:
As soon as I install wxPython on a Py2.3.5, my win32ui / win32gui apps freak out. buttons in dialogs are magically pressed. backgrounds of dialogs are colored wrong... this is with current...
5
by: nobugus | last post by:
Just posting a solution to the problem of capturing the whole virtual screen area, including all monitors with python and pywin32. Because this doesn't work even with PIL's imagegrab module. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.