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

feat(framework): add override font-family for glyphs with diacritics #2402

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Oct 27, 2020

The 72 font has limited support for diacritics and should not be used for certain Unicode characters (for example ones used in the Vietnamese language).

Therefore this change introduces the 72override font family that will be used for these characters only, and it will fallback to the system fonts - Arial, etc... that display them properly.

Consider the following HTML:

<ui5-button>Đỗ</ui5-button>

Before the fix, the wrong diacritics are displayed:
image

After the fix, the correct ones:
image

Changes:

  • insertFontFace.js is split into 2 parts: normal font part (that works as before - only applied when there is no OpenUI5 present) and override part, which is applied unconditionally. The reason is that OpenUI5 does not provide the override 72 font when used in CSS Vars mode, but only with .less files. Therefore we always need it.
  • All components now use this font family explicitly, before falling back to the --sapFontFamily fonts. This is necessary to ensure that languages such as Vietnamese will work properly no matter where the CSS Variables for theme-base come from: UI5 Web components, OpenUI5 or Theme Designer.

Important: This is a temporary fix until this feature is implemented in https://github.com/SAP/theming-base-content. Then it will work out of the box for both UI5 Web Components and OpenUI5 in CSS Vars mode.

closes: #2399

@vladitasev vladitasev changed the title feat(framework): add fallback font for glyphs with diacritics feat(framework): add override font for glyphs with diacritics Oct 28, 2020
@vladitasev vladitasev changed the title feat(framework): add override font for glyphs with diacritics feat(framework): add override font-family for glyphs with diacritics Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

72 font: add fallback font for glyphs with diacritics
2 participants