Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable quadrants+sextants in wezterm #1715

Closed
dankamongmen opened this issue Jun 3, 2021 · 20 comments
Closed

enable quadrants+sextants in wezterm #1715

dankamongmen opened this issue Jun 3, 2021 · 20 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dankamongmen
Copy link
Owner

quadrants look pretty good (sextants are another story) in wezterm 20210502 (verified with caps-rendered). we don't have a match for wezterm just yet, but we ought get one, and enable quadrants.

@dankamongmen dankamongmen added the enhancement New feature or request label Jun 3, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Jun 3, 2021
@dankamongmen dankamongmen self-assigned this Jun 3, 2021
@dankamongmen
Copy link
Owner Author

@wez, just a heads up. i'm going to enable this in our heuristics section when i identify wezterm. i'm not yet enabling sextants, since wezterm is relying on the font for those (i seem to recall filing a bug on this, but can't for the life of me find it). quadrants look good, but sextants are ragged. as a result, NCBLIT_DEFAULT will take the value NCBLIT_2x2 on wezterm when not preserving aspect ratio.

if you start drawing your own sextant glyphs, we can pump that up to NCBLIT_3x2.

@wez
Copy link

wez commented Jun 10, 2021

wez/wezterm#584 is our issue tracking perfect block drawing glyphs, with wez/wezterm#588 as a slow-moving-but-not-abandoned PR to implement them.

@dankamongmen
Copy link
Owner Author

you're my hero, ferris bueller

wez added a commit to wez/wezterm that referenced this issue Jun 11, 2021
While I'm in here, teach the font fallback code that it doesn't
need to search for these glyphs when custom block glyphs are
enabled.

refs: dankamongmen/notcurses#1715
refs: #584
refs: #588
@wez
Copy link

wez commented Jun 11, 2021

I added just the sextant block glyphs to the nightly build just now. I don't appear to have a font that has those glyphs, so I based this entirely off my one pass through page 3 of https://unicode.org/charts/PDF/U1FB00.pdf this evening. Let me know if it looks weird, or if you need the smooth mosaic glyphs too!

@dankamongmen
Copy link
Owner Author

i will test shortly, hot shit!

@dankamongmen
Copy link
Owner Author

testing as soon as build completes. before:

2021-06-12-113552_1920x1080_scrot

@dankamongmen
Copy link
Owner Author

running into a linking issue

  = note: /usr/sbin/ld: /home/dank/src/wezterm/target/release/deps/libfreetype-d6297c198392dce3.rlib(ftinit.o):(.data.rel.ro.ft_default_modules+0x80): undefined reference to `ft_sdf_renderer_class'
          /usr/sbin/ld: /home/dank/src/wezterm/target/release/deps/libfreetype-d6297c198392dce3.rlib(ftinit.o):(.data.rel.ro.ft_default_modules+0x88): undefined reference to `ft_bitmap_sdf_renderer_class'

but i think this is because i updated the submodules past where they are in upstream wezterm. doing a build in a fresh checkout.

@dankamongmen
Copy link
Owner Author

glorious!

2021-06-12-115151_1920x1080_scrot

is there any way for me to programmatically detect this feature? if not, i'm inclined to turn it on unconditionally when wezterm is detected, but i assume you have a better understanding of when new versions hit distros -- if you'd rather i hold off, let me know.

@dankamongmen dankamongmen changed the title support quadrants in wezterm enable quadrants+sextants in wezterm Jun 12, 2021
@dankamongmen
Copy link
Owner Author

one little thing while i have you here, @wez : your half blocks don't appear to meet. see the circled glyphs:

broken-halves

that lower half ought be rising to the same level where the upper half starts, or things will look weird. i assume you're drawing these yourself, rather than using the font? if so, it looks like the lower half needs to be raised, as opposed to the upper half truncated (i don't think the lower half is coming all the way up to the middle).

@dankamongmen
Copy link
Owner Author

i did a quick visual inspection of all your sextant glyphs, and they look correct. nice work!

@dankamongmen
Copy link
Owner Author

it looks like we can detect the wezterm version with its environment variables:

declare -x TERM_PROGRAM="WezTerm"
declare -x TERM_PROGRAM_VERSION="20210610-204057-2e7dc70e"

i'll be doing this in #1759, which is a dependency of this bug.

@wez
Copy link

wez commented Jun 12, 2021

re: halves not matching up, which codepoints are those; the ones in the 0x2580 block range or some others?

@dankamongmen
Copy link
Owner Author

re: halves not matching up, which codepoints are those; the ones in the 0x2580 block range or some others?


[grimes](0) $ unicode U+2584 U+2580
U+2584 LOWER HALF BLOCK
UTF-8: e2 96 84 UTF-16BE: 2584 Decimal: ▄ Octal: \022604
▄
Category: So (Symbol, Other); East Asian width: A (ambiguous)
Unicode block: 2580..259F; Block Elements
Bidi: ON (Other Neutrals)


U+2580 UPPER HALF BLOCK
UTF-8: e2 96 80 UTF-16BE: 2580 Decimal: ▀ Octal: \022600
▀
Category: So (Symbol, Other); East Asian width: A (ambiguous)
Unicode block: 2580..259F; Block Elements
Bidi: ON (Other Neutrals)


[grimes](0) $ 

@dankamongmen
Copy link
Owner Author

alright, i've now got detection code that identifies WezTerm based off TERM_PROGRAM iff TERM contains the string xterm, and enables sextants iff strcmp(TERM_PROGRAM_VERSION, "20210610") >= 0. it all appears to work properly.

old wezterm in /usr/bin, note sextants: n

2021-06-12-130306_960x650_scrot

new wezterm in home, note sextants: y

2021-06-12-130404_960x1057_scrot

wez added a commit to wez/wezterm that referenced this issue Jun 12, 2021
* Rename `draw_quad` to `fill_rect` to better indicate what it is doing.
* Switch the 1/8th block rendering to use `fill_rect` with math that is
  consistent with quad drawing to compute the bounds.

refs: dankamongmen/notcurses#1715 (comment)
@wez
Copy link

wez commented Jun 12, 2021

I just pushed a tweak to the half block rendering (really, all the 1/8th block rendering)

@dankamongmen
Copy link
Owner Author

sexblitter is now default in wezterm

2021-06-12-131547_960x650_scrot

yay!

@wez
Copy link

wez commented Jun 12, 2021

looks great!

@dankamongmen
Copy link
Owner Author

hrmmm, i'm thinking you might have one sextant off. i see sufficiently many strange regions (look around Montevideo, Rio de Jianaro, Washington DC and all its dread statism, Pretoria, Addis Ababa, etc.) that my autism meter goes to 10. i'll look into this and let you know whether there are truly any malformed glyphs.

@dankamongmen
Copy link
Owner Author

here's successive blitters in wezterm
2021-06-12-132521_960x650_scrot
2021-06-12-132535_960x650_scrot
2021-06-12-132543_960x650_scrot
2021-06-12-132550_960x650_scrot
2021-06-12-132555_960x650_scrot
2021-06-12-132610_960x650_scrot

definitely looks like we're one glyph off in the sextants. i'll lock this down.

@dankamongmen
Copy link
Owner Author

found the bad glyph! pr incoming

@dankamongmen dankamongmen added this to the 2.4.0 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants