Create metric-equivalent font

How can I create a font metrically-equivalent to a commercial TrueType font in a legal way? I don't need actual glyphs, just blank rectangles that will preserve the document layout.
What properties are important? Advance width, left side bearing, line spacing, kerning, something else?

Caladea and Carlito are metric-compatible with Cambria and Calibri. How they were created with the same metrics without violating the font license? My understanding is that you are not allowed to look at the font file, e.g. OS/2 table.
Tagged:
«1

Comments

  • Ori Ben-Dor
    Ori Ben-Dor Posts: 386
    edited July 2018
    First you need to have the same UPM (units per em).

    Then, in order to preserve the horizontal dimensions, you need each glyph to have the same width as the original (I see FontLab calls this "advance width", so yeah). You also need kerning to be the same. Note that kerning could be tricky, since the information could be stored across different tables and be language specific (and maybe some other parameters dependent as well). Also, there are mechanisms that affect horizontal spacing which aren't always considered kerning per se (diacritics positioning, etc.).

    Left side bearings don't play any role in this (well, I guess I can imagine a text rendering engine that ignores the left side bearing for the first glyph in a row, but that wouldn't be advisable, and I've never heard of such an engine, so I think it should be safe to change side bearings if needed). As long as the "advance width" remains the same, it shouldn't matter where the outline starts or ends. Compare for example regular and bold versions of the same fixed width font. Usually they'd have the same glyph width, but the bold outline would be wider and have smaller side bearings.

    In order to preserve the vertical dimensions, you'd probably want to keep all the metrics-related metadata exactly the same (different text rendering engines use different fields and interpret them differently). And even this might not be enough (some applications, at least in the past, used outlines in order to figure out the vertical spacing. I remember some version of Photoshop used the /d height, or something like that).

    >> My understanding is that you are not allowed to look at the font file, e.g. OS/2 table

    In order to use a font file you (or more precisely your OS and/or other applications) need to look at it, so a total ban on reading metadata wouldn't make much sense. You should read the license to see what you are and what you aren't allowed to do.
  • ivan louette
    ivan louette Posts: 327
    I think you are always allowed to look at the font file (otherwise it should be encrypted). Copying metrics is another thing. How close you may mimic them to fit close to the original font is an interesting question.
  • It is often claimed Times New Roman is "metrically compatible" with the original Type 1 Times – but looking deeper shows that is not true.

    The Microsoft version is a TTF at a design grid of 2048, while the original Times is at a traditional Type 1 grid of 1000 units. Therefore, careful inspection of text widths shows a difference; at regular text size, typically in the thousandths, but still. I had a lot of not-fun tracking this down to solve a minimal bug in a self-written typesetting tool, which happened to use Times (reading its sizes from its AFM) – and "Times" gets replaced silently with TNR by a lot of software.

    I wonder if this minimal difference is enough for a lawyer to claim "see? It's not a copy!"
  • The width is just a number. It is highly unlikely any court could enforce any kind of IP rights on the width which represents the space a glyph occupies. IANAL.

  • I'm thinking of rendering a document with a dummy metric-equivalent font and display it with a paid css font from monotype library subscription. The library subscription price is reasonable but the per server core price is unpractical if I want to cover all Windows fonts.

    A commercial font license usually prevent you from reverse engineering it. Isn't copying the metrics and glyph order from the font tables considered reverse engineering?

    I thought about printing all possible glyph pairs, scanning the document, tracing the fonts and calculating metrics and kerning but it's probably not practical.
  • Bhikkhu Pesala
    Bhikkhu Pesala Posts: 210
    edited July 2018
    I think trying to copyright the advance widths would be ridiculous. I am not so sure about the kerning data tables.

    To copy the metrics is very easy in FontCreator:

    1. Copy all 420 glyphs from Caladea to the clipboard
    2. Start a new font
    3. Add 184 glyphs to make 420
    4. Paste Special to copy everything except the glyph contours


  • Bhikkhu Pesala
    Bhikkhu Pesala Posts: 210
    edited July 2018
    In the case of Caladea, copying the (only) OpenType feature with the kerning table is also simple. There are no kerning classes, and only a Default script language.


  • I don't think I'm allowed to randomly copy parts of a commercial font. That's why I asked how Caladea and Carlito managed to do it.
  • Out of curiosity, what is the use case for such a font?
  • The use case is to convert a document to SVG on a server while preserving the exact same layout using a metric-equivalent free (dummy) fonts and than display the SVG in a browser with @font-face using the Monotype library Subscription.

    The Monotype library subscription price for displaying SVG with fonts in a browser is reasonable. The per server core license to convert a document to SVG with commercial fonts is too expensive for me.

    Is there a way to do it without violating commercial fonts license?

  • Jens Kutilek
    Jens Kutilek Posts: 364
    edited July 2018
    In addition to what @Ori Ben-Dor wrote, you would also need to mimick the behaviour of all OpenType layout features that change the advance width of glyphs, e.g. ligatures or stylistic sets, contextual alternates …

    How about building a variable font that doesn’t contain any data from the original font but happens to interpolate to a compatible instance? Just like this font doesn’t contain any Helvetica data ;)
  • @Ori Ben-Dor thank you for your detailed explanation.

    @Jens Kutilek I've read about variable fonts and I see it let you get variations by changing parameters. How do I choose the parameters to get a font which has the same metrics as other font?  How did you do with your font?
  • In this case there is no problem anyway. Caladea is released under an Open Source SIL license so you can copy the metrics and kerning data from that without any worries. You can even copy the glyph outlines. 
  • @Bhikkhu Pesala Caladea is an example of a font that is metrically equivalent to the commercial font Cambria. I'm interested to create a font which is metrically equivalent to other commercial fonts in the same way, only I'm not interested in the font outline.
  • Jens Kutilek
    Jens Kutilek Posts: 364
    FWIW, the creator of Calibri is not pleased that somebody copied his metrics. He considers them an integral part of the design work. He mentioned that in his talk at TypoLabs 2018.

    The approach using variable fonts would probably not practical and is just a way to disguise the copying of data. The principle (as I did with the Helvetica interpolation font) is that you subtract from a value (width or point coordinate) on one side of the variation axis, and add the same amount to the value on the other side of the axis. When the original value is deleted, the two modified values will always interpolate back to the original though physically it is not there anymore.
  • Thomas Phinney
    Thomas Phinney Posts: 2,899
    Metrics alone have not been considered to be protected as intellectual property anywhere, to date, as far as I know.

    Personally, I am OK with this. But not everyone is.

    That said, we have seen in the past with glyph shapes that there has certainly been a general tendency among most professional type designers and many foundries to treat certain things as if they were protected, whether or not that was true at the time—or perhaps true only in some jurisdictions.

    There are plenty of things that may be legal but are not necessarily ethical. I do not consider copying metrics of a system font to be in this category. But I don’t think those who consider it problematic are crazy, either.  :/

    Darn, this would be a great topic for a debate or panel discussion at a conference! I’m going to try to put something together.... and for once I would be happy just to be moderator.
  • Can one obtain the metrics without in some manner disassembling the computer code of a font? What about extraction of the metrics? Wouldn't that be reverse engineering?

    It is an interesting thought experiment. I personally only know a couple font authors. While I haven't asked them, I can pretty much guarantee they wouldn't take kindly to it, legal or not.

    I myself could care less about metrics because I really don't understand the whole issue in this thread. Unless the glyphs were of the exact proportions of whatever is going to hit the SVG, there will still be gaps/crowded glyphs in the final output. I think one would be truly lucky to have an exact representation unless one only was already using typefaces that were equal in those respects. And if one was using such typefaces, the whole point of the thread as I understand it is moot. I think. But like I said, I don't really understand the why of this inquiry. I've got a simple mind.
  • Bhikkhu Pesala
    Bhikkhu Pesala Posts: 210
    edited July 2018
    Here is an illustration of why I think it is not unethical to copy the glyph metrics of an existing font. 

    I have a Dell keyboard. Some of the keys are a bit worn, and I have reassigned some keys to behave as dead-keys, e.g. the underscore _ is a dead-key for typing glyphs with macron: āēīōū or ĀĒĪŌŪ. 

    Suppose a manufacturer sold replacement keys for keyboards. They would have to be the right size and have the right design to fit the keyboard. One would have to design the keys to make sure that they fitted the keyboard. Whether they measured the keys by taking them off one-by-one or from a photograph of the keyboard is irrelevant. 

    Any design patents or copyrights would pertain only to the internal workings of the keyboard, the design of the Dell logo, and the font used on the key tops, but not to the shape and size of the actual keys. 

    Similarly, if one receives a document for publication that uses a font with protective license restrictions, the only way to print it without reformatting it would be to use an OpenSource font with the same font metrics. 
  • If metrics were protected IP, I would be curious to understand how the font-fauxing behavior of Acrobat (used when fonts are not embedded) was not legally problematic.

    Among other things.
    I dunno. I'm just musing along with the thread and being that no one else is expressing themselves but us three on the issue, I'm playing devil's advocate.

    Maybe because it was never important to anyone to test the issue in court? Or, maybe because it's a non-issue to foundries? But does that then mean it is OK to open a font to obtain a font's metrics or otherwise export those metrics that has a license that effectively says "Thou shall not dissemble me."

    But my question(s) above are legitimate—aside from the PDF issue—just how does one obtain the metrics without violating a license that is not some flavor of OpenSource license?
  • Jens Kutilek
    Jens Kutilek Posts: 364

    A commercial font license usually prevent you from reverse engineering it. Isn't copying the metrics and glyph order from the font tables considered reverse engineering?
    I’m not a lawyer, but as reading the horizontal metrics information from a font is essential to be use it for any typesetting, I’m not sure it can be considered reverse engineering.
  • George Thomas
    George Thomas Posts: 649
    edited July 2018
    Isn't copying the metrics and glyph order from the font tables considered reverse engineering?

    Just my opinion: I don't think so. I think in the case of the fonts that would only apply to the outlines.

    In terms of what is being referred to as "metrics", I'm only considering advance width and kerning in my definition given the nature of the question, i.e. how to preserve the document layout using rectangles without violating someone's IP rights. So no other information applies except for the UPM.

    If one is concerned that the advance width of a given character in a font is protected by IP law, then think back to the days of metal type. Of all the hundreds of designs produced in metal since the early 1800's, had such a law applied, then it seems to me there could have been only one advance width of any particular character in a given size, regardless of design, which if protected could only be used by the foundry that owned that width unless they licensed the use of that width. All of the possible widths would have been used up in a hurry which could have proven very profitable for the foundries.

    In the hundreds of years metal has been produced there has never been an application by any entity to patent, register or otherwise seek protection for a character width -- with the possible exception of a specialized case -- because it is not protectable. It is just a set of numbers.

    The same would apply to kerning, and additional things could be said about tracking.

    Adobe used to make publicly available advance width and kerning information for their fonts. While the document may have been copyrighted, that was the only protection.

    I can't see a problem with what you are wanting to do.


  • Thomas Phinney
    Thomas Phinney Posts: 2,899

    If one is concerned that the advance width of a given character in a font is protected by IP law, then think back to the days of metal type. Of all the hundreds of designs produced in metal since the early 1800's, had such a law applied, then it seems to me there could have been only one advance width of any particular character in a given size, regardless of design, which if protected could only be used by the foundry that owned that width unless they licensed the use of that width. All of the possible widths would have been used up in a hurry which could have proven very profitable for the foundries.

    In the hundreds of years metal has been produced there has never been an application by any entity to patent, register or otherwise seek protection for a character width -- with the possible exception of a specialized case -- because it is not protectable. It is just a set of numbers.



    There is a difference between the collection of advance widths for an entire font (including the pattern or scheme created by them), and any single individual advance width. To apply your argument to writing and text would lead you to argue that one can’t reasonably copyright an entire written work, because copyright on an individual letter would be silly. Or to argue somebody can’t copyright a tune, because copyright on a single note would be silly. Copyright doesn’t work that way. Just because something can be protected by copyright does not imply that its simplest conceivable atomic element can be. Yes, this means there will be borderline cases. (Note: I am not arguing that font metrics are protectable, or ought to be. Just saying this one particular argument is faulty.)
  • The use case is to convert a document to SVG on a server while preserving the exact same layout using a metric-equivalent free (dummy) fonts and than display the SVG in a browser with @font-face using the Monotype library Subscription.

    The Monotype library subscription price for displaying SVG with fonts in a browser is reasonable. The per server core license to convert a document to SVG with commercial fonts is too expensive for me.

    Is there a way to do it without violating commercial fonts license?

    So you scan in a document to extract the text (and it's formatting) and then want to render this document not as a file generated on the server, but as a web page rendered with webfonts?

    If this is correct, why would you need the server document at all as a document you generate server side? If a user needs to access the original document with the original font instead of the website render, you can let them download either the original document or the vectorized version, neither of which you should need font licenses for.

    The question in and of itself is interesting, too. I am unsure if I either don't understand your problem or if there's aspects to it that complicate things further beyond the obvious.
  • George Thomas
    George Thomas Posts: 649
    edited July 2018
    @Thomas Phinney -- My opinion above is intended to apply only to the question of fair use of the metrics of any given font, and I tried to make that clear. I did not intend or imply that it would apply to any other thing.
  • Dave Crossland
    Dave Crossland Posts: 1,431
    Personal opinion only, not legal advice, not views of my employer or any other entity:

    My understand is that in the usa, copyright monopoly won't adhere in mechanical functionality; that kind of work is not recognized by courts under the Berne convention as a work of authorship; it's possible you could apply and be granted a patent monopoly on a mechanism, though. 

    The use of copyright monopoly for preventing competition in supplying replacement parts was tested in the USA courts by IBM, in the 70s, as I recall; they tried to make a claim based on asserting copyright adhered in a computer circuit board slot design (like an pci/isa slot in a 90s PC) to prevent 3rd parties making expansion cards that would slot into their machines. The ruling was against IBM: they couldn't prevent competition in mechanical / functional works in this way; copyright didn't adhere to the shape of the slot - and copyright monopoly rights shouldn't be used to prevent competition in supplying replacement parts. 

    I also want to offer the observation that Arimo is metrics compatible with Arial as shipped in Microsoft Windows, which was initially metrics compatible with Helvetica as shipped in macOS; and Monotype made both Arimo and Arial. 

    I would love to hear official statements from any large company or small founder who offers metric compatible fonts on this topic, but I think that's extremely unlikely because any court in any jurisdiction could use such statements to make an own-goal. Laws are always changing! :)

    Finally, I vaguely recall seeing a video of Erik Spiekermann saying he made metrics compatible versions of fonts for use in office productivity software, so type could be swapped withoutchanges to layout by non typographer office staff. Maybe for DB? 
  • Mark Simonson
    Mark Simonson Posts: 1,739
    Indeed, he talked about it in the talk he gave at TypeCon Buffalo in 2008.
  • Thomas Phinney
    Thomas Phinney Posts: 2,899
    I will note that historically, for the most part the font business has behaved as if font metrics are not protectable “intellectual property” of any type. I have certainly long been of the understanding that this was the case.

    The functional-replacement argument Dave Crossland brings up seems strong, to my mind. I also believe this status quo is better for the world and most of the players involved. But I know neither of these opinions is universal.
  • At least for a TTF being the original, I can create one that you have to copy the entire glyph outline to maintain 100% metric compatibility because TT Instrs can alter the advance...
  • Thomas Phinney
    Thomas Phinney Posts: 2,899
    The advance-width-alteration is completely ignored by some rasterizers (e.g. Apple’s).

    In other cases, such as with Microsoft’s ClearType, I wonder if it may become relatively minor/unimportant due to x-direction supersampling.