Re: CreateFont - create font of exact size / font mapper

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: James Brown (remove_james_dot_brown7_at_virgin_dot_net)
Date: 01/06/05


Date: Thu, 6 Jan 2005 09:17:22 -0000


<mandards@gmail.com> wrote in message
news:1104837319.527466.252180@f14g2000cwb.googlegroups.com...
> Hi,
>
> I have to implement a functionality in which user mentions the point
> size for the font to be applied on a text box. I am developing this in
> pure Win32 GDI, without any MFC help.
>
> I have used MulDiv operation to convert the point size to obtain height
> of the required font and then subsequently used this height in the
> CreateFont API.
>
> The font mapper in CreateFont "looks for the largest font that does not
> exceed the requested size" ... as mentioned in the help for the
> CreateFont API in MSDN.
>
> Consequently, a range of requested font heights (calculated above) are
> mapped to single font size. This results into sudden increments in the
> rendered font.
>
> I wish to know how I can create a font of the exact height as
> calculated using MulDiv or in other words overcome the font height
> related behaviour of the font mapper.
> All suggestions are welcome!
>
> Thanks and regards,
> Mandar
>

There is an interesting chapter on these issues in the book
"Windows Graphics Programming" by Feng Yuang, the entire
book is from the win32 perspective - I can only suggest you buy a copy..

James

---
www.catch22.net
Free win32 software, sourcecode and tutorials


Relevant Pages

  • Re: Building a windows app with Tcl/Tk includes X.h
    ... different basic types ... Tk uses the header files for X11 in Win32 for its X emulation layer. ... I'm not aware of a solution to your Font type problem. ...
    (comp.lang.tcl)
  • Re: Building a windows app with Tcl/Tk includes X.h
    ... different basic types ... Tk uses the header files for X11 in Win32 for its X emulation layer. ... I'm not aware of a solution to your Font type problem. ...
    (comp.lang.tcl)
  • Re: Progress while using MoveFile()
    ... it works 99% of the time on all all Win32 O/Ses. ... Delete the font file ... This folder must be on the same physical drive as the ... Windows\Fonts folder, or MoveFile will fail. ...
    (microsoft.public.win32.programmer.ui)
  • Re: CreateFont - create font of exact size / font mapper
    ... >size for the font to be applied on a text box. ... >CreateFont API in MSDN. ... a range of requested font heights are ... conversion formula, the integers were truncated. ...
    (microsoft.public.win32.programmer.gdi)
  • CreateFont - create font of exact size / font mapper
    ... size for the font to be applied on a text box. ... The font mapper in CreateFont "looks for the largest font that does not ... CreateFont API in MSDN. ... a range of requested font heights are ...
    (microsoft.public.win32.programmer.gdi)