Text output on metafile / vector fonts library
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
Date: Sun, 25 Jul 2004 23:42:33 -0400
I need to print some text on metafile's DC.
If I do it using TextOut then I am getting artifacts especially when the
metafile is drawn with zoom. The output of TextOut looks weird - I guess
TextOut just stores character's bitmaps to metafile. The weirdness is as
follows: when I draw zoomed metafile - the size of characters is fixed but
the distance between them changes - the result is almost unreadbale.
So I started to think if I can find a nice vector fonts package - which can
draw basic text (digits, Latin chars, and punctuation marks) using usual GDI
LineTo() & Co. primitives.
The speed is not an issue because I need to draw just a legend (the size of
text output is insignificant).
Relevant Pages
- Re: Metafile, Should I?
... PC and it took about 1/2 second to draw it all ... If you're drawing all of a metafile that contains such a large number of records it will take some time to draw, regardless of the scale at which you draw it. ... But the draw metafile function needs to examine and possibly even attempt to print every single individual metafile records whatever it does, which is why it is very slow when there are tens of thousands of individual metafile records. ... (microsoft.public.vb.general.discussion) - Re: Data Report: Do it the hard way :-)
... Actually using a metafile is exactly what I was going to suggest myself, except that I would have coded it in such a way as to avoid creating the temporary disk file because of Ivar's stated requirement that he does not want to write files to the hard drive. ... By the way, the other two methods I was going to suggest of ensuring that things like lines of text and particularly wrapped blocks of text looked the same on all devices at all output scales were as follows: ... Use a RTB to draw a wrapped block of text into a specified rectangle and send it a EM_SETTARGETDEVICE message to cause it to use the printer to calculate the wrapping points even though it was drawing to perhaps a Form or a Picture Box. ... I was then going to go on to point out the benefits of getting all that stuff done "more or less automatically" for you by drawing all your stuff into a metafile, which would solve just about everything because you could draw all your other output into it as well and once you had created the metafile you could draw your print previews and / or zoom in on specific areas of them with great ease using almost a "one liner". ... (microsoft.public.vb.general.discussion) - Re: PDF output
... vbNullString, Rct, vbNullString) ... The API function uses that reference DC to determine things like basic pixel resolution of the metafile. ... since all API drawing and printing functions by default expect you to use pixels for all size and position parameters it means that you will not be able to position or size anything you draw into your metafile to an accuracy better than 1/72 inches. ... (microsoft.public.vb.general.discussion) - Re: Rotating an enhanced metafile
... The easiest solution is to use a world transformation on your target DC with a rotation matrix set, ... The polygon is pretty simple to modify since you're given all the points in the EMR_POLYGON16 record, so just rotate those into a ... actually rotating the metafile records themselves. ... or draw the ellipse into a DC with an open path bracket then rotate those points ... (microsoft.public.win32.programmer.gdi) - Re: DrawImageUnscaled() or FillRectagle() + DrawRectangle() - Which is faster?
... Cache the instructions needed to draw the background using a metafile. ... > bitmap, and only recreate the bitmap when the control is resized. ... (microsoft.public.dotnet.framework.drawing) |
|