feat(framework): add override font-family for glyphs with diacritics #2402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Before the fix, the wrong diacritics are displayed:
After the fix, the correct ones:
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.--sapFontFamily
fonts. This is necessary to ensure that languages such as Vietnamese will work properly no matter where the CSS Variables fortheme-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