德尔福有一个WrapText http://docwiki.embarcadero.com/VCL/en/SysUtils.WrapText功能:
function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string;
function WrapText(const Line: string; MaxCol: Integer): string;
现在我需要一个处理 WideStrings 的版本:
function WrapTextW(const Line: WideString; MaxCol: Integer): WideString;
是否已经在某个地方编写了这样的函数?
警告:并非每个宽字符串字符都是 2 字节
这就是为什么我不敢写它
Update:需要超过 2 个字节来表示的字符示例:
带环和变音符号的大写拉丁文 W
- 字节:57 00 66 03 27 03
- Rendered in Chrome 17:
- Rendered in Internet Explorer 9:
- Rendered in Notepad using Segoe UI:
- Rendered in Notepad using Consolas:
- 在浏览器中以无衬线字体呈现:W̧̊
- 在您的浏览器中呈现
monospaced
font: W̧̊
正如科比克提到的,TNT Unicode 控件 http://www.yunqa.de/delphi/doku.php/products/tntunicodecontrols/index有单位TntSysUtils
其中包括以下功能:
function WideWrapText(const Line, BreakStr: WideString; const BreakChars: TSysCharSet;
MaxCol: Integer): WideString; overload;
function WideWrapText(const Line: WideString; MaxCol: Integer): WideString; overload;
备用下载站点是here http://www.axolot.com/TNT/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)