Adapting OpenType code

Number3Pencils's picture


I'm finally in the coding stage of making my first really extensive font, including small caps, Russian and Greek (which will include polytonic). But I'm no OpenType codemaster. So in order to get my font to actually work, and do all the tricky little things like convert Turkish and polytonic Greek correctly to small caps, etc., I decided to use this strategy: I opened up a similarly extensive font that I have, and planted all my characters into it, so I could use code that was already proven.

But the ranges of glyphs don't match exactly, so I'm left with a bunch of code that applies to Vietnamese glyphs and such that don't exist in my font. So I have a few questions:

1. Is this whole strategy a dishonest thing to do? (I personally don't see it as stealing code—I look at it like this: the coders who came before me blazed the trail in figuring out the right way to code all this. I'm just repeating what they figured out, as if they'd discovered a useful math equation and I were employing it. But maybe this isn't the prevailing way to look at it in the type design community. That's what I want to know.) Or perhaps, is it an ill-fated strategy, where I'm bound to end up tangling myself up in a confusing mess?

2. If it's okay to proceed on my current path, is it possible in FontLab to delete a bunch of characters and, at the same time, delete all references to them in the font's OpenType features file? Because as it is, when I try to compile, FontLab insists on creating new copies of all the characters that I had just deleted, and won't compile if I tell it not to do that.

3. If I should really be doing this from scratch, can someone point me to a place where I can learn how to build my code from zero, and understand it, and have it do everything it needs to do in order to function as a professionally usable OpenType font?

Thanks a million!

agisaak's picture

Note that I'm hardly an expert in this area, but my gut feeling is that, while there's nothing wrong with studying other people's code to get an idea of how things are done, pasting your own glyphs over an existing font crosses a line -- even though you've removed the original glyphs you're still basing your work on a copyrighted file made be someone else.

An alternative which you might consider, though, would be to look at various fonts which have been released under OFL/GPL or some other variant of Open/Free software license. Some of these may even include .vfb or .fea files which would allow you to read their original code rather than FontLab's decompiled version thereof, and open licenses would probably allow you to use that code as a basis for your own code.

Let me reiterate that this is my 'gut-feeling' reaction rather than a legally or ethically informed opinion.


agisaak's picture

One other thing -- as I mentioned, studying other people's code to get an idea of how things are done seems OK to me, but the emphasis here is on the value which other people's code might have to you gaining an understanding of how OpenType coding works. The approach which you are suggesting in your post isn't one that's going to further your own understanding of the subject since you're essentially taking the entirety of someone else's code, deleting references to nonexistent glyphs, and then keeping your fingers crossed that everything's going to work properly for your glyph set. Without doing your own coding, you're not going to get a good feel for why people include the code they do and how it actually does what it's supposed to do.


Number3Pencils's picture

Okay, I see what you're saying. As regards not actually learning how to code for real, that's one thing I'd actually be okay with not knowing, if I could avoid it. Mainly because there are a lot more things that I'd rather do than sit at my computer writing hundreds or thousands of lines of code. If we continue my equation analogy, it's like saying I'm fine with using the quadratic equation even if I have no idea how to derive it. But I guess as a fontmaker, I'll have to learn this stuff anyhow... such is the life, huh?

So does anyone have a favorite starting point for learning how to write OpenType code that works? Or is the method basically to scrutinize other fonts' code and figure out what each line means, then do the same things myself?

Té Rowan's picture

If you haven't already, you'll want to take a long look at this forum. It's snippets galore, quite often with explanations. In addition, there's the Feature File Syntax list, something you definitely want to bookmark for further explanations. I think it's the Definitive Reference, btw.

Number3Pencils's picture

I guess I'll hit the Build for a while then. Reading the FFSL now; things are already starting to become clearer. Thanks!

filip blazek's picture

Hi, I can help you with the code, check We can discuss it individually.

Syndicate content Syndicate content