Why it matters
- It is common with Latin fonts: a site picks one font for its whole design, and that font has Latin letters only. The Arabic text then appears in whatever font the visitor's device has, and looks different from one phone to the next.
- Two fonts in one word look broken: when the font has only some of the letters, a single word is drawn in two fonts whose shapes, weights and heights do not match.
- The page downloads a font that does not draw its main text.
Example
body { margin: 16px; font-family: 'Brand Latin', sans-serif; }
body { margin: 16px; font-family: 'Brand Latin', 'Brand Arabic', sans-serif; }
How to fix
Use a font that has Arabic letters, or list an Arabic font after the Latin one. For each character, the browser uses the first font in the list that has it:
css
body {
font-family: 'Brand Latin', 'Brand Arabic', sans-serif;
}- A font served in parts, one
@font-faceper range of characters, needs a part whoseunicode-rangecovers the Arabic letters. - A font cut down to the letters of a logo or a heading suits that logo or heading only, not text.
How we detect
- We render the page in Chromium and find the elements whose own text has Arabic letters and whose first family is one of the page's web fonts.
- For each such
font-family, we add a hidden element holding every Arabic letter, set in thatfont-family, and ask Chromium which fonts drew it. - The rule fails when none of those fonts is a web font, or when a web font drew some of the letters and a font of the device drew the rest.
- When the web font did not load at all, that is the finding of the rule for Arabic web fonts that did not load, not of this one.
- Only Chromium reports the fonts that drew a text, so this rule reads Chromium alone. There is one finding per
font-family, at the first element set in it.