Fork me on GitHub
#membrane-term
<
2021-11-04
>
lread19:11:44

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.

phronmophobic19:11:26

yea, I've seen that one

lread19:11:47

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

phronmophobic19:11:19

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

phronmophobic19:11:33

or if they do, they only expose a subset

lread19:11:11

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

phronmophobic19:11:49

I would say anytime you care about layout and text

phronmophobic19:11:17

there are lots of "inner platform" work arounds

phronmophobic19:11:17

I hadn't though about large glyphs in term.

lread19:11:37

I mean look at the size of this beast!

lread19:11:46

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

lread19:11:44

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

lread19:11:46

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

🤷 1
simple_smile 1
lread19:11:26

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

😆 1
phronmophobic19:11:24

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

lread19:11:13

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

lread19:11:09

A link in the README might help.

phronmophobic19:11:40

ok, I'll add one!

👍 1
lread19:11:11

Haha! Lured another member!

🎉 3
lread21:11:19

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

phronmophobic21:11:10

for membrane itself?

phronmophobic21:11:04

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

phronmophobic21:11:51

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

lread21:11:03

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

lread21:11:21

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.

lread21:11:26

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

phronmophobic21:11:52

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

phronmophobic21:11:02

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

phronmophobic21:11:38

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

phronmophobic21:11:01

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?

phronmophobic21:11:12

there is a #membrane channel as well

lread21:11:41

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.

phronmophobic21:11:02

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

phronmophobic21:11:26

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

phronmophobic21:11:38

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

lread21:11:53

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?

lread21:11:51

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

phronmophobic21:11:06

it could be, yea

phronmophobic21:11:43

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

phronmophobic21:11:52

yep, that looks wrong

lread21:11:04

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.

lread21:11:27

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.

phronmophobic21:11:22

yea, another option is to try the bindings in skija

phronmophobic21:11:43

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

phronmophobic21:11:58

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

lread21:11:53

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

phronmophobic21:11:08

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

phronmophobic21:11:12

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

phronmophobic21:11:37

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

lread21:11:15

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

🎉 1
phronmophobic21:11:00

> 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

lread21:11:50

Ha! Well, at least they started the effort!

phronmophobic21:11:52

yea, it's always good to see things moving

phronmophobic21:11:18

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

phronmophobic21:11:24

maybe they noticed it

phronmophobic21:11:33

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

phronmophobic21:11:20

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