ChemText: Fix handling of UTF8 code points with new parameter symbols '^' and '|'

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7979 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2021-03-13 10:47:26 +00:00
parent 3646a8dd75
commit bca8960049

View File

@ -133,7 +133,7 @@ implementation
{$R chemtext.res}
uses
Themes, Math;
Themes, Math, LazUtf8;
type
TArrowDir = (adLeft, adRight, adBoth);
@ -251,7 +251,7 @@ var
var
x0: Integer;
i, j: integer;
i, j, n: integer;
s: string;
subNos: boolean; // "subscript numbers"
escaping: Boolean;
@ -349,14 +349,16 @@ begin
SUPERSCRIPT_CHAR:
begin
inc(i);
DrawSup(X, Y, AText[i]);
n := UTF8CodePointSize(@AText[i+1]);
DrawSup(X, Y, copy(AText, i+1, n));
inc(i, n);
end;
SUBSCRIPT_CHAR:
begin
inc(i);
DrawSub(X, Y, AText[i]);
n := UTF8CodePointSize(@AText[i+1]);
DrawSub(X, Y, copy(AText, i+1, n));
inc(i, n);
end;
else