January 17th, 2017

Using San Francisco font in Swing applications on a Mac

Starting from OS X El Capitan (10.11), there’s a new default system font in town – San Francisco. And it came with a very big underlying change, as detailed by Craig Hockenberry:

Apple has started abstracting the idea of a system font: it doesn’t have a publicly exposed name. They’ve also stated that any private names are subject to change. These private names all begin with a period: the Ultralight face for San Francisco is named “.SFNSDisplay-Ultralight”. To determine this name, you need to dig around in the font instances returned by NSFont or UIFont; it’s not easy by design.

The motivation for this abstraction is so the operating system can make better choices on which face to use at a given weight. Apple is also working on font features, such as selectable “6” and “9” glyphs or non-monospaced numbers. It’s my guess that they’d like to bring these features to the web, as well.

Even though the underlying .otf files are still in /System/Library/Fonts, San Francisco is no longer exposed via the regular APIs that web and desktop developers have grown used to. Specifically for Swing developers (of which there may not be many, so at some point it will kind of take care of itself), passing “San Francisco” to the Font constructor ends up using the previous default – Lucida Grande.

JavaFX is already doing the right thing, using San Francisco as the default UI font on El Capitan and Sierra. Swing’s legacy is to have each look-and-feel decide which font to use, and I was expecting the “System” look-and-feel which maps to Aqua to be using the right font family on the latest OS releases. That is not the case as I’m writing this entry, and Swing apps on both El Capitan and Sierra are still using Lucida Grande on both 8u112 and 9-ea.

Last week Phil Race pointed me to this issue that tracked syncing up the internal implementation details of glyph mapping between JavaFX and AWT. That issue has been fixed in early access builds of JDK 9, and is slated to be available in JDK 8 u152 scheduled for October 2017. At the present moment there is no public API to get either a name or a font instance itself that will be mapped to Lucida Grande on 10.10 and earlier, and to San Francisco on 10.11 and 10.12. The only available solution is quite brittle as it depends on the internal naming conventions exposed by the underlying OS:

  • .Helvetica Neue DeskInterface on El Capitan (10.11)
  • .SF NS Text on Sierra (10.12)

Note that you need a leading dot in both cases, and that this only works on early access builds of JDK 9 at the moment:

In this screenshot the second button is using new Font(“.SF NS Text”, Font.PLAIN, 24) while the rest are rendered with Lucida Grande. The most noticeable differences are in the curvy strokes of “e”, “g”, “5” and “9”, as well as the straight leg of “a”.

Ideally, there’d be an officially supported way to use the right font on OS X / macOS, either in a form on some kind of a static Font API or a synthetic font family that maps to the underlying system font on all supported platforms. Phil has filed a bug to track the progress on that front.

January 10th, 2017

Daydreaming

Sometimes, as my laptop’s fans kick in during a particularly long build, I find myself gazing away from the screen, letting my eyes roam around my desk, losing their focus and slipping into daydreaming.

I find myself thinking about how, just twenty short years ago, one of the obviously expected cables sneaking their way into one of the oversized ports was the bulky Ethernet monstrosity. I think about how seamless and pervasive WiFi has become in my daily life, and how unremarkably smooth that transition has been. Unlike, say, a variety of clunkily unreliable wireless keyboards and mice that I’ve tried over the years. Every laptop that I’ve had in the last decade, at work and at home, always had a wonderfully ungainly cable snaking around, connected to my trusty companion, a two-button mouse. As unremarkable and as ever-present as its eponymous rodent friend.

Despite the soothingly persistent promises of all-day battery life, if I don’t plug my laptop into a nearby power outlet, it can barely plow through playing a two hour 1080p movie. Or doing about an hour of edit-compile-deploy-debug cycles. Or pretty much anything that is not browsing Craigslist. And sometimes, you have to use the right power adapter because some of them do not give you enough juice to even keep up with those long build breaks that happen every now and then. I don’t know if I should laugh or cry. Or maybe both at the same time. So there’s another, slightly less ungainly cable, snaking around. They say color white elevates any hardware design. So I guess it has to be not as ungainly.

I once lost about half a day trying to configure a wireless printer to actually behave as it so boldly promised on its box. To be wireless. It’s there now, in my basement. Snaking around yet another ungainly cable into my laptop. Actually strike that. There are not even enough ports in my laptop for that. So now there’s a box that sits right next to my laptop, with Tron-esque blue LED lights for each plugged cable that indicate that yes, everything that is connected is indeed that. Connected.

If Bluetooth were running in 2016 presidential elections in US, it might prove a very formidable post-truth opponent to our president elect. This time is for real, the working group promises me every time they release a new major version of their spec. This time is for real, whispers the little ghost that calls itself the desktop variant of Linux. Wait, is this for real, whispers Leonardo Di Caprio hearing his name at 2016 Oscars. So there goes another cable sneaking into my laptop, pumping the soothing melodies of Americana folk into my ears.

I watch yet another futuristic video from yet another company that decided to spend some money on exploring the wild. Every surface is screen. Every surface is input. People are congregating around tables, playing some kind of air hockey with rectangles of data. It looks like they are having fun. At work. How rude.

And I find myself daydreaming. That I come to work and I don’t need to wave my badge to tell the system that it’s me. Because when I come back home, my kids know that it’s me. Without me typing in my 20-character long password with at least three special characters in the middle and then telling them some random piece of secret information. So random that you would probably be able to find it in five minutes or so if you knew where to look on one of the social networks.

I daydream that anything I place on my desk gets charged without me having to put it in just the right spot and then do mental gymnastics on what’s the next piece of hardware that gets to be charged to make it through the day. I daydream that I don’t have a single cable on my desk. Around my desk. Or under my desk. I daydream that if the mythical they were able to do that to the network and make it almost as reliable as the slowly dying landline phone network, they can surely do that to the rest of the things that make a computer what it is today. This time is for real, whisper the shadow apparitions from the just-concluded CES.

I daydream of watching a sci-fi movie with an iPod, a phone and an Internet communicator that doesn’t show any signal strength indicator or any battery indicator. Because those are always on and at full value. Because it gets boring after a while to see that your signal is at five bars and your battery is at 100%. Wouldn’t that be something? When something becomes so ubiquitous that you tell these stories to your kids and they roll their eyes and say, sure pops, you stood in a line for two hours just to buy ten rolls of toilet paper. But wait, I tell them, that was actually a thing. Sometimes you joined a line and waited without knowing what was on the other side. Because that’s what you do. Sure pops, they say.

And then the silence settles in. The fans are not spinning anymore. The build is done. I should probably get back to work. I gaze at the cables. They have been my people for a long time now. I have boxes of them in my basement office. I never throw away a cable. You never know when you might need one. You never know.

January 9th, 2017

Cinematography of “Crimson Peak” – interview with Dan Laustsen

Continuing the ongoing series of interviews with creative artists working on various aspects of movie and TV productions, it is my pleasure to welcome Dan Laustsen. In this interview we talk about Dan’s work on one of the most visually striking films of 2016, “Crimson Peak”, as well as about the transition from film to digital, different ways to convey suspense and horror, minimizing disruptions on set for the actors, and the magic of making films.


Dan Laustsen on the set of “John Wick: Chapter 2”. Photography by Niko Tavernise.

Kirill: Please tell us about yourself and your path so far.

Dan: I was born and educated in Denmark. I studied set photography, and when I was 21, I was bored with it. At that time I went to the Danish Film School to study cinematography. I’ve spent three years there, and after graduating started working on my first feature film straight away at the age of 25.  Nobody in my family has anything to do with filmmaking, but I am very happy about being here.

Kirill: Has much changed for you in your field over the years?

Dan: Telling a story is the most important thing that we do. That’s the basis of everything that you do. You work with the script and you paint with light.

In the old days we shot everything on film, and things are getting faster and faster now. The equipment is getting better. At the beginning of it I was against digital. I didn’t like the look, but that has changed after a while. We did “Crimson Peak” on digital, and I was very pleased with the look. Alexa is doing a fantastic job with its cameras.

It’s easier to see what you’re doing. In the old days you had the magic of capturing the image on camera, and that’s disappearing. It’s a shame because you were not totally sure how it was going to be, and you had to wait for the lab to process dailies. All that disappeared, but I’m not afraid of that. It works fantastic and helps with what we do, which is to tell a story in the way we want to.

The lenses are getting better, and I’m very much for that high quality that it brings to cinematographers. I don’t go for old-fashioned lenses. I’m using the high-end equipment as much as I can.

Kirill: While that magic is gone, on the other hand everybody can immediately see what the camera sees. That must be creating a tighter feedback loop for fixing whatever issues crop up on the set.

Dan: For sure, and that’s good. Everybody has opinions, and I think the most important part is for the director and the cinematographer to work together. Everybody on the crew works together, and it’s much easier now. We have high-quality video monitors on the set, and everybody can see small mistakes and fix them right away. But the magic of movie-making has disappeared. It is what it is, and I think it’s helping everybody.

Kirill: Do you think it’s becoming easier for people to get into your field, as the equipment for shooting and editing is becoming cheaper and more widely accessible?

Dan: I’m sure it is. You can shoot with an iPhone or a small camera. Everything is about the story, and it’s much easier to tell those stories now for younger directors. You don’t need to spend a lot of money on labs, for example. You don’t have to be afraid of anything any more, and that gives a big push to everybody.

Kirill: What makes people still go with film as a medium?

Dan: You’ll have to ask somebody who is still shooting on film. People are shooting on 70mm, and the quality is amazing. For me personally, digital is doing a fantastic job. You can get a bit nostalgic about it. I’ve shot feature films on 45mm, and I was very much against digital at the beginning. But what we’re getting now from digital is fantastic in my opinion.

You still have to light the scene to tell the story in the right way. What I like about making movies these days is that there are no rules. You can do whatever you would like to. In the old days you had so many rules about what you could and could not do, about lines that you could not cross. All those rules have disappeared and that’s so good. You can tell a story in exactly the way you want.

Continue reading »

December 28th, 2016

Vector icons, going into 2017

About five years ago I wrote about vector format, and how it is not quite well suited to be used for application icons. Five years is a long time in our industry, and the things have changed quite dramatically since then. That post was written when pretty much all application icons looked like this:

Some of these rich visuals are still around. In fact, the last three icons are taken from the latest releases of Gemini, Kaleidoscope and Transmit desktop Mac apps. However, the tide of flat / minimalistic design that swept the mobile platforms in the last few years has not spared the desktop. Eli Schiff is probably the most vocal critic of the shift away from the richness of skeuomorphic designs, showing quite a few examples of this trend here and here.

Indeed it’s a rare thing to see multi-colored textured icons inside apps these days. On my Mac laptop the only two holdouts are Soulver and MarsEdit. The rest have moved on to much simpler monochromatic icons that are predominantly using simple shapes and a few line strokes. Here is Adobe Acrobat’s toolbar:

and Evernote:

This is Slack:

and Bear:

Line icons are dominating the UI of the web developer tools of Firefox:

They also have found their way to the web sites. Here is Feedly:

and Wikipedia’s visual editor:

You can also see this style on Airbnb listing pages (with a somewhat misbalanced amenities list):

and, to a smaller extent, on other websites such as Apple’s:

Google’s Material design places heavy emphasis on simple, clean icons:

They can be easily tinted to conform to the brand guidelines of the specific app, and lend themselves quite easily to beautiful animations. And, needless to say, the vector format is a perfect match to encode the visuals of such icons.

Trends come and go, and I wouldn’t recommend making bold predictions on how things will look like in another five years. For now, vector format has defied the predictions I’ve laid out in 2011 (even though I’ve ended that post by giving myself a way out). And, at least for now, vector format is the cool new kid.