Hacker Newsnew | past | comments | ask | show | jobs | submit | rezmason's commentslogin

Were fonts always able to do "texture healing"? Has no one tried this before?

“Texture healing works by finding each pair of adjacent characters where one wants more space, and one has too much. Narrow characters are swapped for ones that cede some of their whitespace, and wider characters are swapped for ones that extend to the very edge of their box. This swapping is powered by an OpenType feature called “contextual alternates,” which is widely supported by both operating systems and browser engines.

Contextual alternates are normally used for certain scripts, like Arabic, where the shape of each glyph depends on the surrounding glyphs. And they are also used for cursive handwriting fonts where the stroke of the “pen” might have different connection points across letters. Texture healing is a novel application of this technology to code.”


Always able to do it? Yes. Even before OpenType alternates, the extended ligature support in TeX 3.x would have also allowed for this sort of thing.

Why has no one tried it before? Because (a) nobody thought of it and (2) OpenType alternates, while they’ve been around for a while, have not always been supported in the sorts of programs that use monospace fonts (code editors and terminals)


There have been other attempts; Commit Mono uses a slightly different approach: https://commitmono.com/ (don’t know which came first)

Over time I must have spent several dozen hours looking into fonts, but I somehow always end up sticking to Menlo which looks just right to me. But this one looks really good ! I will give it a spin, thanks for sharing.

Similar boat. Have you test-driven Andale Mono?

In the comparator page of Commit Mono, Menlo tracks wider than Commit Mono et al., which I prefer for fastest reading.

(And CommitMono looks to be a deserifed and thinned Google Sans Code, which now I think about it, is odd to have serifs...)


Fonts are software. You can program them such that any two letters beside another can render uniquely. This is most common with ligatures like (e.g. fi -> fi) but also, say, swapping a colon from baseline oriented to centered if between 2 numbers, and so on.

>Has no one tried this before?

This is a great execution of a very common font practice.


It really only makes sense on high-DPI displays (or large font sizes), which didn’t used to be that wide-spread.

Conversely, nobody seems to be doing pixel-based hinting anymore, which is why all newer fonts tend to look terrible at small font sizes on lower-DPI displays.


In case anyone's wondering, this website's syntax highlighting color scheme is called "gruvbox", which I quite like but took an embarrassingly long time to track down

https://github.com/morhetz/gruvbox


I have been seeing this theme trending a lot lately, it’s so good

Recently I am using a variation that looks like gruvbox a bit but has some tweaks to it https://marketplace.visualstudio.com/items?itemName=hrose.am...


Gruvbox is oooollld, at least from my recollection. Been around at least since I started using vim maybe 15 years ago.

Any idea what the website's built with? I really like the design/UI tbh

As the sibling comment mentions, it's Astro:

https://github.com/videojs/v10/tree/main/site


Looks cool, reminds of a VHS box. Also nails the look of 70s decor that was everywhere when I was growing up in the 80s/90s.

The HTML generator meta tag (f11 to open dev tools) says it's Astro: https://astro.build/

A seldom appreciated benefit of gruvbox: like vim binds, it's available everywhere. If it has a theming system, somebody ported gruvbox to it.

this the theme I use on my i3 setup - it has some nice vibe from when terminal would be weirdly orange

it's also available in vscode

Since Apple turns 50 this year, I went looking for a graphic that symbolizes what I always liked about Apple and the Mac, without implying I condone anything I dislike about them.

Here's my vector reproduction of the logo for MacAddict's and Guy Kawasaki's "EvangeList", circa 1997 :

https://rezmason.net/evangelist.svg


It begins!


We also typically value things that are not tied to productivity/output, like product quality/reliability, security, and our own agency.

I want to be free to read, write, run, and share code, now and in the future. Relying on centralized services to do it for me (by extracting knowledge from countless other people) is certainly not a resilient strategy.


This article's from 2021. Does anyone know if there are elements (no pun intended) of this classification of element origins that's impacted by those JWST observations of complex early galaxies?



Also s4nake, the concept in a 4k binary from the demoscene circa 2013

https://www.pouet.net/prod.php?which=61035


Oh yeah! I was playing MacSwear quite a bit on my friends MacBook (I think with a PowerPC CPU)


I contributed one earlier this year! The community's a great bunch and I learned a lot.

Always remember, folks: the best feature request is a pull request ;)


base64 is embarrassingly parallel. So just pipe it to the GPU:

  precision highp float;
  uniform vec2 size;
  uniform sampler2D src,tab;
  void main(){
    vec4 a=(gl_FragCoord-.5)*3.,i=vec4(0,1,2,0)+a.y*size.x+a.x,y=floor(i/size.x),x=i-y*size.x;
    #define s(n)texture2D(src,vec2(x[n],y[n])/size)[0]
    #define e(n)texture2D(tab,vec2(a[n],0))[0]
    a=vec4(s(0),s(1),s(2),0)*255.*pow(vec4(2),-vec4(2,4,6,0)),a=fract(a).wxyz+floor(a)/64.,gl_FragColor=vec4(e(0),e(1),e(2),e(3));
  }


HN user: Ah yes let me casually scribble down a tweet-sized base64 encoder that runs parallel on GPU.

Bravo, that is a thing of beauty.


Uhhh no, it's a huge net loss because the cost of sending it to the GPU and back greatly exceeds the cost of just doing it then and there in CPU; even on iGPU the kernel launch latency etc will kill it, and that's assuming the kernel build is free. Not to mention this is doing pow calls (!!), which is so ridiculous it makes me wonder if this was a kneejerk AI prompt.

Another post in this thread mentioned V8 sped this up by removing a buffer copy; this is adding two buffer copies, each about an order of magnitude slower.

Come on guys...


Don't make me upload my web-browser-in-a-GLSL-shader snippet


Uhhh, go for it? You're welcome to link anything you like of course, but do you maybe want to address my actual points if you have any objections? Let's do some measurements, it sounds like you might be surprised by the outcome.

Web browser in a shader also sounds extremely inefficient, for obvious fundamental reasons.


Sorry, I was cracking a joke about the browser in a shader.

The GLSL I originally posted is from the "cursed mode" of my side project, and I use it to produce a data URI of every frame, 15 times per second, as a twisted homage to old hardware. (No, I didn't use AI :P )

https://github.com/Rezmason/excel_97_egg

That said, is `pow(vec4(2),-vec4(2,4,6,0))` really so bad? I figured it'd be replaced with `vec4(0.25, 0.0625, 0.015625, 1.0)`.


There goes my evening.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: