[WiP] Google Fonts - Generalise option name, clean-up fonts folder and simplify UX#50
Conversation
- More general name of the option, i.e. not use "Google". - Simplify UX: Only one field for controlling the use of extra fonts. - Remove the description. - Use a list field and not a filelist in order to be able to set nice font names.
language/en-GB/tpl_cassiopeia.ini
Outdated
| TPL_CASSIOPEIA_FONT_NAME_LABEL="Google Font Name" | ||
| TPL_CASSIOPEIA_FONT_NAME_DESC="Example: only one font Josefin Sans or a font combination Montserrat + Work Sans." | ||
|
|
||
| TPL_CASSIOPEIA_FONT_LABEL="Extra font(s) for text and headings" |
There was a problem hiding this comment.
What else could a font be for?
There was a problem hiding this comment.
Ok, I'll remove the " for text and headings".
Is the "Extra font(s)" ok? Or should it be somethine else, e.g. "Load font(s)" or "Add font(s)"? And is the "(s)" ok for showing it could be a font or a combination of fonts, depending on the particular (s)css file?
There was a problem hiding this comment.
To match the style guide it should be capital F
It is not very accessible to a screen reader to have (s)
Is it a multiple select?
Needs to be clear that this will be for fonts that are not part of a users system. ie they will be downloaded over the internet by every user. Personally I would never use this as it will effect the performance of the site
There was a problem hiding this comment.
@brianteeman Capitalisation "Font(s)" already fixed.
It is a single select, but it selects a css file. This can use one font for all, or a conbination of fonts, e.g. font x for h1, h2 ... h6 and font y for body, or however you define it there.
Correct but maybe too long would be "Extra Font or Font Combination". Shall I use that?
There was a problem hiding this comment.
And should we translate the font or font combination names, too? In most languages I've ever seen, e.g. Russian or Japanese, such names are (or at least can be) treated as literals with latin characters. But you have more experience in web, so maybe my experience is wrong because too limited.
There was a problem hiding this comment.
So you won't at least suggest a better label text or tell me "Extra Font or Font Combination" is ok?
There was a problem hiding this comment.
Its not possible to suggest something because its not clear what the feature does
Extra Font means extra to what
Font combination doesn't indicate that it will be using font files that have a negative impact on my sites performance
There was a problem hiding this comment.
Check the code and test the PR and you will see what the feaure does.
There was a problem hiding this comment.
I can see what it does - I cant see what it is intended to do
There was a problem hiding this comment.
Well I think that was explained before: We want to provide a possibility to use locally stored fronts for those who don't wanna load them from Google fonts for whatever reason, GDPR or whatever else.
It was requested to have that possibility, and it was on the task list for that Cassiopeia working group before I joined it.
If that makes sense or not I don't really want to decide. It was not my idea, I only wanted to help with implementation.
Because the was using a CSS file to load the fonts we can do more than just load one font, and so we can select one CSS file which uses several fonts. Currtently the examples here don't do that.
I wanted to keep this work piece separate so we could later still decide to use it or not, but development here was going the way that it was merged into the development branch.
So later it might be harder to revert that part, but it will still be possible, and I would be the last one who would fight against reverting if it was clear that the feature is not accepted by the majority or even a large part of the community.
You are right regarding performance of loading those fonts from the site. Maybe we should mention that in docs, if that fautre is accepted, or even show a kind of warning text in the template style settings.
|
Having checked the Fira font it definitely can not be transliterated or translated as that would be a breach of the trademark |
|
I am assuming that no one has realised that neither of these fonts will work in non-latin character sets |
|
We have realized that and are looking for better ones. |
|
Good luck in that as to the best of my knowledge there is no google font that ships with all character sets. Which is why joomla has never shipped with one before as out of the box joomla really should work perfectly with all supported languages. It's not "all together" if some languages are excluded. The only one that really does is the noto font and it does this by having separate fonts for each character set or having a single 20mb font file |
|
Well with the solution here, one can use different template styles for particular languages and in that template style select a CSS for a font (or font combination) which is suitable for that language and regarding design aspects looks similar to the fonts used for e.g. for English. |
|
Out of the box on install? |
|
If we find suitable fonts for Arabic, Greece, Hebrew, Russian, ... we could ship them with the core and give them telling names in the options so people can see they are good for e.g. Greece, and maybe we could provide a readme in the media/fonts folder where we have the fonts. |
|
you miss the point. a readme in the font folder will be too late and its not available to users from inside the joomla ui |
|
I did not miss the point and it is true what you write. But currently in J4 core the Cassipeia template uses the "Fira Sans" font anyway, without even a possibility to change that or switching it off without making an override. |
|
Maybe we should include "Noto Sans" as font and use it as default? It looks clear and is readable and covers many character systems, seems to work with Arabic and so on. I know, design is not finished yet. Anyway, the whole discussion above was about the local fonts feature in general, not about the changes to it made by this PR. But as long as we have no other (dummy) PR or issue where we can discuss that, I am ok with it to continue here. |
|
Update: It seems to be a bit big, the whole "Noto Sans" font package. Some 1.1. GB. Not sure if we should ship it with the core. Any opinions? |
|
I just see the 1.1 GB are for the complete "Noto" font family, which includes some 50% serif fonts and a bunch of historical writing systems like "Noto Sans Ugaritic", "Noto Sans Runic" or hieroglyphs, which we will for sure not need. So at the end we won't need many fonts, the "Noto Sans" covers already Greece and Cyrillic completely. |
|
Yes, "Noto Sans" seems to be sufficient for the most languages. |
|
Back to draft because changes have to be made for different fonts due to the upcoming design. I'll either modify this PR or make a new one soon. |
|
Closing in favour of #61 . |

Pull Request for Issue #32 .
Summary of Changes
Testing Instructions
Checkout the development branch in your Cassipeia local git clone and if necessary pull the latest changes.
If never done before:
composer installandnpm ci.Alternatively to steps 1 and 2 you can make a new installation, using the installation package from the testing PR #48 , https://test5.richard-fath.de/Joomla_4.0.0-beta4-dev-Cassiopeia-Test-Full_Package_2020-08-30_v2.zip , and installing blog sample data.
Check content of the
media/fontsfolder.Result: See 1st screenshot in section "Actual result" below.
In backend, check the "Advanced" options of the Cassiopeia template style.
Result: See 2nd screenshot in section "Actual result" below.
Apply the changes of this PR.
Run
npm ci.Alternatively to steps 5 and 6, you can update the installation using the "Upload & Update" tab of the "Joomla Upda" component and using using the installation package from the testing PR #48 : https://test5.richard-fath.de/Joomla_4.0.0-beta4-dev-Cassiopeia-Test-Update_Package_2020-08-30_v2.zip.
Check content of the
media/fontsfolder.Result: See 1st screenshot in section "Expected result" below.
In backend, check the "Advanced" options of the Cassiopeia template style.
Result: See 2nd screenshot in section "Expected result" below.
Toggle the "Extra font(s) ..." dropdown, save settings and check the result in frontend visually and using your browser's inspection tool.
Result: The font selection is applied as well as without this PR.
Expected result
The media/fonts folder:

Cassiopeia's template style options:

Actual result
The media/fonts folder:

Cassiopeia's template style options:

Documentation Changes Required
None beside what has to be done for the new option anyway.