Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPhone problem: font-feature-settings: "calt" Limbo; #29

Open
timrobinson81 opened this issue Nov 14, 2020 · 4 comments
Open

iPhone problem: font-feature-settings: "calt" Limbo; #29

timrobinson81 opened this issue Nov 14, 2020 · 4 comments
Labels

Comments

@timrobinson81
Copy link

Hi everyone,
Hope you're all well.
If you look at this link below on an iPhone, 'Libre Barcode EAN13 Text' on Google Fonts renders only numbers and doesn't appear like a bar-code as it does on other devices:
https://bit.ly/2TUo3Tp
Many thanks and kind regards,
Tim

@graphicore
Copy link
Owner

Hi, I can reproduce this, but, I don't think it's a problem with the font, as I can use the fonts on iOS (13.7) Safari (NOTE: font version is 1.006, newer than the one currently at google fonts):

ean13-testing page screenshot from IPhone.

IMG_5164

This lead to a strange finding though. May not be the case for the current version 1.004 now on Google Fonts, as I am using v1.006 which is not yet updated there!:

The complex symbol selection of the font is done using OpenType Feature substitutions, namely the calt feature, which should be on by default, according to the spec. In this font, with calt turned off you don't get numbers but patterns of number below + start pattern. That is because it supports a compatible input encoding mode, compatible with the grandzebu EAN 13 font:

/* CSS */
.ean13 {
    font-family: "Libre Barcode EAN13 Text";
    font-feature-settings: "calt" 0;
}

IMG_5165

When calt is on, an input like that will be turned into an barcode. The first calt feature turns all compatibility glyphs into number glyphs and from there continues. With iOS on Safari and Chrome it applies just the first calt rule then stops.

/* CSS */
.ean13 {
    font-family: "Libre Barcode EAN13 Text";
}

IMG_5166

In CSS, using "font-feature-settings: "calt" 1;" fixes it!

/* CSS */
.ean13 {
    font-family: "Libre Barcode EAN13 Text";
    font-feature-settings: "calt" 1;
}

Using font-feature-settings: "calt" 0; turnes calt off as expected.

So there's apparently a third mode in iOS, one between on and off. 🤬

I suggest waiting for the update at Google Fonts to version 1.006 before reporting there. But eventually, this seems like a bad implementation by Apple, and I don't know how to report issues efficiently to them.

@simoncozens
Copy link

Works in macOS Safari, but not iOS, so that's some weird rendering bug cc @nedley.

@graphicore graphicore changed the title iPhone problem iPhone problem: font-feature-settings: "calt" Limbo; Dec 16, 2020
@timrobinson81
Copy link
Author

Hi,
For me, problem solved.
Many thanks and kind regards,
Tim

@graphicore
Copy link
Owner

@timrobinson81 thanks. However, I'll keep this open until its properly documented. You can unsubscribe from notifications if you like.

@graphicore graphicore reopened this Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants