mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 18:09:23 +02:00
SynEdit: More Ligatures on Windows, {$DEFINE WINDOWS_LIGATURE}
git-svn-id: trunk@63963 -
This commit is contained in:
parent
41552a49c8
commit
410dd26d95
@ -1259,15 +1259,18 @@ begin
|
||||
EtoArray := nil;
|
||||
|
||||
{$IFDEF WINDOWS_LIGATURE}
|
||||
W := UTF8ToUTF16(Text, ALength);
|
||||
ZeroMemory(@CharPlaceInfo, SizeOf(CharPlaceInfo));
|
||||
CharPlaceInfo.lStructSize:= SizeOf(CharPlaceInfo);
|
||||
SetLength(Glyphs, Length(W));
|
||||
CharPlaceInfo.lpGlyphs:= @Glyphs[0];
|
||||
CharPlaceInfo.nGlyphs:= Length(Glyphs);
|
||||
if GetCharacterPlacementW(FDC, PWChar(W), Length(W), 0, CharPlaceInfo, GCP_LIGATE)<> 0 then begin
|
||||
Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, @ARect, Pointer(Glyphs), Length(Glyphs), EtoArray);
|
||||
exit;
|
||||
if ALength > 0 then begin
|
||||
W := UTF8ToUTF16(Text, ALength);
|
||||
ZeroMemory(@CharPlaceInfo, SizeOf(CharPlaceInfo));
|
||||
CharPlaceInfo.lStructSize:= SizeOf(CharPlaceInfo);
|
||||
SetLength(Glyphs, Length(W));
|
||||
CharPlaceInfo.lpGlyphs:= @Glyphs[0];
|
||||
CharPlaceInfo.nGlyphs:= Length(Glyphs);
|
||||
Glyphs[0] := #0;
|
||||
if GetCharacterPlacementW(FDC, PWChar(W), Length(W), 0, CharPlaceInfo, GCP_LIGATE or GCP_REORDER or GCP_GLYPHSHAPE)<> 0 then begin
|
||||
Windows.ExtTextOutW(FDC, X, Y, fuOptions or ETO_GLYPH_INDEX, @ARect, Pointer(Glyphs), CharPlaceInfo.nGlyphs, EtoArray);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user