Solved

Does MM_LOMETRIC Mapper mode work properly on every printer?

Posted on 2000-04-04
2
589 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 67
Graphics32 under Delphi 10.1 Berlin 2 98
Tidtcpserver listening on multiports? 1 35
FMX TEdit KeyUp handler detecting  "enter" key 4 13
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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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