-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathFontFace.res
More file actions
62 lines (50 loc) · 1.65 KB
/
Copy pathFontFace.res
File metadata and controls
62 lines (50 loc) · 1.65 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
/**
`fromString(~family: string, ~source: string, ~descriptors: fontFaceDescriptors=?)`
Creates a new `FontFace` from CSS source text.
```res
let fontFace =
FontFace.fromString(~family="Inter", ~source="url(/fonts/inter.woff2)")
```
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
*/
@new
external fromString: (
~family: string,
~source: string,
~descriptors: CssFontLoadingTypes.fontFaceDescriptors=?,
) => CssFontLoadingTypes.fontFace = "FontFace"
/**
`fromDataView(~family: string, ~source: DataView.t, ~descriptors: fontFaceDescriptors=?)`
Creates a new `FontFace` from `DataView`-backed font data.
```res
let fontFace =
FontFace.fromDataView(~family="Inter", ~source=myDataView)
```
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
*/
@new
external fromDataView: (
~family: string,
~source: DataView.t,
~descriptors: CssFontLoadingTypes.fontFaceDescriptors=?,
) => CssFontLoadingTypes.fontFace = "FontFace"
/**
`fromArrayBuffer(~family: string, ~source: ArrayBuffer.t, ~descriptors: fontFaceDescriptors=?)`
Creates a new `FontFace` from `ArrayBuffer`-backed font data.
```res
let fontFace =
FontFace.fromArrayBuffer(~family="Inter", ~source=myArrayBuffer)
```
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace)
*/
@new
external fromArrayBuffer: (
~family: string,
~source: ArrayBuffer.t,
~descriptors: CssFontLoadingTypes.fontFaceDescriptors=?,
) => CssFontLoadingTypes.fontFace = "FontFace"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FontFace/load)
*/
@send
external load: CssFontLoadingTypes.fontFace => promise<CssFontLoadingTypes.fontFace> = "load"