Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Does MM_LOMETRIC Mapper mode work properly on every printer?

Posted on 2000-04-04
2
Medium Priority
?
619 Views
Last Modified: 2012-05-04
I've created font (CreateFontIndirect)
with font mapper mode set to MM_LOMETRIC
(lf.Height member of LOGFONT structure set to 50), then printed some text.
But it's not the same on every printer,
on Cannon BJC-250(under Windows 95) it's 5 milimeters and that's OK, but on HP 690(under Windows 98) it's only 3 mm high and on some laser printers(under Windows NT) it's even smaller.
Whos fault is it?:
- printer(does DPI matter?)
- system(does font mapper work diferent under diferent systems)
- compiler(I'm using Delphi 2)
Thanks, Ziolko  
 
0
Comment
Question by:ziolko
  • 2
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 330 total points
ID: 2685342
Hi
it is the printer drivers fault,
if you tried it on the same 2-3 printers on different systems it will be one size but try it on different printers on same system and will be differnt size..this can also be common with even printing a simple richedit etc.apart from upgrading latest printer drivers etc ther isnt much you can do.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2685404
ps you can try calling this before printing to set the pixelsper inch.:

procedure SetPixelsPer;
  var
      finch,f : longint;
      mmv: integer;
      pixv : integer;
  begin
      case GetMapMode(printer.canvas.handle) of
        MM_HIMETRIC, MM_ISOTROPIC, MM_ANISOTROPIC: FInch := 2540;         MM_HIENGLISH: FInch := 1000;
        MM_LOMETRIC: FInch := 254;
        MM_LOENGLISH: FInch := 100;
        MM_TEXT:
          begin
          mmv := GetDeviceCaps(printer.canvas.handle,VERTSIZE);           pixv := GetDeviceCaps(printer.canvas.handle,VERTRES);           FInch := round(pixv / (mmv/25.4));
          end;
        MM_TWIPS: FInch := 1440;
      else ShowMessageBox('Unknown printer resolution.  Unable to
verify font size.');
        end;
Printer.Canvas.Font.PixelsPerInch := Finch;
  end;


or:

SetMapMode( printer.canvas.handle, MM_ANISOTROPIC );
SetWindowExtEx(printer.canvas.handle,GetDeviceCaps(canvas.handle, LOGPIXELSX),GetDeviceCaps(canvas.handle, LOGPIXELSY),Nil);
SetViewportExtEx(printer.canvas.handle,GetDeviceCaps(printer.canvas.handle, LOGPIXELSX),GetDeviceCaps(printer.canvas.handle, LOGPIXELSY),Nil);
 
This artificially reduces the printer resolution to the screen resolution
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question