You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/api.json
+90-88Lines changed: 90 additions & 88 deletions
Original file line number
Diff line number
Diff line change
@@ -8311,51 +8311,38 @@
8311
8311
},
8312
8312
{
8313
8313
"kind": "typename",
8314
-
"name": "oc_text_shape_settings",
8315
-
"doc": "Settings used with `oc_text_shape()`.",
8314
+
"name": "oc_text_attributes",
8315
+
"doc": "A struct describing graphical attributes to apply to a range of text.",
8316
8316
"type": {
8317
8317
"kind": "struct",
8318
8318
"fields": [
8319
8319
{
8320
-
"name": "script",
8321
-
"doc": [
8322
-
"An ISO 15924 script tag specifying the script of the text being shaped. ",
8323
-
"An empty string indicates that `oc_text_shape()` should try to guess the input text's script."
8324
-
],
8320
+
"name": "font",
8325
8321
"type": {
8326
8322
"kind": "namedType",
8327
-
"name": "oc_str8"
8323
+
"name": "oc_font"
8328
8324
}
8329
8325
},
8330
8326
{
8331
-
"name": "lang",
8332
-
"doc": [
8333
-
"An BCP 47 language tag specifying the language of the text being shaped. ",
8334
-
"An empty string indicates that `oc_text_shape()` should try to guess the input text's language."
8335
-
],
8327
+
"name": "fontSize",
8336
8328
"type": {
8337
-
"kind": "namedType",
8338
-
"name": "oc_str8"
8329
+
"kind": "f32"
8339
8330
}
8340
8331
},
8341
8332
{
8342
-
"name": "direction",
8343
-
"doc": [
8344
-
"The direction of the text being shaped. ",
8345
-
"`OC_TEXT_DIRECTION_UNKNOWN` indicates that `oc_text_shape()` should use the default direction for the text's script."
8346
-
],
8333
+
"name": "color",
8347
8334
"type": {
8348
8335
"kind": "namedType",
8349
-
"name": "oc_text_direction"
8336
+
"name": "oc_color"
8350
8337
}
8351
8338
}
8352
8339
]
8353
8340
}
8354
8341
},
8355
8342
{
8356
8343
"kind": "typename",
8357
-
"name": "oc_glyph_run",
8358
-
"doc": "An opaque struct representing a shaped glyph run.",
8344
+
"name": "oc_text_line",
8345
+
"doc": "An opaque struct representing a line of shaped glyphs.",
8359
8346
"type": {
8360
8347
"kind": "struct"
8361
8348
}
@@ -10234,19 +10221,14 @@
10234
10221
},
10235
10222
{
10236
10223
"kind": "proc",
10237
-
"name": "oc_text_shape",
10238
-
"doc": [
10239
-
"Shapes a segment of unicode codepoints and returns a shaped glyph run. The glyph run can the be used to draw the glyphs, measure portions of the shaped text, or compute caret positions.",
10240
-
"",
10241
-
"The segment being shaped is comprised between `begin` (inclusive) and `end` (exclusive), but the shaper may look at codepoints before and after those bounds if available. This means that if you want to shape a subset of a bigger text, giving `oc_text_shape` the full text and setting `begin` and `end` appropriately may give better results than passing only the subset you want to shape."
10242
-
],
10243
-
10224
+
"name": "oc_text_line_from_utf32",
10225
+
"doc": "Shapes a line of unicode codepoints. The line can the be used to draw the shaped glyphs, measure portions of the shaped text, or compute caret positions.",
10244
10226
"return": {
10245
-
"doc": "The shaped glyph run, allocated on the given `arena`.",
10227
+
"doc": "The shaped line of text, allocated on the given `arena`.",
10246
10228
"kind": "pointer",
10247
10229
"type": {
10248
10230
"kind": "namedType",
10249
-
"name": "oc_glyph_run"
10231
+
"name": "oc_text_line"
10250
10232
}
10251
10233
},
10252
10234
"params": [
@@ -10262,74 +10244,91 @@
10262
10244
}
10263
10245
},
10264
10246
{
10265
-
"name": "font",
10266
-
"doc": "The font to use for shaping.",
10247
+
"name": "codepoints",
10248
+
"doc": "The string of unicode codepoints to shape.",
10267
10249
"type": {
10268
10250
"kind": "namedType",
10269
-
"name": "oc_font"
10251
+
"name": "oc_str32"
10270
10252
}
10271
10253
},
10272
10254
{
10273
-
"name": "settings",
10274
-
"doc": "Settings to use for shaping the text. If some fields of the struct are set to zero, the shaper will try to guess their values from the input codepoints. You can also pass `null` to guess all settings.",
10255
+
"name": "attributes",
10256
+
"doc": "The text attributes to use when shaping the text.",
10275
10257
"type": {
10276
10258
"kind": "pointer",
10277
10259
"type": {
10278
10260
"kind": "namedType",
10279
-
"name": "oc_text_shape_settings"
10261
+
"name": "oc_text_attributes"
10280
10262
}
10281
10263
}
10282
-
},
10264
+
}
10265
+
]
10266
+
},
10267
+
{
10268
+
"kind": "proc",
10269
+
"name": "oc_text_line_from_utf8",
10270
+
"doc": "Shapes a line of utf8 encoded text. This is a wrapper around `oc_text_line_from_utf32()`",
10271
+
"return": {
10272
+
"doc": "The shaped line of text, allocated on the given `arena`.",
10273
+
"kind": "pointer",
10274
+
"type": {
10275
+
"kind": "namedType",
10276
+
"name": "oc_text_line"
10277
+
}
10278
+
},
10279
+
"params": [
10283
10280
{
10284
-
"name": "codepoints",
10285
-
"doc": "The full string of unicode codepoints that the shaper may look at for shaping.",
10281
+
"name": "arena",
10282
+
"doc": "An arena on which to allocate all data for the resulting shaped run.",
10286
10283
"type": {
10287
-
"kind": "namedType",
10288
-
"name": "oc_str32"
10284
+
"kind": "pointer",
10285
+
"type": {
10286
+
"kind": "namedType",
10287
+
"name": "oc_arena"
10288
+
}
10289
10289
}
10290
10290
},
10291
10291
{
10292
-
"name": "begin",
10293
-
"doc": "The begining index (inclusive) of the sub-segment of `codepoints` that should be shaped.",
10292
+
"name": "string",
10293
+
"doc": "The string of utf8 encoded text to shape.",
10294
10294
"type": {
10295
-
"kind": "u64"
10295
+
"kind": "namedType",
10296
+
"name": "oc_str8"
10296
10297
}
10297
10298
},
10298
10299
{
10299
-
"name": "end",
10300
-
"doc": "The end index (exclusive) of the sub-segment of `codepoints` that should be shaped.",
10300
+
"name": "attributes",
10301
+
"doc": "The text attributes to use when shaping the text.",
10301
10302
"type": {
10302
-
"kind": "u64"
10303
+
"kind": "pointer",
10304
+
"type": {
10305
+
"kind": "namedType",
10306
+
"name": "oc_text_attributes"
10307
+
}
10303
10308
}
10304
10309
}
10305
10310
]
10306
10311
},
10307
10312
{
10308
10313
"kind": "proc",
10309
-
"name": "oc_glyph_run_point_to_cursor",
10310
-
"doc": "Converts a geometric position in a glyph run to a codepoint index.",
0 commit comments