[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Direct Rendering with Win32
From: |
David Turner |
Subject: |
Re: [ft-devel] Direct Rendering with Win32 |
Date: |
Wed, 10 May 2006 10:48:27 +0200 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
Hello Alex,
what you want to achieve is not very clear, but if you want to ensure
that vectors are sent to your printers, instead
of bitmaps, through GDI, I can only suggest the following:
A/ load the glyphs as outlines (i.e. using FT_LOAD_NO_BITMAP when
calling FT_Load_Glyph)
B/ if face->glyph->format is FT_GLYPH_FORMAT_OUTLINE, you can then call
FT_Outline_Decompose
to decompose the glyph vector into a series o line and curve segments.
C/ the callbacks provided to FT_Outline_Decompose should call the
corresponding GDI functions, i.e.
MoveToEx, LineTo, PolyBezierTo, CloseFigure. You might need to convert
quadratic beziers to
cubic ones, but this is rather trivial.
D/ don't forget to bracket these calls with BeginPath and EndPath to get
filled glyphs.
Hope this helps,
- David Turner
- The FreeType Project (www.freetype.org)
Murillo, Alex a écrit :
Hello,
I am attempting to render freetype glyphs directly into a windows
device context. In other words, I do not want glyphs rendered as
bitmaps because in print scenarios the print spooler becomes
exponentially larger than the original document size. Specifically, in
our application, text rendering uses the standard freetype mechanism
(under windows), which is to lookup the glyph, render the glyph, then
take the returned bitmap and BitBlt (GDI API) the bitmap into a memory
compatible device context (which is based on an actual device context
e.g. screen or printer…). As you might already recognize, in a print
scenario we simply reuse the display code to render text into the
printer device (instead of the screen).
However, as stated before, this is the source of our problem because
ultimately the operation performed against the printer device is a
raster operation and not a vector operation. In my limited
understanding, the raster operation results in bitmaps actually pushed
into the postscript and not vector commands, which results in large
printer spool files (I have confirmed in testing). Incidentally, I
have scoured the web and this mail group but have not seen anyone who
has experienced this issue on any level. Nor have I have discovered
anyone who has made any attempt to direct render the glyphs into a
windows device context. Ironically, I have seen other font engines
that use freetype as their underlying font library, which seem to
offer this functionality. So, I have to believe this is possible. I’m
still searching but hope someone here has an answer, as I am running
out of options.
Thanks Alex
------------------------------------------------------------------------
_______________________________________________
Freetype-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype-devel
***********************************************************************************
Information contained in this email message is confidential and may be
privileged, and is intended only for use of the individual or entity named
above. If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this communication
in error, please immediately notify the address@hidden and destroy the original
message.
***********************************************************************************