membrane-term

lread 2021-11-04T19:01:44.046200Z

I’m still doing a bit of playing with nerd font glyphs. Lots of “huh?” and “but…” and “why?…” and “oh…” and “ugh…” etc. Stumbled on a pretty cool Glyph Inspector: https://opentype.js.org/glyph-inspector.html if you are into that kind of thing.

phronmophobic 2021-11-04T19:02:26.046600Z

yea, I've seen that one

phronmophobic 2021-11-04T19:03:11.047700Z

I actually use it for membrane's web graphics backend, https://github.com/phronmophobic/membrane/blob/master/src/deps.cljs#L1

lread 2021-11-04T19:03:24.048Z

Huh!

lread 2021-11-04T19:03:31.048200Z

Cool!

lread 2021-11-04T19:03:47.048700Z

My current understanding is that glyphs can exceed lineheight (and advance width) and terminals take various approaches to deal with this.

phronmophobic 2021-11-04T19:04:19.049200Z

it's pretty strange to me that most UI frameworks don't expose font information anywhere even though it's required for rendering

phronmophobic 2021-11-04T19:04:33.049500Z

or if they do, they only expose a subset

lread 2021-11-04T19:05:11.050Z

yeah, it is certainly essential info - at least for certain use cases!

phronmophobic 2021-11-04T19:05:49.050300Z

I would say anytime you care about layout and text

phronmophobic 2021-11-04T19:06:17.051Z

there are lots of "inner platform" work arounds

phronmophobic 2021-11-04T19:07:17.051700Z

I hadn't though about large glyphs in term.

lread 2021-11-04T19:07:37.052100Z

I mean look at the size of this beast!

lread 2021-11-04T19:08:46.053400Z

I think some terminals try to scale down the large glyphs to line height and advance width.

lread 2021-11-04T19:11:44.055100Z

Looking at nerd font glyphs used in fancy terminal prompts, I find it strange that they aren’t already scaled to appropriately.

lread 2021-11-04T19:12:46.056100Z

I mean… they were created for terminal use I think… why not scale them to line height in the font itself?

🤷 1
1
lread 2021-11-04T19:15:31.057300Z

(BTW, the above are from https://github.com/romkatv/powerlevel10k/blob/master/font.md)

lread 2021-11-04T19:16:26.058Z

(more people should join this channel, it is very entertaining)

😆 1
phronmophobic 2021-11-04T19:18:24.058600Z

there's a place to announce new channels, but I don't remember which channel that is

lread 2021-11-04T19:21:13.059300Z

There’s #new-channels but not many people are members…

lread 2021-11-04T19:22:09.060200Z

A link in the README might help.

phronmophobic 2021-11-04T19:22:40.060400Z

ok, I'll add one!

👍 1
borkdude 2021-11-04T19:43:39.061100Z

@borkdude has joined the channel

👋 3
lread 2021-11-04T19:44:11.061500Z

Haha! Lured another member!

🎉 3
lread 2021-11-04T21:01:19.063500Z

@smith.adriane, do you have any dev setup docs if I want to do a little REPLing in membrane?

phronmophobic 2021-11-04T21:02:10.063800Z

for membrane itself?

lread 2021-11-04T21:02:27.064Z

Ya

phronmophobic 2021-11-04T21:03:04.064300Z

I don't, but I'm not actually sure what should be in there

phronmophobic 2021-11-04T21:03:51.065Z

what kind of docs do you think would be useful? a walk-through of my workflow?

lread 2021-11-04T21:06:03.066400Z

Ya maybe a docs/dev.md with enough info of how to get setup after cloning the git repo.

lread 2021-11-04T21:07:21.067700Z

Like I see csource do I need to compile that? How should I do that? I see java source, how do I compile that. etc.

phronmophobic 2021-11-04T21:07:50.068200Z

ah ok

lread 2021-11-04T21:08:26.069Z

I do see scripts but they are to be run from CI only I think.

phronmophobic 2021-11-04T21:08:52.069500Z

right now, you just need lein javac to compile the java file

phronmophobic 2021-11-04T21:10:02.070400Z

if you're going to use membrane.skia, you just need one of the skialib dependencies

phronmophobic 2021-11-04T21:10:38.071Z

that should be taken care for lein, but you'll need the :skialib alias for clj

phronmophobic 2021-11-04T21:12:01.072100Z

Nobody has really expressed interest in dev, but I can improve that documentation if you are. Are you interested in also hacking on the skialib part, membrane itself, or both?

phronmophobic 2021-11-04T21:12:12.072400Z

there is a #membrane channel as well

lread 2021-11-04T21:14:41.073500Z

Yeah, just exploring the workings and trying to see what font/text size info I can access. Also wanted to explore if I maybe found a bug.

phronmophobic 2021-11-04T21:16:02.074300Z

I assume you're referring to the skialib backend, which would require recompiling skialib to test changes

phronmophobic 2021-11-04T21:16:26.074900Z

the membrane.ui namespace is the "what" and the various backends are the "how"

phronmophobic 2021-11-04T21:17:38.076100Z

similar to clojure, each platform should "match" the others, but exact duplication is a non-goal

lread 2021-11-04T21:18:53.076700Z

Maybe eventually. But right now I was wondering about the translation back from skia for font metrics. https://github.com/phronmophobic/membrane/blob/f99efeb2a09170c5abf7a7db1b7b1c4c803eb8a6/src/membrane/skia.clj#L688-L693?

lread 2021-11-04T21:19:51.077600Z

In the skia source (which I don’t know how to link to yet) that flag is kBoundsInvalidFlag

phronmophobic 2021-11-04T21:20:06.077800Z

it could be, yea

phronmophobic 2021-11-04T21:20:43.078100Z

;;     kBoundsInvalid_Flag             = 1 << 4, //!< set if fTop, fBottom, fXMin, fXMax invalid

phronmophobic 2021-11-04T21:20:52.078400Z

yep, that looks wrong

lread 2021-11-04T21:22:04.079600Z

I’m not sure what I’d do with fTop fBottom fXMin fXMax, tho… was just curious what those values might be for nerd font I am testing against. I think we’d still just use line height like other terminals seem to be doing.

lread 2021-11-04T21:23:27.080800Z

If I want to scale down glyphs, I’m also interested in learning their actual dimensions. I guess I could explore all of this kind of stuff directly in skia.

phronmophobic 2021-11-04T21:26:22.081100Z

yea, another option is to try the bindings in skija

phronmophobic 2021-11-04T21:26:43.081500Z

for skialib, I just try to create subset of necessary bindings

phronmophobic 2021-11-04T21:26:58.081800Z

skija is a full java wrapper for skia, https://github.com/JetBrains/skija/

lread 2021-11-04T21:28:53.082500Z

Yeah, that might be an easier way to play, thanks for the tip!

phronmophobic 2021-11-04T21:31:08.083Z

there is a skija backend. The main bummer is that it's not as repl friendly at the moment

phronmophobic 2021-11-04T21:32:12.083900Z

I believe the glfw integration that skija works with crashes if you try to open multiple windows

phronmophobic 2021-11-04T21:32:37.084400Z

I've been meaning to create my glfw bindings for use with skija to fix it

lread 2021-11-04T21:34:15.085900Z

Oh on another note: looks like pty4j is now on maven central: https://mvnrepository.com/artifact/org.jetbrains.pty4j/pty4j

🎉 1
phronmophobic 2021-11-04T21:38:00.086900Z

> Error building classpath. Could not find artifact org.jetbrains.pty4j:purejavacomm:jar:0.0.11.1 in central (https://repo1.maven.org/maven2/) Seems like it's still missing a dependency in maven

lread 2021-11-04T21:39:50.087200Z

Ha! Well, at least they started the effort!

phronmophobic 2021-11-04T21:40:52.087400Z

yea, it's always good to see things moving

phronmophobic 2021-11-04T21:41:18.087600Z

I see in the github issue that it was closed and then reopened

phronmophobic 2021-11-04T21:41:24.087800Z

maybe they noticed it

phronmophobic 2021-11-04T21:34:33.086200Z

membrane should actually be multiple libraries, but it's pretty difficult to find functional libraries that implement the different pieces necessary to make a UI

phronmophobic 2021-11-04T21:35:20.086800Z

I think https://github.com/phronmophobic/membrane/commit/c8862d3cbd3f4abc31911eb7820c325ce3b62e5b should fix the invalid flag issue. It will be available in the next release of membrane.

👍 1