*** is happening here? comparing with screen size the height is bigger but lenght is smaller. I don't understand.
I can understand that different printers process the fonts in different way and then to have different lenghts. That's not the problem. The problem is I need to simulate in screen the same behaviour i will have on printer because these texts are being aligned in the document, and I don't want to see that the text si aligned different in text than in paper.
What can I do to render the text on screen with the same size I will have on the printer? Print preview is doing it. Should I change the font parameters? is something related with pixels per inch? I don't see it.
Screen and printer are different DC's that behave differently because they have different DPI settings
so your 10 'units' font in the screen DPI setting (which gets approximated to be 100 units in lometric) gets rounded up or down to a pixel size and the same happens on your printer which uses a slightly different setting.
Additionally antialiassing or cleartype may result in a slightly wider font on screen than it will be when printed.
If you really need WYSIWYG type approach, then you need to draw onto a bitmap uwing the printer DC, then convert/scale this bitmap to the screen. This will get you the WYSIWYG as far as scaling and relative sizes is concerned, but it will have an impact on the clarity and readability on screen. This can't really be helped, even the best screens have a much much coarser resolution than "cheap" printers.
This is what I did. If I am printing I do nothing. If I am not printing I retrieve a (default) printer DC and then I attach its attrib DC to the attrib DC of the screen DC. This way I am obtaining the same metrics. Hope I am doing correctly and safe, I don't want to cause a breach in continuum space time or so.
Anyway I'll investigate the TWIPS metrics. I also need to create a zoomig system since the two step MFC preview zoom is not enough, so I must see how good this behaves with scaling parameters, or doing something with bitmaps instead, as sugested by OReubens.
FYI, MM_TWIPS (as well as any other hi metric modes) is intended to be used with physical devices (printers first of all), and device vendors take special care about being compliant with the mode(s). Which point I doubt of when it is about freeware virtual printers like PDFCreator.
Last edited by Igor Vartanov; February 4th, 2013 at 07:48 AM.
Bookmarks