Skip to content

Allow toggling use of additional fallback fonts#6095

Merged
poire-z merged 4 commits intokoreader:masterfrom
poire-z:toggable_multi_fallbacks
Apr 28, 2020
Merged

Allow toggling use of additional fallback fonts#6095
poire-z merged 4 commits intokoreader:masterfrom
poire-z:toggable_multi_fallbacks

Conversation

@poire-z
Copy link
Copy Markdown
Contributor

@poire-z poire-z commented Apr 26, 2020

Allow toggling the use of multiple fallback fonts (#6090).
Might be handly when testing new fonts or choosing the first fallback font - when you really want to see what a font supports.

I've put it at the bottom of the font menu (if will be alone, the last one is optionnal):
image

Dunno if it's better if it was at start (with the Font settings that is not shown on most devices - or inside it, which would made this menu shown on all devices, so with a single item on most devices):
image

InfoMessage shown on long-press (for rewording suggestions):

image


This change is Reviewable

@hius07
Copy link
Copy Markdown
Member

hius07 commented Apr 26, 2020

A rare bird will reach the last page of the fonts list...
Font settings menu at the beginning seems better.

self.ui:handleEvent(Event:new("UpdatePos"))
end,
help_text = T(_([[
Enable additional fallback fonts, for the most complete scripts and languages coverage.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

script and language

(Yeah, I know ;p).

end,
help_text = T(_([[
Enable additional fallback fonts, for the most complete scripts and languages coverage.
Complementary fonts, used in this order:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Additional?

(Complementary is... clunky in English, possibly because it's so close to complimentary, which is another thing entirely ^^)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As we have "additional" in the first sentence, may be for the 2nd sentence just:
These fonts will be used in this order:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess your warning applies to the menu too:
Complementary standard fallback fonts
Suggestion for less heavy wording for this one? :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Recommended maybe? Not such a fan of that either, but it mostly works ;p.

%1

The fallback font set with a long-press on a font name will be used before these.
Note that the first font of the whole fallback fonts set is still used when this option is disabled.]]),
Copy link
Copy Markdown
Member

@NiLuJe NiLuJe Apr 26, 2020

Choose a reason for hiding this comment

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

Does this refer to this actual list, or the the "old" fallback font?

(In which case, it's potentially a duplicate if your global fallback is also set to Noto Sans CJK SC?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(Not sure I understand your question :/ (the "old" fallback font?))

I tried to summarize the following with these 2 sentences :)

In koreader/crengine#339, I explained a bit how that works:

Users will still be able to only set one fallback font, which will be put at start of this list. If the font is already in that list, it will be moved first. This allows some bit of customisation, while always providing large coverage.

A user can set one fallback font. If not in the list: added at top. If in the list, moved to top.
So, if you set the user fallback to NotoSansCJK, this list does not change, it's the default behaviour :)
Dunno if we need to explain all this in that help_text - users shouldn't much care about duplicates.

(The only case where a duplicate/double rendering/drawing might happen is when you set as the main font one of the fonts in that list.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I vastly prefer that quote from the second sentence used here, FWIW.

Copy link
Copy Markdown
Member

@NiLuJe NiLuJe Apr 26, 2020

Choose a reason for hiding this comment

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

i.e., keep the first sentence, but replace the second with something inspired from that like If that font happens to be part of this list already, it'll still be tried first.

@Frenzie Frenzie added this to the 2020.05 milestone Apr 26, 2020
@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Apr 26, 2020

Font settings menu at the beginning seems better.

OK, going to make it proper, which means bringing frontend/ui/elements/font_settings.lua (from #5220) into readerfont.lua for oneplaceness.
edit: or not, it's used from elsewhere, frontend/fontlist.lua

I guess I can add to it the undocumented and hidden Generate fonts test HTML document - so we have at least 2 items in it.

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Apr 27, 2020

So, new Font settings submenu (well, not so new, was there on Android & the emulator...)
image

image
(only the 2 last items on Kobo, Kindle...)

image

The last item was hidden and undocumented, but well, now it is no more.
I made some sample text that we'll ship, so users will see this when hitting it:

image

Feel free to suggest some rewording in it - and if anyone wants to correct my chinese, hebrew or arabic gibberish with stuff that makes sense to people that can read it, please do :)

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Apr 27, 2020

(Found a bidi bug in crengine that I'll have fixed in my next PR - so that text might show ugly under certain conditions as:
image
)

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Apr 28, 2020

No more comment about this one?


%1

You can set a prefered fallback font with a long-press on a font name, and it will be used before these.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

preferred

})

table.insert(settings_table, {
text = _("Generate font test HTML document"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd just leave it out, but otherwise I think HTML font test document sounds better.

Suggested change
text = _("Generate font test HTML document"),
text = _("Generate font test document"),

Copy link
Copy Markdown
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

Nothing else jumps out but I only looked through it quickly.

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Apr 28, 2020

Probably some bits in the shipped sample text that could be made less clumsy - but I guess we can fix that later (when you get a chance to read it on your device :)

@poire-z poire-z merged commit 1a91893 into koreader:master Apr 28, 2020
@poire-z poire-z deleted the toggable_multi_fallbacks branch April 28, 2020 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants