From: Maël Hörz <ma...@us...> - 2008-02-02 19:13:56
|
Update of /cvsroot/synedit/SynEdit/Source In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17853/Source Modified Files: Tag: Unicode_2004_08_31 SynTextDrawer.pas SynUnicode.pas Log Message: Fixed an issue with UniScribe, it expects strings of length >= 1, therefore background filling didn't work. Index: SynUnicode.pas =================================================================== RCS file: /cvsroot/synedit/SynEdit/Source/Attic/SynUnicode.pas,v retrieving revision 1.1.2.35 retrieving revision 1.1.2.36 diff -u -d -r1.1.2.35 -r1.1.2.36 --- SynUnicode.pas 2 Feb 2008 15:13:33 -0000 1.1.2.35 +++ SynUnicode.pas 2 Feb 2008 19:13:53 -0000 1.1.2.36 @@ -2284,6 +2284,8 @@ if Usp10IsInstalled then begin + if Count <= 0 then Exit; + // According to the MS Windows SDK (1.5 * Count + 16) is the recommended // value for GlyphBufferSize (see documentation of cGlyphs parameter of // ScriptStringAnalyse function) Index: SynTextDrawer.pas =================================================================== RCS file: /cvsroot/synedit/SynEdit/Source/SynTextDrawer.pas,v retrieving revision 1.6.2.13 retrieving revision 1.6.2.14 diff -u -d -r1.6.2.13 -r1.6.2.14 --- SynTextDrawer.pas 2 Feb 2008 15:13:33 -0000 1.6.2.13 +++ SynTextDrawer.pas 2 Feb 2008 19:13:53 -0000 1.6.2.14 @@ -279,6 +279,7 @@ Rect: TRect; Str: PWideChar; Count: Integer; ETODist: PIntegerArray): Boolean; const SSAnalyseFlags = SSA_GLYPHS or SSA_FALLBACK; + SpaceString: WideString = ' '; var TextOutFlags: DWORD; GlyphBufferSize: Integer; @@ -292,6 +293,21 @@ if Usp10IsInstalled then begin + // UniScribe requires that the string contains at least one character. + // If UniversalExtTextOut should be used to fill the background we can just + // pass a string made of a space. + if Count <= 0 then + if tooOpaque in Options then + begin + // Clipping is necessary, since depending on X, Y the space will be + // printed outside Rect and potentially fill more than we want. + TextOutFlags := TextOutFlags or ETO_CLIPPED; + Str := PWideChar(SpaceString); + Count := 1; + end + else + Exit; + // According to the MS Windows SDK (1.5 * Count + 16) is the recommended // value for GlyphBufferSize (see documentation of cGlyphs parameter of // ScriptStringAnalyse function) |