Jump to content
MikeMon

Printer.Canvas.TextOut Procedure's X Position is Ignored with Built-In Printer Fonts

Recommended Posts

Hi

 

I use the "Printer.Canvas.TextOut(X, Y: integer; const Text: string)" procedure to print to a thermal pos printer. I have an issue with the X position when I use built-in printer fonts, e.g. "FontA11". When I use windows fonts, e.g. Arial, the X position works fine. Basically, with built-in fonts, the X value is being ignored whatever value it is being passed, i.e. TextOut(0, 0, 'Print Something') and TextOut(100, 0, 'Print Something') are printing at the EXACT same position.

 

The thermal printer driver I am using is "Thermal Printer Drivers 4.57". FYI, "Thermal Printer Drivers 3.0" worked fine but can't be used on Windows 10 computers.

 

Please, advise

Share this post


Link to post

Is there a TrueType version of the built in printer fonts available anywhere?

It could be that the MS canvas handling fails to get font info for the built in fonts, if the fonts don't exist in the Windows font registry.

Installing the TrueType may help?

Share this post


Link to post
8 minutes ago, Lars Fosdal said:

Is there a TrueType version of the built in printer fonts available anywhere?

It could be that the MS canvas handling fails to get font info for the built in fonts, if the fonts don't exist in the Windows font registry.

Installing the TrueType may help?

Hi Lars

 

Thank you for your answer. There are no TT version of the POS printer fonts available.

 

FYI, the Y in the Printer.Canvas.TextOut and all other font functions work fine, e.g. Printer.Canvas.TextHeight and Printer.Canvas.TextWidth.

Share this post


Link to post
2 hours ago, Lars Fosdal said:

In https://support.microsoft.com/en-us/help/201978/how-to-use-printer-device-fonts there are some clues to doing device font substitution, but if that doesn't work out, I am afraid that you have to raise the issue with the maker of the printer.

 

Hi Lars

 

Thank you for the link. I'm familiar with the info, but unfortunately, it doesn't help me.

 

Everything works fine except for the X position. The fonts are used normally and printed on the printer. The Y position works fine. The only problem is the X position. The latest driver X-POS 4.57 has the same problem even on Windows 7. An older driver Vendor Thermal Driver 3.2 works fine on Windows 7. They both use the same font: FontA11 or FontA1x1.

 

I've had other issues with some built-in fonts and thermal printers before, where the PageWidth, TextHeight and TextWidth functions don't return the correct values, but these things can be assigned programmatically. Whereas in the case of the X, there is nothing one can do.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×