@@ -146,21 +146,23 @@ Convert the argument to a string, using the specified _format_.
146146| :--- | :--- |
147147| ` utf-8 ` | The argument is a list of UTF-8 code points |
148148| ` utf-16 ` | The argument is a list of UTF-16 code points |
149- | ` unicode-scalars ` | The argument is a list of Unicode scalars (same as UTF-32) |
149+ | ` unicode-scalars ` | The argument is a list of Unicode scalars (same as UTF-32) or a single Unicode scalar |
150+
151+ If no _ format_ is specified, the default is ` unicode-scalars ` .
150152
151153For example:
152154
153155``` json example
154- [" StringFrom" , [" List" 240 , 159 , 148 , 159 ], " utf-8" ]
156+ [" StringFrom" , [" List" 240 , 159 , 148 , 159 ], { str: "utf-8"} ]
155157// ➔ "Hello"
156158
157- [" StringFrom" , [" List" , 55357 , 56607 ], " utf-16" ]
159+ [" StringFrom" , [" List" , 55357 , 56607 ], { str: "utf-16"} ]
158160// ➔ "\u0048\u0065\u006c\u006c\u006f"
159161
160- [" StringFrom" , 128287 , " unicode-scalars " ]
162+ [" StringFrom" , 128287 ]
161163// ➔ "🔟"
162164
163- [" StringFrom" , [" List" , 127467 , 127479 ], " unicode-scalars " ]
165+ [" StringFrom" , [" List" , 127467 , 127479 ]]
164166// ➔ "🇫🇷"
165167```
166168
@@ -186,6 +188,10 @@ Return a list of UTF-8 code points for the given _string_.
186188// ➔ ["List", 240, 159, 145, 169, 226, 128, 141, 240, 159, 142, 147]
187189```
188190
191+ ** To create a string from UTF-8 code points** , use the ` ["StringFrom", _list_, "utf-8"] ` function.
192+
193+ ** See also** : [ ` Utf16 ` ] ( #utf16 ) , [ ` UnicodeScalars ` ] ( #unicodescalars ) and [ ` GraphemeClusters ` ] ( #graphemeclusters ) .
194+
189195</FunctionDefinition >
190196
191197
@@ -196,7 +202,7 @@ Return a list of UTF-8 code points for the given _string_.
196202<FunctionDefinition name =" Utf16 " >
197203<Signature name =" Utf16 " returns =" list<integer> " >string</Signature >
198204
199- Return a list of utf -16 code points for the given _ string_ .
205+ Return a list of UTF -16 code points for the given _ string_ .
200206
201207** Note:** The values returned are UTF-16 code units, not Unicode scalar values.
202208
@@ -208,6 +214,10 @@ Return a list of utf-16 code points for the given _string_.
208214// ➔ ["List", 55357, 56489, 8205, 55356, 57235]
209215```
210216
217+ ** To create a string from UTF-16 code units** , use the ` ["StringFrom", _list_, "utf-16"] ` function.
218+
219+ ** See also** : [ ` Utf8 ` ] ( #utf8 ) , [ ` UnicodeScalars ` ] ( #unicodescalars ) and [ ` GraphemeClusters ` ] ( #graphemeclusters ) .
220+
211221</FunctionDefinition >
212222
213223
@@ -238,6 +248,10 @@ composed of several scalars.
238248// ➔ [128105, 8205, 127891]
239249```
240250
251+ ** To create a string from Unicode scalars** , use the ` ["StringFrom", _list_, "unicode-scalars"] ` function.
252+
253+ ** See also** : [ ` Utf8 ` ] ( #utf8 ) , [ ` Utf16 ` ] ( #utf16 ) , and [ ` GraphemeClusters ` ] ( #graphemeclusters ) .
254+
241255</FunctionDefinition >
242256
243257
@@ -249,7 +263,7 @@ composed of several scalars.
249263<FunctionDefinition name =" GraphemeClusters " >
250264<Signature name =" GraphemeClusters " returns =" list<string> " >string</Signature >
251265
252- A ** grapheme cluster** is the smallest unit of text that a reader perceives
266+ A ** grapheme cluster** is the smallest unit of text that a reader perceives
253267as a single character. It may consist of one or more ** Unicode scalars**
254268(code points).
255269
@@ -276,10 +290,8 @@ The table below illustrates the difference between grapheme clusters and Unicode
276290| <span style={{fontSize: "1.3rem"}}>` é ` </span > (NFD) | <span style={{fontSize: "1.3rem"}}>` ["é"] ` </span > | ` [101, 769] ` |
277291| <span style={{fontSize: "1.3rem"}}>` 👩🎓 ` </span > | <span style={{fontSize: "1.3rem"}}>` ["👩🎓"] ` </span > | ` [128105, 8205, 127891] ` |
278292
279- In contrast, a Unicode scalar is a single code point in the Unicode standard,
280- corresponding to a UTF-32 value. Grapheme clusters are built from one or more scalars.
281293
282- This function splits a string into grapheme clusters, not scalars.
294+ This function splits a string into grapheme clusters:
283295
284296``` json example
285297[" GraphemeClusters" , " Hello" ]
@@ -295,6 +307,8 @@ This function splits a string into grapheme clusters, not scalars.
295307For more details on how grapheme cluster boundaries are determined,
296308see [ Unicode® Standard Annex #29 ] ( https://unicode.org/reports/tr29/ ) .
297309
310+ ** See also** : [ ` Utf8 ` ] ( #utf8 ) , [ ` Utf16 ` ] ( #utf16 ) , and [ ` UnicodeScalars ` ] ( #unicodescalars ) .
311+
298312</FunctionDefinition >
299313
300314
@@ -439,7 +453,7 @@ A script level of `0` is normal size, `1` is smaller, and `2` is even smaller.
439453The following keys are applicable to text content:
440454- ` weight ` a string, one of ` "normal" ` , ` "bold" ` , ` "bolder" ` , ` "light" `
441455- ` style ` a string, one of ` "normal" ` , ` "italic" ` , ` "oblique" `
442- - ` language ` a string indicating the language of the expression, e.g. ` "en" ` , ` "fr" ` , ` "es" ` etc.
456+ - ` language ` a string indicating the language of the expression, e.g. ` "en" ` (English) , ` "fr" ` (French) , ` "es" ` (Spanish)
443457
444458
445459
@@ -452,67 +466,22 @@ The following keys are applicable to both math expressions and text content:
452466- ` cssId ` a string indicating the CSS id of the expression
453467
454468
455-
456-
457-
469+ <!--
458470The keys in the dictionary include:
459471- `style` a string, one of `"normal"`, `"italic"`, `"oblique"`
460472- `size` a number from `1` to `10` where `5` is normal size
461473- `font` a string indicating the font family
462474- `fontSize` a number indicating the font size in pixels
463475- `fontWeight` a string indicating the font weight, e.g. `"normal"`, `"bold"`, `"bolder"`, `"lighter"`
464476- `fontStyle` a string indicating the font style, e.g. `"normal"`, `"italic"`, `"oblique"`
465- - ` textDecoration ` a string indicating the text decoration, e.g. ` "none" ` , ` "underline" ` , ` "line-through" `
466- - ` textAlign ` a string indicating the text alignment, e.g. ` "left" ` , ` "center" ` , ` "right" `
467- - ` textTransform ` a string indicating the text transformation, e.g. ` "none" ` , ` "uppercase" ` , ` "lowercase" `
468- - ` textIndent ` a number indicating the text indentation in pixels
469- - ` lineHeight ` a number indicating the line height in pixels
470- - ` letterSpacing ` a number indicating the letter spacing in pixels
471- - ` wordSpacing ` a number indicating the word spacing in pixels
472477- `backgroundColor` a color name or hex code for the background color
473478- `border` a string indicating the border style, e.g. `"none"`, `"solid"`, `"dashed"`, `"dotted"`
474479- `borderColor` a color name or hex code for the border color
475480- `borderWidth` a number indicating the border width in pixels
476481- `padding` a number indicating the padding in pixels
477482- `margin` a number indicating the margin in pixels
478- - ` textShadow ` a string indicating the text shadow, e.g. ` "2px 2px 2px rgba(0,0,0,0.5)" `
479- - ` boxShadow ` a string indicating the box shadow, e.g. ` "2px 2px 5px rgba(0,0,0,0.5)" `
480483- `opacity` a number from `0` to `1` indicating the opacity of the expression
481- - ` transform ` a string indicating the CSS transform, e.g. ` "rotate(45deg)" ` , ` "scale(1.5)" ` , ` "translateX(10px)" `
482- - ` transition ` a string indicating the CSS transition, e.g. ` "all 0.3s ease-in-out" `
483- - ` cursor ` a string indicating the cursor style, e.g. ` "pointer" ` , ` "default" ` , ` "text" `
484- - ` display ` a string indicating the CSS display property, e.g. ` "inline" ` , ` "block" ` , ` "flex" ` , ` "grid" `
485- - ` visibility ` a string indicating the CSS visibility property, e.g. ` "visible" ` , ` "hidden" ` , ` "collapse" `
486- - ` zIndex ` a number indicating the z-index of the expression
487- - ` position ` a string indicating the CSS position property, e.g. ` "static" ` , ` "relative" ` , ` "absolute" ` , ` "fixed" `
488- - ` float ` a string indicating the CSS float property, e.g. ` "left" ` , ` "right" ` , ` "none" `
489- - ` clear ` a string indicating the CSS clear property, e.g. ` "left" ` , ` "right" ` , ` "both" ` , ` "none" `
490- - ` overflow ` a string indicating the CSS overflow property, e.g. ` "visible" ` , ` "hidden" ` , ` "scroll" ` , ` "auto" `
491- - ` overflowX ` a string indicating the CSS overflow-x property, e.g. ` "visible" ` , ` "hidden" ` , ` "scroll" ` , ` "auto" `
492- - ` overflowY ` a string indicating the CSS overflow-y property, e.g. ` "visible" ` , ` "hidden" ` , ` "scroll" ` , ` "auto" `
493- - ` whiteSpace ` a string indicating the CSS white-space property, e.g. ` "normal" ` , ` "nowrap" ` , ` "pre" ` ,
494- - ` textOverflow ` a string indicating the CSS text-overflow property, e.g. ` "ellipsis" ` , ` "clip" `
495- - ` direction ` a string indicating the text direction, e.g. ` "ltr" ` (left-to-right) or ` "rtl" ` (right-to-left)
496- - ` lang ` a string indicating the language of the expression, e.g. ` "en" ` (English), ` "fr" ` (French), ` "es" ` (Spanish)
497- - ` role ` a string indicating the ARIA role of the expression, e.g. ` "button" ` , ` "link" ` , ` "textbox" `
498- - ` aria-label ` a string providing an accessible label for the expression
499- - ` aria-labelledby ` a string providing an accessible label by referencing another element's ID
500- - ` aria-describedby ` a string providing an accessible description by referencing another element's ID
501- - ` aria-hidden ` a boolean indicating whether the expression is hidden from assistive technologies
502- - ` aria-live ` a string indicating the ARIA live region, e.g. ` "off" ` , ` "polite" ` , ` "assertive" `
503- - ` aria-atomic ` a boolean indicating whether assistive technologies should treat the expression as a whole
504- - ` aria-relevant ` a string indicating what changes in the expression are relevant to assistive technologies, e.g. `"additions"
505- - ` aria-controls ` a string providing the ID of another element that the expression controls
506- - ` aria-expanded ` a boolean indicating whether the expression is expanded or collapsed
507- - ` aria-pressed ` a boolean indicating whether the expression is pressed (for toggle buttons)
508- - ` aria-selected ` a boolean indicating whether the expression is selected
509- - ` aria-checked ` a boolean indicating whether the expression is checked (for checkboxes or radio buttons)
510- - ` aria-valuenow ` a number indicating the current value of the expression (for sliders or progress bars)
511- - ` aria-valuetext ` a string providing a text representation of the current value of the expression
512- - ` aria-valuemin ` a number indicating the minimum value of the expression (for sliders or progress bars)
513- - ` aria-valuemax ` a number indicating the maximum value of the expression (for sliders or progress bars)
514- - ` aria-keyshortcuts ` a
515-
484+ -->
516485
517486The ` Annotated ` function is ** inert** and the value of a ` ["Annotated", expr] ` expression is ` expr ` .
518487
0 commit comments