I’m having two issues that I can’t seem to solve pertaining to the application of webfonts.
The first is that line breaks and new html tags (<span>, <a>, etc.) are (understandably) read by the font as new blocks of text, which means contextual alternates, contextual kerning and so on don’t work across multiple lines, tags, etc… So if you have, say:
<p>X<a>Y</a></p>
then any kerning or alternates set up for an XY pair are ignored because the two letters don’t know the other exists.
Here is an example using my font (this is ancient Egyptian in RTL):
The top line works as planned (the group on the right is actually four separate symbols contextually substituted and pushed together with contextual kerning. However, if I convert the left half into a hyperlink (indicated by the grey box), the font no longer knows to add extra kerning to the last of the group of four, because as far as it’s concerned, the text block has ended.
Now it’s understandable why this is happening, I was just wondering if anyone was aware of, or had found, a workaround…?
Any help would be greatly appreciated!!
I’m going to post my second question separately to keep this from getting too long.
The first line of defense is to make the font work as well as possible without kerning. I cannot really tell from the screenshot, but my guess is that some of the glyphs have negative sidebearings? Avoid situations where you need positive kern pairs, prefer negative kern pairs. Or that the addition on the side of that one letter should be a spacing (rather than a nonspacing) mark. Again, hard to tell from just the screenshot.
Otherwise you should be able to find a solution in CSS.
I would try to make the spacing of the left block in a way that it is independent of further context. I don’t know if that that is practical in this case.
I’m assuming on a similar note that if I have a string of characters that are always within <a> tags throughout the text, there’s no way to avoid that string always looking identical, because the loop through the contextual alternates will start over each time? So, for example:
<p>test <a>link</a> test <a>link again</a> test <a>link three</a></p>
in a handwriting font would render the word “test” and the word “link” identically in every instance, and that’s unavoidable?