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

Added monospace code font #4

Merged
merged 4 commits into from
May 1, 2022
Merged

Added monospace code font #4

merged 4 commits into from
May 1, 2022

Conversation

Nicholas-Sliter
Copy link
Contributor

Please test on ios

@waynew99
Copy link
Contributor

Please test on ios

According to GeekyAnts/nativebase-templates#19,

From iOS 15 onward, we need "Courier New" instead of "Courier". I also think making it bold with "Courier New" is better.

IMG_1303
IMG_1302

Copy link
Contributor

@waynew99 waynew99 left a comment

Choose a reason for hiding this comment

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

Thanks for finding the cool font!!

Hack: require("../../assets/fonts/Hack-Regular.ttf"),
});

const courierFont = Platform.Version >= 15 ? 'Courier New' : 'Courier';
Copy link
Contributor

Choose a reason for hiding this comment

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

I just tested on iOS. It seems like Platform.Version returns a string on Android and a number on iOS, which typescript complains about. And we can get the major version number from Platform.Version:
const courierFont = (Platform.OS === "ios" && parseInt(Platform.Version, 10)>=15) ? 'Courier New' : 'Courier';

Copy link
Contributor

@waynew99 waynew99 left a comment

Choose a reason for hiding this comment

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

Awesome!

@waynew99 waynew99 merged commit 7e1b033 into main May 1, 2022
@Nicholas-Sliter Nicholas-Sliter deleted the monospaceCode branch May 1, 2022 20:04
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.

2 participants