Re: does anybody know how to decode TrueType glyph information?
From: lucy (losemind_at_yahoo.com)
Date: 02/23/05
- Next message: Murat Aykut: "Are SetDIBits and BitBlt support yuv format?"
- Previous message: Alexander Prado: "GDI in Kernel Mode"
- In reply to: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Next in thread: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Reply: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Feb 2005 12:47:24 -0800
"John Carson" <jcarson_n_o_sp_am_@netspace.net.au> wrote in message
news:%23Bd2XadGFHA.2736@TK2MSFTNGP12.phx.gbl...
> "networm" <networm8848@yahoo.com> wrote in message
> news:ulBwYDdGFHA.3648@TK2MSFTNGP09.phx.gbl
>> HI all,
>>
>> I have to render my own fonts in my application at an arbitrarily high
>> resolution. I suppose the B-splines in TrueType will help me. So I
>> guess I need to decode the TrueType file, and rasterize it by myself.
>>
>> Can anybody help? What is the most fast and efficient way of doing
>> this?
>> I can definitely copy the rasterized font bitmap into memory and/or
>> save to a file(that's to say, let OS to the rasterization, and I just
>> take its bitmap result),... the problem is that the OS assume certain
>> DPI reolution, normally 96DPI. But I want to be able to render the
>> font at any arbitrary resolution...
>>
>> How can I solve this problem?
>>
>> Thanks a lot
>
> I can't give you a complete answer. It is not clear to me that you need to
> do anything beyond using fonts in the standard manner since TrueType fonts
> can be used at a resolution that is high enough for most people's
> purposes.
>
> 1. The OS does NOT assume a certain DPI resolution, normally 96DPI. When
> using TrueType fonts in the usual way, you call CreateFont or
> CreateFontIndirect and request a font of a certain height in terms of
> logical units. By default these logical units are pixels. You can use the
> following formula:
>
> height = -MulDiv(PointSize, DPI, 72);
>
> (note the minus sign) to determine the pixel height you need to set for
> any desired PointSize and DPI.
>
> 2. If you do need to get into bitmaps and Bezier curves associated with a
> TrueType font, then the function you need is probably GetGlyphOutline. The
> best source of information that I know of on such matters is Feng Yuan's
> Windows Graphics Programming.
>
>
> --
> John Carson
Hi John,
When you set the 72 in -MulDiv(PointSize, DPI, 72);
do you still assume the current screen resolution setting is 72 DPI? where
does this number come from?
I guess the OP wants to obtain a font at any arbitrarily high resolution,
say 1200DPI, although his/her current monitor might be only 100 DPI... ?
- Next message: Murat Aykut: "Are SetDIBits and BitBlt support yuv format?"
- Previous message: Alexander Prado: "GDI in Kernel Mode"
- In reply to: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Next in thread: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Reply: John Carson: "Re: does anybody know how to decode TrueType glyph information?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|