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

[FEATURE] More fonts #377

Open
hollisticated-horse opened this issue Jul 31, 2024 · 10 comments
Open

[FEATURE] More fonts #377

hollisticated-horse opened this issue Jul 31, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@hollisticated-horse
Copy link

hollisticated-horse commented Jul 31, 2024

Is your feature request related to a problem? Please describe.

Be able to use different fonts in Stump.

Describe the solution you'd like

WIP Proposal:

Add multiple fonts :

  • System wide
  • For the epub reader
    • Having a couple of fonts for both sans-serif and serif types.
    • I have a personnal preference for Libre Baskerville.
    • change the fonts in the reading preferences per users, as well as in the epub reader.

Describe alternatives you've considered
One interesting thing is that I believe that epubs sometimes have fonts embeded in the file. So for the epub reader, maybe use the fonts or not.

Additional context
Will add if anything comes up

@hollisticated-horse hollisticated-horse added the enhancement New feature or request label Jul 31, 2024
@hollisticated-horse hollisticated-horse changed the title [FEATURE] Fonts [FEATURE] More fonts Jul 31, 2024
@hollisticated-horse
Copy link
Author

hollisticated-horse commented Aug 7, 2024

Font Licensing

  • SIL OFL (Open Font License)
  • GPL
  • Apache

Fonts of interest

KOReader default Fonts

  • Noto Sans OFL
  • Noto Serif OFL
  • FreeSans GPL
  • FreeSerif (same) GPL
  • Droid Sans Mono Apache
  • ChareInk ?
  • Conforta OFL

Please, if anyone has other fonts that could make the cut, leave a comment 😁

Some Nice Fonts Examples

@JMicheli
Copy link
Collaborator

JMicheli commented Aug 7, 2024

I think that including font options would be nice, though it likely requires some changes to make sure we can properly embed the fonts server side to provide to the client (someone correct me if I'm wrong in thinking this).

Given that Stump would be supplying the fonts, and presumably including them in the repo, do we know that each of these fonts has no licensing restrictions that we'd run into problems with? An annoying detail to think about, but still one that should be considered.

@aaronleopold
Copy link
Collaborator

aaronleopold commented Aug 7, 2024

I think that including font options would be nice, though it likely requires some changes to make sure we can properly embed the fonts server side to provide to the client (someone correct me if I'm wrong in thinking this).

It would be client-side only, I don't think anything would really change on the server. There is already a 'custom' font declaration, so if any were to be added it would just be a matter of shoving them there for the most part.

I'm personally much more inclined to support mapping custom fonts, e.g. one could optionally mount a directory to /fonts which contains all the font declarations. This could piggyback off of the (future) custom theme feature, which funny enough I forgot to write up into a separate issue lol see #227 (comment)

Edit to add that I created the issue: #383

That being said, I think a few others can be baked in so long as it doesn't bloat the bundle too much (with preference to accessibility-focused fonts).

An annoying detail to think about [license restrictions], but still one that should be considered.

Good point! Anything baked into the repo has to follow licensing guidelines. The two listed (GPL and SIL OFL) seem to be ✅ on the surface, but I'd have to be sure before any commitment

@JMicheli
Copy link
Collaborator

JMicheli commented Aug 7, 2024

Hey thanks for adding the font licenses. Very helpful!

@hollisticated-horse
Copy link
Author

hollisticated-horse commented Aug 7, 2024

Thank you @JMicheli, your comment got me going to look for the licensing.

From what I understand, both OFL;

  1. Original or Modified Versions of the Font Software may be bundled,
    redistributed and/or sold with any software, provided that each copy
    contains the above copyright notice and this license. These can be
    included either as stand-alone text files, human-readable headers or
    in the appropriate machine-readable metadata fields within text or
    binary files as long as those fields can be easily viewed by the user.

and GPL:

  1. You may copy and distribute verbatim copies of the Program's
    source code as you receive it, in any medium, provided that you
    conspicuously and appropriately publish on each copy an appropriate
    copyright notice and disclaimer of warranty; keep intact all the
    notices that refer to this License and to the absence of any warranty;
    and give any other recipients of the Program a copy of this License
    along with the Program. You may charge a fee for the physical act of transferring a copy, and
    you may at your option offer warranty protection in exchange for a fee.

Are okay to use for Stump (most fonts from google fonts for example follow one of those licenses).

I think it's a neat idea to just select a few (4 by default at most, for example) + the opendyslexique one. The rest can indeed be added manually via a font dir.

Would all fonts be usable for : System and reader texts ?

@aaronleopold aaronleopold self-assigned this Aug 8, 2024
@github-project-automation github-project-automation bot moved this to Backlog in v0.1.x Aug 8, 2024
@aaronleopold aaronleopold moved this from Backlog to In Progress in v0.1.x Aug 8, 2024
@aaronleopold
Copy link
Collaborator

Are okay to use for Stump

After a little time last night reviewing OFL, any of those should be good to use directly (i.e. providing them as part of Stump).

The GPL ones I am not as sure about, but can get back to you 👍

Would all fonts be usable for : System and reader texts ?

Yes, ideally both. However I'd make the reader a separate configuration from the general app font configuration

@aaronleopold
Copy link
Collaborator

As of #386, the OpenDyslexic font was added and I've outlined how to properly bundle a font in the webapp on the documentation website (the site will be re-deployed when I release 0.0.5).

In my spare time, I'll try to add 1-2 more OFL-licensed fonts. I'll also accept PRs, so long as the font additions aren't too large (in file size). Please also be aware of the note in the linked PR:

This PR does not include any logic to isolate font selection for the epub reader. I plan to tackle that at a later date with other epub-related changes

I will close this issue after I implement the above

@hollisticated-horse
Copy link
Author

I think at least a sans serif and a serif would be nice to have.
Maybe make a open call for fonts for the stump ui (non-epub).

@hollisticated-horse
Copy link
Author

Actually, maybe just having the stump default and opendyslexique is enough.

@aaronleopold
Copy link
Collaborator

Yeah sorry, I haven't had the time to go through and add any additional fonts yet. There are a few other items in-flight at the moment, but I'll try to get them out in either 0.0.8 or 0.0.9

@aaronleopold aaronleopold moved this from In Progress to Up Next in v0.1.x Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Up Next
Development

No branches or pull requests

3 participants