Diacritical marks fly away

Hello everyone,
could you please help me? I’ve designed a font, and when it was used on a website, I found out that some of diacritical marks are far away from where they’re supposed to be. So it looks like y ´instead of ý and i´(with the tittle) instead of í. The problem appears randomly, sometimes it’s alright, sometimes it’s not in the same letter. In some articles it’s bad across the whole text, in others it’s totally fine. Why is this happening? I’m not familiar with web technologies, but it works fine when I test it myself. Seems like it has something to do with anchors, or maybe it depends on how the copywriter types the copy…?

Comments

  • John Savard
    John Savard Posts: 1,126
    If you have included precomposed characters in your font, then while there could be a shortcoming in how your font implements combining characters, it's also entirely possible that what is happening is due to factors that are in no way your responsibility.
  • Alex Visi
    Alex Visi Posts: 185
    If you have included precomposed characters in your font
     I have, forgot to mention that.
  • John Hudson
    John Hudson Posts: 3,186
    Check the text encoding of the documents. It is possible that some are encoded using spacing accent characters instead of either precomposed diacritic or combining mark characters.
  • Kent Lew
    Kent Lew Posts: 937
    If the underlying text encoding for these characters is composed of separate unicodes for the base character and a combining accent instead of a single codepoint for a precomposed character, then this can happen, especially if you do not have a {mark} or {ccmp} feature to handle these sequences.

    What you see will then depend upon the rendering environment.

    Some environments may attempt to redirect to a precomposed codepoint, all on their own initiative, following Unicode composition/normalization rules, if the codepoint is present in the font’s cmap. InDesign does this, for instance. But most web browsers do not.

    If the renderer is not directed to a precomposed codepoint and it does not find a {mark} feature to handle the positioning of the combining accent, then it may handle the sequence in a couple different ways.

    In some situations, you’ll find that the renderer acknowledges that the accent is intended to be a combining accent (based upon its codepoint) and will simply center the combining accent over the preceding glyph, in the absence of any other direction.

    In other cases, however, the renderer will just present the zero-width combining accent at the right sidebearing of the preceding glyph, just as you would expect from a simple sequence of two codepoints.

    If your encoded combining accents are not zero-width (like they’re supposed to be), then the effect of this latter handling will be exacerbated accordingly.
  • Alex Visi
    Alex Visi Posts: 185
    Thanks everybody! Now it makes sense. So it seems like {ccmp} feature would be the right solution here.

    A bit off-topic, but is there some kind of list of must-have features that every good functional font supposed to have?
  • Kent Lew
    Kent Lew Posts: 937
    A {ccmp} for substituting precomposed glyphs for all relevant sequences of base+cmbaccent is certainly possible, but not common in most commercial fonts (that I’m aware of). Such a thing is not considered a “must-have.”

    The preferred solution would be a {mark} feature.

    That, or whoever is composing the text for the web should probably use precomposed codepoints (except for those combinations that do not have Unicode codepoints, of course). IMHO.
  • Alex Visi
    Alex Visi Posts: 185
    Kent Lew said:
    A {ccmp} for substituting precomposed glyphs for all relevant sequences of base+cmbaccent is certainly possible, but not common in most commercial fonts (that I’m aware of). Such a thing is not considered a “must-have.”

    The preferred solution would be a {mark} feature.
    Interesting, why is it so?
    Do I understand it correctly that in this case a font should include both {mark} feature and precomposed glyphs for different environments? Or any other reasons to use precomposed glyphs at all?
  • Kent Lew
    Kent Lew Posts: 937
    You ask questions that are the subject of evolving opinion and some debate. You can search this forum for other discussions on the matter.

    Here’s one for you: http://typedrawers.com/discussion/2282/does-anybody-use-combining-accents

  • Alex Visi
    Alex Visi Posts: 185
    Kent Lew said:
    You ask questions that are the subject of evolving opinion and some debate. You can search this forum for other discussions on the matter.

    Here’s one for you: http://typedrawers.com/discussion/2282/does-anybody-use-combining-accents

    Thank you!