~eliasnaur/giouiorg

b87e915d761b03144db6d154a9ac69db971a4479 — Chris Waldon 5 months ago 38c9628
architecture: update text handling info page

This commit removes references to obsolete APIs in the text section.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
1 files changed, 5 insertions(+), 5 deletions(-)

M content/doc/architecture/text.md
M content/doc/architecture/text.md => content/doc/architecture/text.md +5 -5
@@ 5,11 5,11 @@ subtitle: Low-level text management

## Fonts

[`gioui.org/font`](https://gioui.org/font) contains the central registry for fonts. This helps to reduce passing fonts around throughout the program.
Gio's text shaper uses the type `[]text.FontFace` to represent the collection of available fonts.

There is one font bundled in package [`gioui.org/font/gofont`](https://gioui.org/font/gofont), you can use [`gofont.Register()`](https://gioui.org/font/gofont#Register) to register it to the global registry.
There is one font bundled in package [`gioui.org/font/gofont`](https://gioui.org/font/gofont), you can use [`gofont.Collection()`](https://gioui.org/font/gofont#Collection) to get a `[]text.FontFace` containing all of the variants of the Go fonts.

For loading other fonts there is [`gioui.org/font/opentype`](https://gioui.org/font/opentype). After parsing the font(s) using [`opentype.Parse`](https://gioui.org/font/opentype#Parse) or [`opentype.ParseCollection`](https://gioui.org/font/opentype#ParseCollection) they can be registered with [`font.Register`](https://gioui.org/font#Register).
For loading other fonts there is [`gioui.org/font/opentype`](https://gioui.org/font/opentype). After parsing the font(s) using [`opentype.Parse`](https://gioui.org/font/opentype#Parse), you can append them to a `[]text.FontFace`.

<!-- TODO: code example. -->



@@ 17,6 17,6 @@ For loading other fonts there is [`gioui.org/font/opentype`](https://gioui.org/f

For converting strings to clip shapes there is the [`gioui.org/text`](https://gioui.org/text) package.

It contains [`text.Cache`](https://gioui.org/text#Cache) that implements cached string to shape conversion, with appropriate fallbacks.
It contains [`text.Cache`](https://gioui.org/text#Cache) that implements cached string to shape conversion, with appropriate fallbacks. Simply provide your fonts (`[]text.FontFace`) to `text.NewCache`.

In most cases you can use [`widget.Label`](https://gioui.org/widget#Label) which handles wrapping and layout constraints. Or when you are using material design [`material.LabelStyle`](https://gioui.org/widget/material#LabelStyle).
\ No newline at end of file
In most cases you can use [`widget.Label`](https://gioui.org/widget#Label) which handles wrapping and layout constraints. Or when you are using material design [`material.LabelStyle`](https://gioui.org/widget/material#LabelStyle).