NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Use 'Courier New' on iOS

Open craftzdog opened this issue 3 years ago • 10 comments

Summary

The Courier font was removed in iOS 15. 'Courier New' is available since iPhone OS 3.

Changelog

  • [iOS] [Fixed] - Use 'Courier New' font in Code and Kbd components

Test Plan

import { Code } from 'native-base'

<Code>App.tsx</Code>

Workaround

Currently, you have to specify font family like so:

<Code _text={{ fontFamily: 'Courier New' }}>App.tsx</Code>

craftzdog avatar Nov 03 '21 06:11 craftzdog

@craftzdog is attempting to deploy a commit to the Geekyants Team Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 03 '21 06:11 vercel[bot]

I just ran expo init my-app --template expo-template-native-base and received this error when running the app:

fontFamily "Courier" is not a system font and has not been loaded through Font.loadAsync.

I'm running iOS 15. This PR seems as if it would solve this issue. Thanks!

stdavis avatar Nov 24 '21 13:11 stdavis

why closed? :(

craftzdog avatar Dec 24 '21 02:12 craftzdog

Just for people like me who encounter the same issue after running expo init my-app --template expo-template-native-base as @stdavis mentioned, directly modify index files in "node_modules/native-base/src/**" like in this PR.

This shouldn't be the best but It shuts up errors in terminals and it helps me not being annoyed by the error til this PR is opened and merged. (keep in mind when you update packages, your modifycation will be removed or maybe this modification doen't do anything)

Hopefully this PR will be open and merged soon!

masafumimori avatar Jan 05 '22 12:01 masafumimori

https://www.npmjs.com/package/patch-package solves the issue of your changes being overwritten when you update your npm packages.

stdavis avatar Jan 05 '22 16:01 stdavis

Is there any update on the status of this PR?

lilsharu avatar Feb 08 '22 23:02 lilsharu

Some handy shell scripts while we wait for the PR to be merged

sed -i -e 's/Courier/Courier New/' ./node_modules/native-base/src/components/composites/Code/index.tsx
sed -i -e 's/Courier/Courier New/' ./node_modules/native-base/src/theme/components/code.ts
sed -i -e 's/Courier/Courier New/' ./node_modules/native-base/src/theme/components/kbd.ts

TheyCodeMeSilvers avatar Mar 31 '22 21:03 TheyCodeMeSilvers

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 30 '22 21:05 stale[bot]

It would be great if this PR was merged. Is there anything that I can do to help?

stdavis avatar May 31 '22 15:05 stdavis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '22 16:07 stale[bot]