w3c / w3c/afrlreq

It should be possible to slant glyphs to the left for italics/oblique

Open
#17 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

doc:nkoo gap i:letterforms l:nqo p:basic s:nkoo x:alreq x:blink x:hlreq x:nkoo x:webkit
Dominant language
HTML
Stars
11
Forks
4
PR merge metrics
No merged PRs in 30d

Description

This issue is applicable to Arabic/Persian, Hebrew, & N'Ko.

Typography for N’Ko is still at an early stage of development, but when JamraPatel reached out to communities to see if an Italic typeface would be beneficial, they expressed a desire to have one. Over the past few years, the need to be able to set more complex copy has increased as well. Since neither script had any precedent for a drawn italic typeface, JamraPatel asked the community how they would like to see it drawn. The preference was for N'ko to have a leftward lean. To JamraPatel's knowledge, their typeface has the first drawn italicized N'ko.

nko_italics

The following is a photo of an Arabic newspaper letterhead. See the oblique text in the middle line.

More:

Priority

Marking this as basic priority, given that incorrect synthesis is likely to occur often. Also note that this is the only expectation direction of slant for writers of the N'Ko script.

The Gap

If an italic font is applied to create italicised or oblique text, there should be no problem here. But such font styles are sometimes achieved using font-synthesis, in which case the correct lean needs to be applied.

CSS provides for 'negative oblique' values of the font-style property, which can be used to achieve this. Set font-style to the desired value, such as -14deg and set font-synthesis-style to auto. Gecko supports that value, but Blink and WebKit do not.

However, there is a problem with the CSS approach because it suggests that if an italic font face is available for the font in use, then the font should be used rather than applying the oblique synthesis. (And this is what browsers appear to do.) In most cases, currently, this will result in right-leaning, italic glyphs (which may also have different shapes to oblique glyphs) rather than the specified left-leaning synthesized oblique or fallback to an oblique font face.

The following diagram shows the result of the second interactive test below, where no font-family property is specified, and font-style:oblique -14deg is applied to all lines. There is only one N'Ko font on the system and the system has no associated italic font file. The font set in browser preferences for Arabic text is also unaccompanied on the system by an italic font file. The Hebrew and Ukrainian texts are both represented by fonts for which an italic font file is also present on the system. The directive to apply -14 degree oblique to the latter two is overridden, and the text leans the wrong way. (And the letterforms for the cyrillic text are very different from those that would be produced by synthesising the oblique on the regular font.)

Result of applying oblique to 4 scripts.
Tests

interactive test: It is possible to make synthetic oblique slant letterforms to the left.

interactive test: It is possible to slant glyphs to the left when the system has an italic font face.

Action taken

CSS issue: (css-fonts) It should be possible to slant glyphs to the left for italics/oblique #8914

CSS issue: (css-fonts) Specifying a direction without a specific angle #9392

CSS issue: (css-fonts) avoid fallback from oblique to italic #9389

CSS issue: (css-fonts) font-synthesis-style is too blunt #9390

Browser bug reports: WebKitBlink

Outcomes

CSS resolution Disallow fallback from oblique to italic. Also, unless synthesis is prevented, synthesize oblique from normal font when oblique is requested.

CSS resolution Add left/right (and maybe logical variants) to font-style, and to @font-face.

In CSS Fonts 4 the font-style property now has two new values: left and right. These match against a font that is labeled as an italic face, with an appropriate slant; or an oblique face with with an appropriate slant, if one does not exist.

font-synthesis-style has a new value, oblique-only, which allows synthesis of oblique faces, but they must not be used as fallback if italic is specified.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CSS Fonts issues, especially the resolutions for avoiding italic fallback and adding left/right font-style values, then review interactive tests 8 and 10 for the expected behavior. Done means the relevant CSS specification behavior and test expectations cover left-leaning oblique synthesis and matching appropriately slanted font faces.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
internationalization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.