浏览代码

update json message

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
5a446124
共有 1 个文件被更改,包括 8 次插入15 次删除
  1. 23
      com.unity.uiwidgets/Runtime/ui2/text.cs

23
com.unity.uiwidgets/Runtime/ui2/text.cs


using UnityEngine;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.external.simplejson;
using Unity.UIWidgets.services;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.ui2 {

}
}
static byte[] _fontChangeMessageData;
static byte[] _fontChangeMessage {
get {
if (_fontChangeMessageData != null) {
return _fontChangeMessageData;
}
JSONObject message = new JSONObject();
message["type"] = "fontsChange";
_fontChangeMessageData = Encoding.ASCII.GetBytes(message.ToString());
return _fontChangeMessageData;
}
}
static byte[] _fontChangeMessage = JSONMessageCodec.instance.encodeMessage(
new Dictionary<string, string>() {
{"type", "fontsChange"}
});
static void _sendFontChangeMessage() {
Window.instance.onPlatformMessage?.Invoke("uiwidgets/system", _fontChangeMessage,

List<FontFeature> fontFeatures = null
) {
D.assert(color == null || foreground == null, () =>
"Cannot provide both a color and a foreground\n"+
"Cannot provide both a color and a foreground\n" +
"The color argument is just a shorthand for \"foreground: Paint()..color = color\"."
);
_encoded = ui_._encodeTextStyle(

public List<TextBox> getBoxesForRange(int start, int end,
BoxHeightStyle boxHeightStyle = BoxHeightStyle.tight,
BoxWidthStyle boxWidthStyle = BoxWidthStyle.tight) {
var data = _getBoxesForRange( start, end, (int) boxHeightStyle, (int) boxWidthStyle).toFloatArrayAndFree();
var data = _getBoxesForRange(start, end, (int) boxHeightStyle, (int) boxWidthStyle).toFloatArrayAndFree();
return _decodeTextBoxes(data, data.Length);
}

return metrics;
}
ui_.Float32List _computeLineMetrics() => Paragraph_computeLineMetrics(_ptr);
}

正在加载...
取消
保存