fonts_native.js
3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
!(function (e, n) {
e.AscFonts = e.AscFonts || {};
var r = e.AscFonts,
t = CreateEmbedObject('CTextMeasurerEmbed');
function o() {
this.error = 0;
}
o.prototype.free = function () {};
let _ = new o(),
i = new o();
function u(e) {
((this.size = e), (this.pointer = new Uint8Array(e)));
}
((i.count = 0),
(r.CopyStreamToMemory = function (e, n) {
return e;
}),
(r.GetUint8ArrayFromPointer = function (e, n) {
return e;
}),
(u.prototype.getBuffer = function () {
return this.pointer;
}),
(u.prototype.free = function () {}),
(u.prototype.set = function (e, n) {
this.pointer[e] = n;
}),
(r.AllocString = function (e) {
return new u(e);
}),
(r.FT_CreateLibrary = function (e) {
return t.FT_Init(e);
}),
(r.FT_Done_Library = function (e) {
e && t.FT_Free(e);
}),
(r.FT_Set_TrueType_HintProp = function (e, n) {
return t.FT_Set_TrueType_HintProp(e, n);
}),
(r.FT_Open_Face = function (e, n, r, o) {
return t.FT_Open_Face2(e, n, o);
}),
(r.FT_Done_Face = function (e) {
e && t.FT_Free(e);
}),
(r.FT_SetCMapForCharCode = function (e, n) {
return t.FT_SetCMapForCharCode(e, n);
}),
(r.FT_GetKerningX = function (e, n, r) {
return t.FT_GetKerningX(e, n, r);
}),
(r.FT_GetFaceMaxAdvanceX = function (e) {
return t.FT_GetFaceMaxAdvanceX(e);
}),
(r.FT_Set_Transform = function (e, n, r, o, _) {
return t.FT_Set_Transform(e, n, r, o, _);
}),
(r.FT_Set_Char_Size = function (e, n, r, o, _) {
return t.FT_Set_Char_Size(e, n, r, o, _);
}),
(r.FT_GetFaceInfo = function (e, n) {
var r = t.FT_GetFaceInfo(e);
return r ? ((_.error = 0), n.init(r, 0, r.length), _) : ((_.error = 1), _);
}),
(r.FT_Load_Glyph = function (e, n, r) {
return t.FT_Load_Glyph(e, n, r);
}),
(r.FT_SetCMapForCharCode = function (e, n) {
return t.FT_SetCMapForCharCode(e, n);
}),
(r.FT_Get_Glyph_Measure_Params = function (e, n, r) {
var o = t.FT_Get_Glyph_Measure_Params(e, !!n);
return o
? (r.init(new Uint8Array(o, 0, o.length)), (i.count = r.readInt()), (i.error = 0), i)
: ((i.error = 1), i);
}),
(r.FT_Get_Glyph_Render_Params = function (e, n, r) {
var o = t.FT_Get_Glyph_Render_Params(e, n);
return o ? ((_.error = 0), r.init(o, 0, o.length), _) : ((_.error = 1), _);
}),
(r.FT_Get_Glyph_Render_Buffer = function (e, n) {
return t.FT_Get_Glyph_Render_Buffer(e, n);
}));
let a = {};
((r.HB_FontFree = function (e) {
e && t.FT_Free(e);
}),
(r.HB_ShapeText = function (e, n, r, o, _, u, F) {
(a[u] || (a[u] = t.HB_LanguageFromString()), e.GetHBFont() || e.SetHBFont(t.HB_FontMalloc()));
let c = t.HB_ShapeText(e.GetFace(), e.GetHBFont(), n.pointer, r, o, _, a[u]);
if (!c) return ((i.error = 1), i);
F.init(new Uint8Array(c, 0, c.length));
let f = F.readUInt();
F.readPointer64();
return ((i.count = (f - 12) / 26), (i.error = 0), i);
}),
(r.Hyphen_Init = function () {}),
(r.Hyphen_Destroy = function () {}),
(r.Hyphen_CheckDictionary = function (e) {
return t.Hyphen_IsDictionaryExist(e);
}),
(r.Hyphen_LoadDictionary = function (e, n) {
return !1;
}),
(r.Hyphen_Word = function (e, n) {
let r = t.Hyphen_Word(e, n);
return r || [];
}),
r.onLoadModule(),
r.onLoadModule());
})(window);