Solved

Does MM_LOMETRIC Mapper mode work properly on every printer?

Posted on 2000-04-04
2
580 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 110 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now