浏览代码

Don't skip surrogate pairs.

/main
Yuncong Zhang 5 年前
当前提交
1cc9df70
共有 3 个文件被更改,包括 10 次插入9 次删除
  1. 3
      Runtime/ui/painting/canvas_impl.cs
  2. 4
      Runtime/ui/txt/wordbreaker.cs
  3. 12
      Tests/Editor/Paragraph.cs

3
Runtime/ui/painting/canvas_impl.cs


layer.draws.Add(CanvasShader.texAlpha(layer, p, mesh, tex));
}
else {
Paint paintWithWhite = new Paint(p);
paintWithWhite.color = Colors.white;
Paint paintWithWhite = new Paint(p) {color = Colors.white};
layer.draws.Add(CanvasShader.tex(layer, paintWithWhite, mesh.resolveMesh(), EmojiUtils.image));
}
};

4
Runtime/ui/txt/wordbreaker.cs


this._current = 0;
this._scanOffset = 0;
this._inEmailOrUrl = false;
this.nextUntilCodePoint();
// this.nextUntilCodePoint();
}
public int current() {

}
for (; this._current < this._text.size; ++this._current) {
this.nextUntilCodePoint();
// this.nextUntilCodePoint();
if (this._current >= this._text.size) {
break;
}

12
Tests/Editor/Paragraph.cs


text:
"This is FontStyle.italic And 发撒放豆腐sad 发生的 Bold Text This is FontStyle.italic And Bold Text\n\n"),
new TextSpan(style: new TextStyle(fontSize: 18),
text: "FontSize 18: Get a named matrix value from the shader."),
text: "FontSize 18: Get a named matrix value from the shader.\n\n"),
new TextSpan(style: new TextStyle(fontSize: 24),
text: "Emoji \ud83d\ude0a\ud83d\ude0b\ud83d\ude0d\ud83d\ude0e\ud83d\ude00"),
new TextSpan(style: new TextStyle(fontSize: 14),

new TextSpan(style: new TextStyle(fontSize: 18),
text: "Emoji \ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05 Emoji Emoji"),
text: "\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05"),
text: "Emoji \ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05 Emoji Emoji Emoji"),
text: "\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05"),
text: "Emoji \ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05"),
text: "\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05"),
new TextSpan(style: new TextStyle(fontSize: 18),
text: "\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04\ud83d\ude05"),
text: "Emoji \ud83d\ude06\ud83d\ude1C\ud83d\ude18\ud83d\ude2D\ud83d\ude0C\ud83d\ude1EEmoji"),
text: "Emoji \ud83d\ude06\ud83d\ude1C\ud83d\ude18\ud83d\ude2D\ud83d\ude0C\ud83d\ude1E\n\n"),
new TextSpan(style: new TextStyle(fontSize: 14),
text: "FontSize 14"),
})));

正在加载...
取消
保存