Skip to content

Displaying layers on top of wide characters can cause issues #100

Open

Description

@gyscos

When a layer is drawn on top of another layer, if this lower layer contains wide characters, bad things may happen.
In general, if we overwrite only one of the two columns of a wide character, the entire character is replaced.
This means everything to the right will be offset by 1 column to the left.
This is visible in the lorem example, if the popup window is above the Japanese text.

Not sure how to solve this... Every time we write on top of a wide character, if we're only overwriting half of it, we need to add a space before or after.
This requires knowing what's under the layer being drawn, which is not possible currently.
Instead of keeping a copy of the entire screen, we could just keep a grid of the wide characters present. Though this does mean parsing every string being printed... Doh :(

nmtui seems to be doing fine, it indeed replaces wide characters with space.

Note: be careful to keep the style of the wide character.

Activity

  1. gyscos commented on Jun 13, 2017

    @gyscos
    OwnerAuthor

    Note: the termion backend appears unaffected.
    The bearlibterminal backend doesn't seem to currently support wide characters at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions