[Lazarus] @Alexey length(Glyph) [[Re: Font ligatures support]]

Martin Frb lazarus at mfriebe.de
Tue Oct 6 12:36:54 CEST 2020


On 03/10/2020 16:34, Alexey Tor. via lazarus wrote:
> It's not very simple. see file
> https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_canvasproc.pas 
>
> and search for "ligatures" in all places. Unit has special code for 
> win32.

Just a note

     if GetCharacterPlacementW(DC, PWChar(Str), Length(Str), 0, 
@CharPlaceInfo, GCP_LIGATE)<> 0 then
       Result:= Windows.ExtTextOutW(DC, X, Y, ETO_CLIPPED or ETO_OPAQUE 
or ETO_GLYPH_INDEX, Rect, Pointer(Glyphs), Length(Glyphs), Dx)

Should that be
   CharPlaceInfo.nGlyphs
instead of
   Length(Glyphs)
?

GetCharacterPlacementW may return up to (but therefore also less than)  
Length(Glyphs) glyphs.
So ExtTextOutW should get the adjusted count?






More information about the lazarus mailing list