BASE table: design and rendering

Simon Cozens
Simon Cozens Posts: 741
edited January 2020 in Font Technology
I've been trying to check whether or not I understand how the OpenType BASE table works. It doesn't seem to do what I expected.

I designed a font in Glyphs, with two glyphs, L and uni9053. For demonstration purposes I added a small horizontal line at the logical baseline (Y coordinate = 0). I then rendered the two glyphs together with hb-view.

Next I added a BASE table in Glyphs:

table BASE { 
    HorizAxis.BaseTagList ideo romn ;
    HorizAxis.BaseScriptList
       latn romn -110 0,
       hani ideo -110 0;
} BASE;<p></p>
What I thought this would do is to specify a low ideographic baseline of -110 units (which is the bottom edge of the "road" radical) and a Latin baseline of 0. The text renderer should be aligning the kanji along the low ideographic baseline, and so the effect of adding the BASE table should be to ask the renderer to drop the kanji down relative to the Latin. It didn't; I got the same output as before. (I also tested in Japanese Adobe Illustrator CS6, and saw no difference in the output there either.) In fact, there didn't seem to be any change no matter what figures I put in the BASE table.

Am I expecting the wrong thing from the BASE table, and/or am I expecting the wrong thing in terms of client support? Do clients actually support multiple typographic baselines? Finally whose responsibility is it to implement the baseline alignment - shaper or layout application?

Comments

  • Where are you testing this? hb-view does not use the BASE table, and don’t actually know any open source application that uses it. You might need to check with some Adobe apps.
  • (HarfBuzz utils are simple tools, they don’t do any script itemization for example, you are supposed to give them single script runs).
  • Simon Cozens
    Simon Cozens Posts: 741
    edited January 2020
    "(I also tested in Japanese Adobe Illustrator CS6, and saw no difference in the output there either.)" Just also tried it in Photoshop and Apple Pages, and in various browsers.

    (I've added the two fonts - one with BASE, one without - to my test fonts page.)
  • hb-view does not use the BASE table, and don’t actually know any open source application that uses it.
    This is why I was asking whose responsibility it is. The spec says that the BASE table "recommends" baseline positions to "the client" (shaper? layout engine? application?), but "a client can specify others. For instance, the client may want to assign baseline positions different from those in the font."

    This makes it sound like baseline alignment is an optional part of layout, but a client might decide to do something different instead anyway or perhaps nothing at all. That's not a great situation to be in if you are trying to ensure consistent layout, and I wonder if it actually makes BASE functionally useless.
  • "(I also tested in Japanese Adobe Illustrator CS6, and saw no difference in the
    Sorry, I missed that part. I don’t actually know what applications out there support BASE table, I vaguely remember reading that some Adobe app (InDesign?) supported it but only for ideographic baseline, but online search did not turn up any thing.
  • hb-view does not use the BASE table, and don’t actually know any open source application that uses it.
    This is why I was asking whose responsibility it is. The spec says that the BASE table "recommends" baseline positions to "the client" (shaper? layout engine? application?), but "a client can specify others. For instance, the client may want to assign baseline positions different from those in the font."
    In case of HarfBuzz, that would be the responsibility of its client (be it an application, or a higher level layout library like Pango). However I don’t know any HarfBuzz client that make use of BASE table, its support in HarfBuzz is rather recent as well.
  • OK, so it looks like the upshot is "BASE was a good idea but nobody really got around to implementing it."
  • My admittedly-vague recollection is that @Khaled Hosny is correct, and InDesign supports it—although perhaps only with the “Japanese composer” (composition engine), and possibly only for ideographic baseline vs Latin, or the like.
  • Nat McCully
    Nat McCully Posts: 1
    edited January 2020
    The base table ideo baseline is supported by the Japanese composers in InDesign-J and should also be by Illustrator and Photoshop and AE, etc when using the "CJK" composer. Altering the table should result in a change in the relative position of cjk glyphs in the line and also to the Roman baseline position within the line height. 
    The purpose of the entries in the table is to allow font designers to specify where the glyphs should be positioned in a cjk centric embox world. InDesign's Japanese composer will use this info to calculate the embox position relative to the Roman baseline (glyph origin).
    To see the change, you may have to play with the glyph alignment settings, to set a non-Roman baseline to the runs.