~whereswaldon

North Carolina

https://waldon.blog

Interested in Linux, decentralization, cryptography, golang/rust/c, and communication.

I spend most of my free time on:

  • Arbor, a tree-based, decentralizable chat platform
  • Gio, an immediate-mode UI framework for Go
  • Gio-Extras, my collection of libraries to extend Gio

If you get value out of my work, please consider sponsoring me on Liberapay or GitHub.

~whereswaldon/public-inbox

Last active 3 months ago

~whereswaldon/arbor-ci

Last active 3 months ago

~whereswaldon/arbor-dev

Last active 8 months ago

~whereswaldon/arbor-announce

Last active 1 year, 7 months ago

~whereswaldon/arbor-infra

Last active 2 years ago

~whereswaldon/pointstar-devel

Last active 2 years ago

~whereswaldon/pointstar-announce

Last active 2 years ago
View more

Recent activity

Re: [PATCH gio v2 5/5] widget: [API] implement UAX#29 grapheme clustering in text widgets a day ago

From Chris Waldon to ~eliasnaur/gio-patches

On Thu, Mar 23, 2023 at 7:48 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Thu Mar 9, 2023 at 9:13 AM CST, ~whereswaldon wrote:
> > From: Chris Waldon <christopher.waldon.dev@gmail.com>
> >
> > This commit teaches the text widgets how to position their cursor according to
> > grapheme cluster boundaries rather than rune boundaries. While this is more work,
> > the results better match the expectations of users. A "grapheme cluster" is a
> > user-perceived character that may be composed of arbitrarily many runes.
> >
> > I chose to implement this within widgets because of several factors:
> >
> > - grapheme cluster boundaries would be extremely difficult to encode within the
> > glyph stream returned by the text shaper

Re: [PATCH gio v2 1/5] text,widget{,/material}: [API] support bitmap glyph rendering a day ago

From Chris Waldon to ~eliasnaur/gio-patches

On Thu, Mar 23, 2023 at 7:44 PM Elias Naur <mail@eliasnaur.com> wrote:
>
> On Tue Mar 7, 2023 at 12:02 PM CST, ~whereswaldon wrote:
> > From: Chris Waldon <christopher.waldon.dev@gmail.com>
> >
> > This commit supports rendering opentype glyphs containing bitmap data instead of
> > color data. In order to support returning the shaped bitmap glyphs from the Shaper's
> > Shape() method, it has gained a second return parameter, an op.CallOp. Adding
> > that CallOp immediately after or immediately before painting the returned path
> > will display the bitmap glyphs.
> >
> > The consequences of supporting colored glyphs forced changes upon the widget APIs
> > for widgets that display text. Previously text always had a fixed paint material,
> > so we could rely upon the caller setting the material (e.g. adding a paint.ColorOp)

Re: Gio Truncator Poll 3 days ago

From Chris Waldon to ~eliasnaur/gio

On Wed, Mar 22, 2023 at 4:06 PM Larry Clapp <larry@theclapp.org> wrote:
>
> > So far, I cannot find one.
>
> Me neither.
>
> Is the truncator symbol a rune or a string?  If it's a string and you don't want a truncator symbol, couldn't you just use ""?

It's a string, but this question is about whether it's allowed to set
it to "". Right now, I'll just use the default if you set it to the
empty string. Always having a truncator if truncation occurs gives us
some really nice invariants, which is why I'm exploring whether there
are important use cases that we lose if we require a truncator.

Gio Truncator Poll 3 days ago

From Chris Waldon to ~eliasnaur/gio

Hey all,

I'm working to enable truncator symbols in our text shaper. What this
would mean is that when you display a Label with MaxLines = 1 (or any
other non-zero value) and it doesn't fit, it would place a truncator
symbol at the end to indicate that it didn't fit. The default
truncator symbol would be …, but could be overridden per-label.

My question for you: Can you think of a use-case in which you would
_want_ to truncate the text _without_ displaying a truncator symbol?
So far, I cannot find one.

Cheers,
Chris

Gio News, February 2023 12 days ago

From Chris Waldon to ~eliasnaur/gio

Hey all,

Latest newsletter is available here:

https://gioui.org/news/2023-02

Cheers,
Chris

[PATCH gio] widget: ensure proper modifiers on key events 12 days ago

From Chris Waldon to ~eliasnaur/gio-patches

This commit extends the key event handling for text widgets to always check for
appropriate modifier keys. Previously this wasn't necessary, as the text widgets
would only ever receive key events it registered for, but now it may be the top-level
key event handler and thus receive all key events that aren't handled elsewhere.

Fixes: https://todo.sr.ht/~eliasnaur/gio/487
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
---
 widget/editor.go     | 57 ++++++++++++++++++++++++--------------------
 widget/selectable.go | 23 +++++++++++-------
 2 files changed, 45 insertions(+), 35 deletions(-)

diff --git a/widget/editor.go b/widget/editor.go
index 39237dbf..a05c3ce7 100644
[message trimmed]

Re: Image is blurred when updating to new gioui version 25 days ago

From Chris Waldon to ~eliasnaur/gio

On Tue, Feb 28, 2023 at 4:40 AM do justin <justindo.works@gmail.com> wrote:
>
> Hey all,
>
> I'm currently facing a blurry image issue when updating gioui from version gioui.org@v0.0.0-20220601100144-a896a467ecae to the latest version, can you show me how to fix that?

Late last year Gio gained support for automatically mipmapping images
[0], a GPU-efficient way to scale images down when they're being
displayed at a smaller size than the source image. It does look
blurrier than the previous behavior of choosing the nearest neighbor
pixel color, but it preserves more of the structure of the image
(especially at extremely small sizes). The best way to avoid
blurriness is to scale your input images to be close to the size you
display them at so that the mipmapping isn't necessary.

Re: try to start a simple example 25 days ago

From Chris Waldon to ~eliasnaur/gio

On Tue, Feb 28, 2023 at 10:49 AM Nicolas Prochazka
<nicolas.prochazka@gmail.com> wrote:
>
> Hello,
> I'm trying to play with gio and with a wasm runtime , I do :
> $env:GOARCH="wasm"
> PS C:\Users\nicolas\go\pkg\mod\gioui.org\example@v0.0.0-20230106143555-36885c97f785\hello>
> $env:GOOS="js"
> PS C:\Users\nicolas\go\pkg\mod\gioui.org\example@v0.0.0-20230106143555-36885c97f785\hello>
>  go build -o wa.wasm .\hello.go
> PS C:\Users\nicolas\go\pkg\mod\gioui.org\example@v0.0.0-20230106143555-36885c97f785\hello>
> wasmtime.exe wa.wasm
> Error: failed to run main module `wa.wasm`

[PATCH gio] text: test maxlines with exported API 29 days ago

From Chris Waldon to ~eliasnaur/gio-patches

This commit changes _how_ the test for line wrapping is implemented to rely on the
exported API rather than internal symbols.

Thanks to https://github.com/gioui/gio/pull/109 for pointing this out.

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
---
 text/shaper_test.go | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/text/shaper_test.go b/text/shaper_test.go
index a150c3dc..825ca6c5 100644
--- a/text/shaper_test.go
+++ b/text/shaper_test.go
[message trimmed]