From 03c21dc1b5a9737cf647b6c3ffeb1cb35c40b0ea Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Mon, 7 Aug 2023 09:50:34 -0400 Subject: [PATCH] text: add android portability notice to NewShaper NewShaper cannot be called prior to opening an application window on Android unless the application does not want system font support. Add a note to this effect to the constructor. Signed-off-by: Chris Waldon --- text/shaper.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/text/shaper.go b/text/shaper.go index 4e9a88c3..76a90f39 100644 --- a/text/shaper.go +++ b/text/shaper.go @@ -245,8 +245,11 @@ func WithCollection(collection []FontFace) ShaperOption { } } -// NewShaper constructs a shaper with the provided collection of font faces -// available. +// NewShaper constructs a shaper with the provided options. +// +// NewShaper must be called after [app.NewWindow], unless the [NoSystemFonts] +// option is specified. This is an unfortunate restriction caused by some platforms +// such as Android. func NewShaper(options ...ShaperOption) *Shaper { l := &Shaper{} for _, opt := range options {