the full Roboto family) is installed on both Windows and macOS machines, it will behave differently: on macOS, "family" names such as "Roboto Thin" or "Roboto Black" are NOT recognized, whereas they are on Windows. This seems like an unfortunate inconsistency, and tends to limit the webcompat utility of the workaround: sites that rely on such legacy GDI-style names may still fail on other platforms. I've been experimenting with some possible approaches here, and I think I have a patch that works reasonably well. * If the CSS font-family property calls for a family name that isn't found, we check if the name includes a space. * If so, it's possible this is a "styled family" name (like "Arial Black" or "Fira Sans Heavy" or "Segoe UI Light"). Strip the last word off the font-family name to give a candidate "base family name", and see if that is available. * If it is, then iterate over the faces in the base family, and check the 'name' table of each to see if it has a legacy family name (like "Arial Black") that differs from the preferred family name ("Arial"). * Add new gfxFontFamily objects for any such legacy families to the gfxPlatformFontList, and then re-try the original font-family search.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |