Re: does anybody know how to decode TrueType glyph information?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: lucy (losemind_at_yahoo.com)
Date: 02/23/05


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... ?



Relevant Pages

  • Re: Testing fonts for embeddability: finding fsType
    ... The presence of ‘/sfnts’ keys suggests you have fonts with TrueType ... According to the PostScript language reference, ... fonts have no way to specify embeding restrictions. ... Distiller can check and respect embedding options. ...
    (comp.lang.postscript)
  • Re: Font toolbar quickchooser oddity
    ... Century 702 Schoolbook SWA Italic (TrueType) ... something 'special' about these fonts, ... I've seen taht one, and seen several ... other printer manul references, though all seem to be only a font ...
    (microsoft.public.word.printingfonts)
  • Font encodings
    ... I have started to revamp my bookhands fonts (cover the period between ... extending them to include all the glyphs in the TeX T1 layout. ... programs except for email so can't test any TrueType. ... including remapping from the Type 1 and TrueType encodings to LaTeX ones. ...
    (comp.text.tex)
  • Re: Switching from Mac to PC questions
    ... On the PC side should we stick to Postscript fonts or does it ... TrueType fonts are arguably a little easier to ... Our server is currently running OS X server 10.2.8, ...
    (comp.publish.prepress)
  • Re: Printing Spanish diacritical marks.
    ... TrueType and PostScript Type 1 ... are among the types of fonts Word can use (it can also use printer-resident ... > uppercase characters, and pasted them onto the document I was working on. ... >> accents would have room to print on uppercase letters. ...
    (microsoft.public.word.newusers)