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(site): offline bundled lato 2.0 and systemfonts, no googleimport by default #2359

Merged
merged 6 commits into from
May 29, 2022

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Apr 30, 2022

Description

This PR bundles the recent Lato 2.0 Font. It uses the same styles as the previous googleFonts Import does.

This fixes possible GDPR issues as the default theme now disables googlefont import.

I implemented a new variable @fonts which allows for a totally free description of font faces to be imported if needed. Each declared property will be used, so one can customize them as needed by that single variable.

Disabling the whole import can be done via @importFont: false or setting @font: {} or setting @fontName: '' just as one likes.
The new variables for unicode or font properties are done to simplify the default import and of course if one just wants to adjust them without redeclaring the whole @font variable mixin.

I also added @supportIE which allows to disable the woff-font import, as all other supported browsers support woff2 already.

This new variable and also the icon font-face will be adjusted accordingly in a separate PR... in case you might ask/wonder 😉

The default theme uses Lato-Latin 2.0 now which is smaller in size but includes the most important glyphs for European Latin-based languages which were missing in Lato v1 (via googlefonts) like in "Řeřicha"
It also uses Lato with Greek+Cyrillic+Extended 2.0 via unicode-range property which makes sure the font is only loaded when related characters are used inside the page.
If no character matches at all, the system fonts will be used as fallback.

I created the unicode ranges by analyzing the fonts character ranges using https://github.com/fontforge/fontforge

I also added an optional theme to adjust the font via a change in theme.config:

  • systemfont (which completely disables any font import and uses the platform system fonts only instead AND adjusts the bold setting so the overall visual appearance is very similar) See comments below for more info.

The used Lato fonts are available free of charge under the SIL Open Font License from http://www.latofonts.com/

Testcase

Build FUI :)

To test System Fonts

  • Adjust theme.config:
@site       : 'systemfont';
  • Build FUI
  • Use some latin as well as cyrillic and greek characters on a webpage
  • inspect the character sections to see which font is used

Screenshots

lato2

Lato 2.0 Lato 1.0 (until FUI 2.8.8) systemfont
image image image

Closes

#367
#2355
Semantic-Org/Semantic-UI#7075

@lubber-de lubber-de added this to the 2.9.0 milestone Apr 30, 2022
@lubber-de lubber-de added lang/css Anything involving CSS tag/breaking-change Any pull request which is waiting for a breaking change release type/feat Any feature requests or improvements labels Apr 30, 2022
@lubber-de lubber-de added the state/awaiting-docs Pull requests which need doc changes/additions label Apr 30, 2022
@lubber-de lubber-de added the tag/sui-issue Taken from an existing Issue/PR of SUI label Apr 30, 2022
exoego
exoego previously approved these changes Apr 30, 2022
Copy link
Contributor

@exoego exoego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

prudho
prudho previously approved these changes May 4, 2022
Copy link
Contributor

@prudho prudho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks good as it 👍

@lubber-de lubber-de marked this pull request as draft May 8, 2022 10:03
@lubber-de lubber-de dismissed stale reviews from prudho and exoego via 1359878 May 15, 2022 19:58
@lubber-de lubber-de marked this pull request as ready for review May 15, 2022 20:20
@auto-assign auto-assign bot requested a review from exoego May 15, 2022 20:20
@auto-assign auto-assign bot requested a review from prudho May 15, 2022 20:20
@lubber-de
Copy link
Member Author

@fomantic/maintainers I updated the PR, made it more flexible and used the advises by @mvorisek (thanks again)
Please review again

@lubber-de lubber-de added the state/awaiting-reviews Pull requests which are waiting for reviews label May 16, 2022
@lubber-de lubber-de merged commit 054fffa into fomantic:develop May 29, 2022
@lubber-de lubber-de deleted the LatoBundled branch May 29, 2022 12:12
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label May 29, 2022
lubber-de added a commit that referenced this pull request May 31, 2022
This PR makes all IE specific LESS code optional. By default the new variable @supportIE (introduced by #2359 ) is true, so the code compiles as before

Early Edge Legacy versions still use the IE11 engine / -ms prefix syntax, so setting supportIE: false; will also disable support for those browsers.
@lubber-de
Copy link
Member Author

Docs added by fomantic/Fomantic-UI-Docs#383

@lubber-de lubber-de added state/has-docs A issue/PR which requires documentation changes and has the corresponding PR open in the docs repo and removed state/awaiting-docs Pull requests which need doc changes/additions labels Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS state/has-docs A issue/PR which requires documentation changes and has the corresponding PR open in the docs repo tag/breaking-change Any pull request which is waiting for a breaking change release tag/sui-issue Taken from an existing Issue/PR of SUI type/feat Any feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants