Better HN
topnewbestaskshowjobs
Log inSign up

raphlinus

14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions

I do research on fundamental UI technology and 2D graphics, with a focus on Rust and fonts. @raph@mastodon.online
Submissions

comment 6y ago · link · parent

I can speak to this a little, in terms of pitches we made to management to get resources for our little project. None of this is authoritative.

1. A lot of text was rendered into PNGs, and that made the web less searchable, as well as less accessible, slower to load, and less mobile-friendly. All 4 of these factors do have economic impact at Google scale.

2. Fonts were one of the few features that Flash had that HTML5 was lacking, and we wanted to accelerate that transition. Again, mobile was one of the major driving factors.

3. For a while, we were organizationally funded under Google Docs. Again, fonts were one of the major missing features compared with Microsoft Office, so filling that gap was strategic. Here, our open source approach really paid off, otherwise dealing with proprietary font licensing in the context of documents that can be shared and copied would have been nightmarish.

4. To the extent that you are able to make the case that fonts make ads better (or advertisers happier), getting modest amounts of funding ceases to be a problem. To be clear, when I was on the team this was more of a glimmer of future abundant resources than day-to-day reality.

Lastly, while "charity" isn't exactly the right word, the motivations of the people working on the team are/were basically that we love fonts and want to make the Internet better. At Google scale, we were able to sell the project using basically a combination of the above arguments.

Never once when I was on the team were we asked to implement any form of individual user tracking, nor did I hear a suggestion of such a thing. All our work on collecting analytics was to improve performance and quantify our impact. I have no reason to believe things have changed on that front since I was directly involved.

comment 6y ago · link · parent

Heh, that's a better question. I have no reason to believe that Google Fonts are being used to track users, but I don't have hard evidence on this either way. I am deeply concerned about the way the modern Internet is turning into a surveillance machine and its potential for abuse, but if I were evil, I'd probably go after much lower hanging fruit than fonts.

comment 6y ago · link · parent

200 means it's hitting your cache and not doing any network requests. The analytics are based on actual HTTP requests. At the time I was there, we were only able to make rough guesses about the fraction of queries that were successful in the client cache, we didn't have any systematic way to dig into that.

comment 6y ago · link · parent

A coarse rule of thumb is that each axis doubles the font size. So one that has just a weight axis is twice a normal font. One with a weight and width axis is four times. So if you actually use multiple instances from the design space, it's a win.

This is only a rough guide, don't take it as gospel. I'm also researching ideas (radial basis function interpolation) to make it more sparse for larger numbers of dimensions.

comment 6y ago · link · parent

The latter.

comment 6y ago · link · parent

I was part of the team that founded this, about 10 years ago if memory serves. I'm still loosely involved, though no longer at Google. Inconsolata was one of the 20 fonts for the original launch, and we're now in the process of launching it as a variable font, with both width and weight axes. I'm also getting funding from them for Rust-based font tools.

Feel free to AMA, though no guarantees I'll have good answers.

comment 6y ago · link · parent

It's slightly more complicated than that. The `git` command line itself was done in shell. Initially, `git foo` just ran `git-foo-script`, and then those were also written in shell. But the actual sha1 and packfile stuff was always in C from the beginning.

Source: https://git.kernel.org/pub/scm/git/git.git/commit/git?h=v0.9...

comment 6y ago · link · parent

Windows is actually pretty good about doing incremental present, only writing the composited regions that have actually changed. But macOS is bad at this, so people have to fake it in ugly ways to reduce power consumption. It's especially bad when all you want to do is blink a cursor.

Whether apps make use of these capabilities are another question. It's pretty easy to get lazy and blat out the whole window every time, when you know the GPU can handle the pixel bandwidth, and things like imgui explicitly make this tradeoff to keep logic simple.

comment 6y ago · link · parent

Congrats, and best of luck on the new adventure.

One of my favorite bradfitz moments (and there were a number) was when I was on the spam and abuse team, and the two of us were talking about chat protocols, likely in the context of preventing spam, and he brought up XMPP. I asked what that was (I had known it simply as "Jabber") and he looked at me in wonderment that I didn't know that.

Livejournal, memcached, go, those are three hugely impactful things. Let the number continue to increase!

comment 6y ago · link · parent

What happens if you do the triangle distribution in sRGB space, derive the nonlinear system transfer function, then invert that (numerically)? The middle step is something like $t^{-1}(\sum_k p(c, k) t(k))$.

comment 6y ago · link · parent

Right, should have added that to the list of not-quite-consistent explanations. Also, slight typo, black level is 16 not 10.

And to this I'll add another speculative answer, similar to others that have been advanced, but I'm not sure it's ever been explicitly expressed: it means that a piecewise linear approximation in either direction can be done with good accuracy and not a huge number of segments.

comment 6y ago · link · parent

I have actually seen a lot of different explanations why the sRGB EOTF has a linear part, and can come up with a few more theories myself. In the Poynton FAQ, it says it "minimizes the effect of sensor noise in practical cameras and scanners". Wikipedia says "The purpose of the linear section is so the curve does not have an infinite slope at zero, which could cause numerical problems." Poynton's book Digital Video and HD: Algorithms and Interfaces talks about "veiling glare" and then says that the sRGB function almost perfectly inverts L* from the CIELAB color space (a pure 2.2 gamma would not do so). His thesis[1] goes into more detail.

One possible theory why there's a linear term is so that negative values are well-defined. In consumer HDMI, reference black is 10 (as opposed to 0 in sRGB), and reference white is 235 (as opposed to 255 in sRGB).

Since there no doubt be experts here, I'd love to see an authoritative answer. (I'm considering writing an explanation of sRGB and if so would really like to get this right)

[1]: http://poynton.ca/PDFs/Poynton-2018-PhD.pdf

comment 6y ago · link · parent

Well, there are many forms of distortion. When it comes to spacing in particular, yes, there are many people who are quite sensitive to it, others less so. You can Google "keming" for more information on that.

comment 6y ago · link · parent

I'm going to take a guess that this is mostly due to the use of Skia. I think the problem is not so much with the rendering of fonts (which is still likely DWrite) but with the compositing of them onto the canvas. There, it's extremely difficult to get gamma right.

I am sympathetic to this, as I've spent a lot of time at the low levels of this stuff. Unfortunately, one problem is that there is no one "right answer," and not really a lot of authoritative guidance on what's preferred. Some people prefer higher contrast, others prefer minimal distortion of the shapes and spacing. It's always a tradeoff.

comment 6y ago · link · parent

Thanks! I recently rewrote the box drawing character generation (in Rust) to support variable fonts, so outputs a very wide range of widths and weights.

comment 6y ago · link · parent

As someone who really wants to use this stuff, I just want mommy and daddy to stop fighting. I personally lean towards a SPIR-V approach for a number of reasons, including faster shader compilation and a more unified ecosystem. I also see the advantages of a high level text format, but feel like that could get polyfilled in 100k or so of wasm in the most important cases.

But it's clear that either approach can work. From what I'm seeing so far, flipping a coin and doing "disagree and commit" would be a healthier process than what's going on right now.

comment 6y ago · link · parent

There's one thing I'd add here, as advice to potential implementers of collaborative editing algorithms. Test the system rigorously, autogenerating concurrent workloads of all the operations (including undo), and also various delays. If this had been done early on, all the broken algorithms (some published with formal proofs of correctness!) would have been caught. A lot of the broken algorithms work under light loads - TP2 requires at least three concurrent edits, two inserts and one delete, to trigger.

comment 6y ago · link · parent

I am not an expert on this, but I suspect that the "diffuse reflection" picture is not telling the whole story here, as it shows reflections purely from the surface. From what I've seen, in most diffuse materials it's subsurface scattering that dominates. So I think the main contribution of wetness is that it decreases the internal scattering because the indices of refraction are more matched. The absorption remains similar, and I believe reflectance is mostly a function of the ratio of scattering to absorption (Kubelka-Munk theory).

comment 6y ago · link · parent

I'm sure it's just a coincidence that the filename extension matches the author's initials (Brian Fiete).

comment 6y ago · link · parent

It certainly does do this: https://rust.godbolt.org/z/ZaDAKa

Not just small constant powers either. I tried .powi(1000000) and it compiled into a sequence of 25 vmulss instructions.

comment 6y ago · link · parent

You'll probably find Tom Forsyth's blog on this to be interesting reading: https://tomforsyth1000.github.io/blog.wiki.html#%5B%5BWhy%20...

comment 6y ago · link · parent

I actually didn't read it, so can't really answer, sorry.

comment 6y ago · link · parent

I know he made some people angry, but I very much consider him one of the good people. So much so that I cited him by name (along with three others) in my goodbye letter as people I missed and whose departure signaled a change in culture.

BTW, I'm one of the main people quoted in this article, and feel it turned out pretty well. Feel free to ask me followup questions, though I don't guarantee answers.

comment 6y ago · link · parent

You're right. I tried to give this code a charitable read, but it's horrifically wrong, and not just the ADC, but seemingly all inputs here.

At least we now have a better sense of what an A grade from Codacy actually counts for.

comment 6y ago · link · parent

It's at heart a recursive bisection approach. See section 304 of "Metafont: the Program" in particular. But also keep in mind they're generating bilevel output (in which variants of Bresenham are effective), and today we're much more concerned with antialiased rendering.

comment 6y ago · link · parent

Counterpoint: I open sourced a lot of stuff while I was at Google. There is some friction in the open source releasing and IARC policies (one of my projects got denied), but generally the open source teams at Google want you to do good work. And having clear documentation of ownership is actually helpful; there's a lot of dodgy stuff out there where you're not sure who actually has the rights.

Contrast to Apple, where, aside from a few high profile open source projects that help drive their business (Webkit, Swift, llvm), open source contribution is quite discouraged. How many fun Apple side projects do you see on Github?

I really enjoy the freedom now of just being able to click "create repo" whenever I feel like it, and am sad about the corporatization of the world economy, but I think Google is doing about as well as you can expect here.

comment 6y ago · link · parent

In addition (and this is slightly offtopic to the lawsuit itself, apologies), aside from a few high profile open source projects like LLVM that help drive their business, the default is that Apple employees are not allowed to contribute to open source projects. This is why you see so few Apple contributors in open source projects. This is in sharp contrast to, say, Google, which actively encourages open source work in a number of ways. Making it relevant to the original topic, that's a fairly common path for people to bring technology out of the company. I'd personally argue that it's ethical, ethical, and of benefit to society. Whether companies think that such lenient approaches to open source benefit them apparently vary pretty widely from company to company.

comment 6y ago · link · parent

This is a talk I gave last week at the SF Rust meetup, and there's been a fair amount of interest in it. The slides are also available: https://drive.google.com/open?id=1fasP_7rIFZtThdigGYZfMz-tMK...

1379.

Declarative UI Patterns in Rust [video](youtu.be ↗)

2 points · by raphlinus · 6y ago · 1 comment

1
454647
63