Wednesday, 11 April 2018

Initial Text Support in Omber

I obviously use Omber for all my vector drawing needs. There's been a couple of times where I've had to make some graphics with some text in it though, and I had to use another tool because Omber didn't support text. I've also noticed that a lot of designers use vector drawing tools for making UI mock-ups, which also requires text support. So I decided to add some basic text support to Omber.

I was a bit torn about implementing it. A long time ago, when I was an intern at Sonic Foundry, one piece of advice they often gave was that if you can't implement a feature in an outstanding way, then don't bother implementing it. Reviewers and other users will see that one mediocre piece of the whole application, and instead of seeing it as a useful, free addition to the program for cost-conscious users who can't afford to buy another program just for that functionality, they'll instead seize on it as a weakness of the application that makes it inferior to others. This is especially true with Omber. Omber is a vector drawing tool for making drawings with advanced gradients and subtle shading. There are other vector drawing tools that are better for general purpose vector drawing tasks. If you need to make art with crazy gradients, then Omber is the better tool by far. I would argue that it even rivals tools like Illustrator. By adding text support, I would be making Omber look more like a conventional general purpose vector drawing tool, and users might get confused and think that it's worse than other programs when it's actually just used for different purposes. Would it be better for me to double-down, forget the text, and spend my time making the gradient support even stronger? In the end, I became annoyed that there are apps that are more popular than Omber but which are far worse than Omber at general purpose vector drawing tasks except that they support text, so I decided to spend some time implementing text to see what would happen.

It took me about a month and a half to implement very basic text support in Omber. Text support is a little strange in that it can be very quick and easy to implement or very long and hard to implement depending on what features you eventually want your text support to have. For example, if you only want to support English text in a text box and if you don't care if text is rendered slightly differently on different platforms, then you can just use the existing text input widgets and text drawing code to quickly implement support for that. Proper support for international text might involve huge lookup tables that would be too hard to download for a web app and custom text editing code while proper support for text transformations and kerning likely requires a custom font rendering engine.

In the end, I wanted to have the most flexibility in the underlying engine as possible, so I opted to do all the font rendering and display in Omber. This means that text in Omber will initially have fewer features and be rendered with lower quality than in other programs, but it will have consistent font rendering across platforms and the power to eventually have more interesting text effects. Right now, font rendering at small sizes isn't great, and very, very thin fonts don't quite render correctly, but with a custom font engine, I have a lot of knobs I can turn to improve things over time.

One surprisingly time-consuming aspect of doing your own font rendering is actually in font enumeration: finding out what fonts are on a system. Different platforms have different ways of listing their fonts and getting at font data, and often the documentation on them often isn't great or they use some ancient legacy approach to categorizing fonts that's really complicated. In many cases, the font information provided by the operating system isn't very good, so you have to open the font file yourself and read out extra information about the font directly. Then there's Android which doesn't even provide a way to find out what fonts are on a phone, so you just have to search around the filesystem for font files.

So in the end, I do have basic text support working in Omber. You can make some drawings with some simple text in them! Right now, I'm trying to figure out what to work on next: adding more features to the text support, better support for non-Western languages, improving the workflow for gradients some more, printing support, or something else entirely.

No comments:

Post a comment