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

Improve font handling and consistency #1442

Closed
saifahn opened this issue Sep 6, 2019 · 1 comment
Closed

Improve font handling and consistency #1442

saifahn opened this issue Sep 6, 2019 · 1 comment
Labels

Comments

@saifahn
Copy link

saifahn commented Sep 6, 2019

Outline

There are a few issues with fonts:

  • The fontFamily name is different between iOS and Android.
  • Fonts render differently on iOS and Android.
  • We do not support different font weights.

These may be separated into separate issues.

Different fontFamily name between OSs

  • on iOS, the fontFamily name is the 'PostScript name', which you can find in Font Book.(macOS)
  • on Android, the fontFamily will be the FILENAME of the font file.

It may be best to rename the font file to the PostScript name for consistency (and use react-native link again to update?) The logic within the src/styles/typography.ts file would need to be updated as well.

Some references:

Fonts render differently on iOS and Android.

It seems like there are various properties within font files that are either ignored or treated differently depending on the mobile OS.

  • This is probably why there are some issues with how text looks inside buttons; the vertical alignment is potentially thrown off because of the ascender property.
    • For the JolocomButton, the fix has been to use a hack-y magic number of 15 for paddingVertical to centre it vertically.

Ideally the font file could be edited so that we do not need to rely on magic numbers that vary for different-height buttons, and to keep consistency with Android.

Some references:

No font weight support

Our font currently only supports one fontWeight as we only include one weight in our project. This is not necessarily a problem if we do not intend on using different weights.

There is actually a problem with having a fontWeight > 400 on Android. If a greater fontWeight is used, it will revert to a default font in bold.

Proper support for Android is in a current pull request that has an iffy status

@SBub
Copy link
Contributor

SBub commented Sep 23, 2021

@saifahn Please check out the recent wallet release v2.2.0, from version 2 onwards we have consistent font

@SBub SBub closed this as completed Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants