Browse Source

+ use Video.StringDisplayWidth in UDrivers.StrWidth

git-svn-id: branches/unicodekvm@48766 -
nickysn 4 years ago
parent
commit
8751e98339
1 changed files with 1 additions and 4 deletions
  1. 1 4
      packages/fv/src/drivers.inc

+ 1 - 4
packages/fv/src/drivers.inc

@@ -943,10 +943,7 @@ end;
 FUNCTION StrWidth(Const S: Sw_String): Sw_Integer;
 FUNCTION StrWidth(Const S: Sw_String): Sw_Integer;
 VAR EGC: Sw_String;
 VAR EGC: Sw_String;
 BEGIN
 BEGIN
-   { todo: handle wide (CJK, emoji) characters as double width }
-   Result := 0;
-   for EGC in TUnicodeStringExtendedGraphemeClustersEnumerator.Create(S) do
-     Inc(Result);
+   Result := Video.StringDisplayWidth(S);
 END;
 END;
 {$else FV_UNICODE}
 {$else FV_UNICODE}
 FUNCTION StrWidth(Const S: Sw_String): Sw_Integer;
 FUNCTION StrWidth(Const S: Sw_String): Sw_Integer;