Re: Win32 glyphBox implementation

From: <msevior_at_physics.unimelb.edu.au>
Date: Tue Aug 02 2005 - 00:10:13 CEST

>
>
>
> En/na J.M. Maurer ha escrit:
>
>> Hi there win32 devs!
>>
>> I could really use your help here... I need an implementation of
>>
>> bool GR_Win32Font::glyphBox(UT_UCS4Char g, UT_Rect & rec) const
>>
>> if I ever want to make maths work on win32. Maybe tomas or someone else
>> could give it a try? Given my win32 skill, it´ll probably take me a
>> month to come up with a faulty implementation .. :)
>
> Marc, probably what you want can be archive it using the GetGlyphOutline
> API
> function with the GGO_METRICS flag:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_8fp0.asp
>
> Regards,
>

Ah yes! From the web page...

GLYPHMETRICS

The GLYPHMETRICS structure contains information about the placement and
orientation of a glyph in a character cell.

typedef struct _GLYPHMETRICS {
  UINT gmBlackBoxX;
  UINT gmBlackBoxY;
  POINT gmptGlyphOrigin;
  short gmCellIncX;
  short gmCellIncY;
} GLYPHMETRICS, *LPGLYPHMETRICS;
Members

gmBlackBoxX
    Specifies the width of the smallest rectangle that completely encloses
the glyph (its black box).
gmBlackBoxY
    Specifies the height of the smallest rectangle that completely
encloses the glyph (its black box).
gmptGlyphOrigin
    Specifies the x- and y-coordinates of the upper left corner of the
smallest rectangle that completely encloses the glyph.
gmCellIncX
    Specifies the horizontal distance from the origin of the current
character cell to the origin of the next character cell.
gmCellIncY
    Specifies the vertical distance from the origin of the current
character cell to the origin of the next character cell.

Remarks

Values in the GLYPHMETRICS structure are specified in device units.
---------------------------------------------------------------------

Just put gmBlackBoxX as the width, gmBlackBoxY as the height,
and the values of gmptGlyphOrigin as the left and top values of the
rect.

Then you need to know how to covert from the windows "device units" to
AbiWord's logical units.

Good Luck!

Martin

> Jordi,
>
> --
>
> Jordi Mas i HernĂ ndez, HomePage http://www.softcatala.org/~jmas/
> Bloc personal http://www.softcatala.org/~jmas/bloc/
> Planeta SoftcatalĂ : http://www.softcatala.org/planet/
>
>
>
>
Received on Tue Aug 2 00:10:06 2005

This archive was generated by hypermail 2.1.8 : Tue Aug 02 2005 - 00:10:06 CEST