diff --git a/android/app/src/main/assets/fonts/Inter-UI-Bold.otf b/android/app/src/main/assets/fonts/Inter-UI-Bold.otf new file mode 100644 index 0000000000..8ad8834884 Binary files /dev/null and b/android/app/src/main/assets/fonts/Inter-UI-Bold.otf differ diff --git a/android/app/src/main/assets/fonts/Inter-UI-Medium.otf b/android/app/src/main/assets/fonts/Inter-UI-Medium.otf new file mode 100644 index 0000000000..9bec8934bb Binary files /dev/null and b/android/app/src/main/assets/fonts/Inter-UI-Medium.otf differ diff --git a/android/app/src/main/assets/fonts/Inter-UI-Regular.otf b/android/app/src/main/assets/fonts/Inter-UI-Regular.otf new file mode 100644 index 0000000000..287135d400 Binary files /dev/null and b/android/app/src/main/assets/fonts/Inter-UI-Regular.otf differ diff --git a/components/src/status_im/ui/components/react.cljs b/components/src/status_im/ui/components/react.cljs index 83b83815ed..eb190ecea2 100644 --- a/components/src/status_im/ui/components/react.cljs +++ b/components/src/status_im/ui/components/react.cljs @@ -82,12 +82,13 @@ (def slider (get-class "Slider")) ;; Accessor methods for React Components -(defn add-font-style [style-key {:keys [font] :as opts :or {font :default}}] - (let [font (get-in platform/platform-specific [:fonts (keyword font)]) - style (get opts style-key)] +(def default-font {:font-family "Inter UI"}) + +(defn add-font-style [style-key opts] + (let [style (get opts style-key)] (-> opts (dissoc :font) - (assoc style-key (merge style font))))) + (assoc style-key (merge default-font style))))) (defn transform-to-uppercase [{:keys [uppercase? force-uppercase?]} ts] (if (or force-uppercase? (and uppercase? platform/android?)) @@ -103,17 +104,15 @@ (concat [text-class (add-font-style :style opts)]) (vec)))) -(defn text-input [{:keys [font style] :as opts - :or {font :default}} text] - (let [font (get-in platform/platform-specific [:fonts (keyword font)])] - [text-input-class (merge - {:underline-color-android :transparent - :placeholder-text-color colors/text-gray - :placeholder (i18n/label :t/type-a-message) - :value text} - (-> opts - (dissoc :font) - (assoc :style (merge style font))))])) +(defn text-input [{:keys [style] :as opts} text] + [text-input-class (merge + {:underline-color-android :transparent + :placeholder-text-color colors/text-gray + :placeholder (i18n/label :t/type-a-message) + :value text} + (-> opts + (dissoc :font) + (assoc :style (merge default-font style))))]) (defn i18n-text [{:keys [style key]}] diff --git a/desktop_files/package.json b/desktop_files/package.json index dea40e7d88..2d9398a5c7 100644 --- a/desktop_files/package.json +++ b/desktop_files/package.json @@ -20,9 +20,9 @@ "node_modules/google-breakpad" ], "desktopFonts": [ - "../../../../../resources/fonts/SF-Pro-Text-Regular.otf", - "../../../../../resources/fonts/SF-Pro-Text-Medium.otf", - "../../../../../resources/fonts/SF-Pro-Text-Light.otf" + "../../../../../resources/fonts/Inter-UI-Bold.otf", + "../../../../../resources/fonts/Inter-UI-Medium.otf", + "../../../../../resources/fonts/Inter-UI-Regular.otf" ], "dependencies": { "@babel/core": "7.0.1", diff --git a/ios/StatusIm.xcodeproj/project.pbxproj b/ios/StatusIm.xcodeproj/project.pbxproj index b20954165e..1f0cdfd8be 100644 --- a/ios/StatusIm.xcodeproj/project.pbxproj +++ b/ios/StatusIm.xcodeproj/project.pbxproj @@ -30,6 +30,9 @@ 3E15DFEC1F6F4D7CAE088F49 /* libTcpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C2A4E93F6B154AEFA3485B45 /* libTcpSockets.a */; }; 475D202F20B7450D00879A77 /* libRNFirebase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 475D1FC020B7413500879A77 /* libRNFirebase.a */; }; 4C16DE0C1F89508700AA10DB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */; }; + 55C386232185E83600B7A324 /* Inter-UI-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 55C386202185E83600B7A324 /* Inter-UI-Medium.otf */; }; + 55C386242185E83600B7A324 /* Inter-UI-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 55C386212185E83600B7A324 /* Inter-UI-Regular.otf */; }; + 55C386252185E83600B7A324 /* Inter-UI-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 55C386222185E83600B7A324 /* Inter-UI-Bold.otf */; }; 74B758FC20D7C00B003343C3 /* launch-image-universal.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 74B758FB20D7C00B003343C3 /* launch-image-universal.storyboard */; }; 81C6E6AE0AA739BE9D87C1D0 /* libPods-StatusImTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FC1CBCFE6C906043D6CCEEE1 /* libPods-StatusImTests.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; @@ -519,6 +522,9 @@ 4E586E1B0E544F64AA9F5BD1 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 52F6ED6465184513A082652B /* libRNI18n.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNI18n.a; sourceTree = ""; }; 5535217F57E44D77AA9CF083 /* libRCTOrientation.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTOrientation.a; sourceTree = ""; }; + 55C386202185E83600B7A324 /* Inter-UI-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Inter-UI-Medium.otf"; path = "fonts/Inter-UI-Medium.otf"; sourceTree = ""; }; + 55C386212185E83600B7A324 /* Inter-UI-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Inter-UI-Regular.otf"; path = "fonts/Inter-UI-Regular.otf"; sourceTree = ""; }; + 55C386222185E83600B7A324 /* Inter-UI-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "Inter-UI-Bold.otf"; path = "fonts/Inter-UI-Bold.otf"; sourceTree = ""; }; 5E5A7625B76441D984EA8C0D /* RCTImageResizer.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTImageResizer.xcodeproj; path = "../node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj"; sourceTree = ""; }; 674B3D9595A047AB8D518F4E /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = ""; }; 74B758FB20D7C00B003343C3 /* launch-image-universal.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "launch-image-universal.storyboard"; sourceTree = ""; }; @@ -736,6 +742,9 @@ 1E7837547A9A40E18AD63CF3 /* Resources */ = { isa = PBXGroup; children = ( + 55C386222185E83600B7A324 /* Inter-UI-Bold.otf */, + 55C386202185E83600B7A324 /* Inter-UI-Medium.otf */, + 55C386212185E83600B7A324 /* Inter-UI-Regular.otf */, 983F07442119C9D2004133ED /* message.wav */, 2028E0111D4275BD00227DCD /* SF */, B23B48FE1E76917B006D4535 /* RobotoMono-Medium.ttf */, @@ -1071,7 +1080,6 @@ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 20B6B6891D92C42700CC5C6A /* Embed Frameworks */, E3914A731DF919ED00EBB515 /* Run Script */, - D286FF71BA61530E740B7C82 /* Strip Frameworks */, ); buildRules = ( ); @@ -1653,8 +1661,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 55C386232185E83600B7A324 /* Inter-UI-Medium.otf in Resources */, 983F077E2119C9D2004133ED /* message.wav in Resources */, 74B758FC20D7C00B003343C3 /* launch-image-universal.storyboard in Resources */, + 55C386252185E83600B7A324 /* Inter-UI-Bold.otf in Resources */, + 55C386242185E83600B7A324 /* Inter-UI-Regular.otf in Resources */, B2F2D1BC1D9D531B00B7B453 /* Images.xcassets in Resources */, 92A0DF7D1F4DE3A4002051BC /* GoogleService-Info.plist in Resources */, ); @@ -1675,7 +1686,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -o errexit\nexport NODE_BINARY=\"node --max-old-space-size=8192\"\n../node_modules/react-native/scripts/react-native-xcode.sh"; + shellScript = "set -o errexit\nexport NODE_BINARY=\"node --max-old-space-size=8192\"\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; }; 2EAC54E16AB243C3EBBFE1BA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/ios/StatusIm/Info.plist b/ios/StatusIm/Info.plist index 0907cfe531..357e03c09f 100644 --- a/ios/StatusIm/Info.plist +++ b/ios/StatusIm/Info.plist @@ -96,6 +96,12 @@ ITSAppUsesNonExemptEncryption + UIAppFonts + + Inter-UI-Bold.otf + Inter-UI-Medium.otf + Inter-UI-Regular.otf + ITSEncryptionExportComplianceCode 1aa92c4d-6194-4d7d-b70a-16b48256b87e diff --git a/ios/fonts/Inter-UI-Bold.otf b/ios/fonts/Inter-UI-Bold.otf new file mode 100644 index 0000000000..8ad8834884 Binary files /dev/null and b/ios/fonts/Inter-UI-Bold.otf differ diff --git a/ios/fonts/Inter-UI-Medium.otf b/ios/fonts/Inter-UI-Medium.otf new file mode 100644 index 0000000000..9bec8934bb Binary files /dev/null and b/ios/fonts/Inter-UI-Medium.otf differ diff --git a/ios/fonts/Inter-UI-Regular.otf b/ios/fonts/Inter-UI-Regular.otf new file mode 100644 index 0000000000..287135d400 Binary files /dev/null and b/ios/fonts/Inter-UI-Regular.otf differ diff --git a/resources/fonts/Inter-UI-Bold.otf b/resources/fonts/Inter-UI-Bold.otf new file mode 100644 index 0000000000..8ad8834884 Binary files /dev/null and b/resources/fonts/Inter-UI-Bold.otf differ diff --git a/resources/fonts/Inter-UI-Medium.otf b/resources/fonts/Inter-UI-Medium.otf new file mode 100644 index 0000000000..9bec8934bb Binary files /dev/null and b/resources/fonts/Inter-UI-Medium.otf differ diff --git a/resources/fonts/Inter-UI-Regular.otf b/resources/fonts/Inter-UI-Regular.otf new file mode 100644 index 0000000000..287135d400 Binary files /dev/null and b/resources/fonts/Inter-UI-Regular.otf differ diff --git a/resources/fonts/SF-Pro-Text-Light.otf b/resources/fonts/SF-Pro-Text-Light.otf deleted file mode 100644 index d08708a857..0000000000 Binary files a/resources/fonts/SF-Pro-Text-Light.otf and /dev/null differ diff --git a/resources/fonts/SF-Pro-Text-Medium.otf b/resources/fonts/SF-Pro-Text-Medium.otf deleted file mode 100644 index 55701e2437..0000000000 Binary files a/resources/fonts/SF-Pro-Text-Medium.otf and /dev/null differ diff --git a/resources/fonts/SF-Pro-Text-Regular.otf b/resources/fonts/SF-Pro-Text-Regular.otf deleted file mode 100644 index 4eafc2c07d..0000000000 Binary files a/resources/fonts/SF-Pro-Text-Regular.otf and /dev/null differ diff --git a/scripts/build-desktop.sh b/scripts/build-desktop.sh index 16c42cce1e..f418ae4d2c 100755 --- a/scripts/build-desktop.sh +++ b/scripts/build-desktop.sh @@ -26,9 +26,9 @@ external_modules_dir=( \ ) external_fonts=( \ - '../../../../../resources/fonts/SF-Pro-Text-Regular.otf' \ - '../../../../../resources/fonts/SF-Pro-Text-Medium.otf' \ - '../../../../../resources/fonts/SF-Pro-Text-Light.otf' \ + '../../../../../resources/fonts/Inter-UI-Bold.otf' \ + '../../../../../resources/fonts/Inter-UI-Medium.otf' \ + '../../../../../resources/fonts/Inter-UI-Regular.otf' \ ) function is_macos() { diff --git a/src/status_im/android/platform.cljs b/src/status_im/android/platform.cljs index cfcb27d2a3..710f299e99 100644 --- a/src/status_im/android/platform.cljs +++ b/src/status_im/android/platform.cljs @@ -1,24 +1,4 @@ (ns status-im.android.platform) -(def fonts - {:default {:font-family "Roboto"} - :medium {:font-family "Roboto" :font-weight "500"} - :bold {:font-family "Roboto" - :font-weight "bold"} - :toolbar-title {:font-family "Roboto" :font-weight "500"} - :toolbar-subtitle {:font-family "Roboto"} - :monospace {:font-family "monospace" :font-weight "bold"}}) - -;; Structure to be exported - (def platform-specific - {:fonts fonts - :tabs {:tab-shadows? true} - :chats {:action-button? true - :new-chat-in-toolbar? false - :render-separator? false} - :contacts {:action-button? true - :new-contact-in-toolbar? false} - :group-block-shadows? true - :discover {:uppercase-subtitles? false} - :status-bar-default-height 25}) + {:status-bar-default-height 25}) diff --git a/src/status_im/desktop/platform.cljs b/src/status_im/desktop/platform.cljs index 343d33306e..cb4050472f 100644 --- a/src/status_im/desktop/platform.cljs +++ b/src/status_im/desktop/platform.cljs @@ -1,29 +1,6 @@ (ns status-im.desktop.platform) -(def fonts-macos - {:default {:font-family "SFProText-Regular"} - :medium {:font-family "SFProText-Medium"} - - :toolbar-title {:font-family "SFProText-Regular"} - :monospace {:font-family "RobotoMono-Medium"}}) - -(def fonts-linux - {:default {:font-family "Arial" :font-weight "400"} - :medium {:font-family "Arial" :font-weight "800"} - - :toolbar-title {:font-family "Arial" :font-weight "400"} - :monospace {:font-family "RobotoMono-Medium"}}) - ;; Structure to be exported -(defn platform-specific [macos] - {:fonts (if macos fonts-macos fonts-linux) - :tabs {:tab-shadows? true} - :chats {:action-button? true - :new-chat-in-toolbar? false - :render-separator? false} - :contacts {:action-button? true - :new-contact-in-toolbar? false} - :group-block-shadows? true - :discover {:uppercase-subtitles? false} - :status-bar-default-height 25}) +(def platform-specific + {:status-bar-default-height 25}) diff --git a/src/status_im/ios/platform.cljs b/src/status_im/ios/platform.cljs index 8fadef27fe..af1ba0edd6 100644 --- a/src/status_im/ios/platform.cljs +++ b/src/status_im/ios/platform.cljs @@ -1,16 +1,6 @@ (ns status-im.ios.platform (:require [status-im.react-native.js-dependencies :as rn-dependencies])) -(def fonts - {:default {:font-weight "normal"} - :medium {:font-weight "500" - :letter-spacing 1} - :bold {:font-weight "bold"} - :toolbar-title {:font-weight "bold"} - :toolbar-subtitle {:font-weight "normal"} - :monospace {:font-family "Menlo" - :font-weight "bold"}}) - ;; iPhone X dimensions (def x-height 812) (def xs-height 896) @@ -22,13 +12,4 @@ (or (= height x-height) (= height xs-height)))) (def platform-specific - {:fonts fonts - :tabs {:tab-shadows? false} - :chats {:action-button? false - :new-chat-in-toolbar? true - :render-separator? true} - :contacts {:action-button? false - :new-contact-in-toolbar? true} - :group-block-shadows? false - :discover {:uppercase-subtitles? true} - :status-bar-default-height (if (iphone-x-dimensions?) 0 20)}) + {:status-bar-default-height (if (iphone-x-dimensions?) 0 20)}) diff --git a/src/status_im/ui/screens/chat/input/utils.cljs b/src/status_im/ui/screens/chat/input/utils.cljs deleted file mode 100644 index 6fb4333040..0000000000 --- a/src/status_im/ui/screens/chat/input/utils.cljs +++ /dev/null @@ -1,19 +0,0 @@ -(ns status-im.ui.screens.chat.input.utils - (:require [taoensso.timbre :as log] - [status-im.ui.components.toolbar.styles :as toolbar-st] - [status-im.utils.platform :as p])) - -(def min-height 19) -(def default-height 300) - -(defn default-container-area-height [bottom screen-height] - (let [status-bar-height (get p/platform-specific :status-bar-default-height)] - (if (> (+ bottom default-height status-bar-height) screen-height) - (- screen-height bottom status-bar-height) - default-height))) - -(defn max-container-area-height [bottom screen-height] - (let [status-bar-height (get p/platform-specific :status-bar-default-height) - toolbar-height (:height toolbar-st/toolbar) - margin-top (+ status-bar-height (/ toolbar-height 2))] - (- screen-height bottom margin-top))) diff --git a/src/status_im/ui/screens/wallet/onboarding/setup/views.cljs b/src/status_im/ui/screens/wallet/onboarding/setup/views.cljs index 08c28dfe8f..0e54980b1e 100644 --- a/src/status_im/ui/screens/wallet/onboarding/setup/views.cljs +++ b/src/status_im/ui/screens/wallet/onboarding/setup/views.cljs @@ -17,7 +17,6 @@ (defn signing-word [word] [react/view styles/signing-word [react/text {:style styles/signing-word-text - :font :monospace :number-of-lines 1} word]]) diff --git a/src/status_im/utils/platform.cljs b/src/status_im/utils/platform.cljs index a7144c5d4f..08fad41b7a 100644 --- a/src/status_im/utils/platform.cljs +++ b/src/status_im/utils/platform.cljs @@ -28,7 +28,7 @@ (cond android? android/platform-specific ios? ios/platform-specific - :else (desktop/platform-specific (if platform (.-isMacOs platform) true)))) + :else desktop/platform-specific)) (defn no-backup-directory [] (cond