Bug Report

CSS Styling changes OpenType substitution

Last updated: 16. September 2020
Reporter: Stefan Huber ·

Problem

The current browser renders like this:

AB AB

Expected:

CB CB

Details

HTML

A string has the following characters:

AB
<p>AB</p>
Notation: HTML
((There is an additional space between the characters in the code. This is to prevent the substitution here.))

Font

The font has a substitution (inside the liga feature of the font):

sub A' B by C;
Notation: OpenType Feature File Specification

If the characters render next to each other the first character is replaced by the ligature feature of the font. See OpenType Docs (Microsoft) – Registered features.

The renderer therefore shows:

AB

Formatting A · span

If the string gets formated in CSS with

.red { color: red; }
Notation: CSS
<span class="red">A</span><span>B</span>
Notation: HTML

The current browser renders like this:

AB

Expected:

CB

Formatting B · pseudo-class

If the string gets formated in CSS with

.bug-active::first-letter { color: red; }
Notation: CSS
<p class="bug-active">AB</p>
Notation: HTML

The current browser renders like this:

AB

Expected:

CB

Renderings

Screenshots taken on real devices

Incorrect rendering

Google Chrome 69.0.3497.100 on MacOS 10.14 Rendering Chrome 69
Fixed in Google Chrome 76 and newer
Safari Mobile 12.0 on iOS 12.0.1 Rendering InDesign 13.1 Safari 12.0 (14606.1.36.1.9) on MacOS 10.14 Rendering Safari 12 Apple TextEdit 1.14 (340) on MacOS 10.14 Rendering TextEdit 12

Correct rendering

Google Chrome 78.0.3904.87 on MacOS 10.14 Rendering Chrome 78 Firefox 61.0.2 on MacOS 10.14 Rendering Firefox 62 Adobe InDesign CC Version 13.1 on MacOS 10.14 Rendering InDesign 13.1

Links & Resources