From d52d133bb951241c25787e876ee70feed6dee495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Colin?= Date: Wed, 14 Feb 2024 17:12:47 +0100 Subject: [PATCH] try to implement fonts --- .../fonts/Luciole-Bold-Italic.ttf | Bin app/{src => assets}/fonts/Luciole-Bold.ttf | Bin .../fonts/Luciole-Regular-Italic.ttf | Bin app/{src => assets}/fonts/Luciole-Regular.ttf | Bin app/index.js | 5 ++++- app/react-native.config.js | 6 ++++- app/src/screens/MainScreen.tsx | 2 +- app/tamagui.config.ts | 21 +++++++++++------- 8 files changed, 23 insertions(+), 11 deletions(-) rename app/{src => assets}/fonts/Luciole-Bold-Italic.ttf (100%) rename app/{src => assets}/fonts/Luciole-Bold.ttf (100%) rename app/{src => assets}/fonts/Luciole-Regular-Italic.ttf (100%) rename app/{src => assets}/fonts/Luciole-Regular.ttf (100%) diff --git a/app/src/fonts/Luciole-Bold-Italic.ttf b/app/assets/fonts/Luciole-Bold-Italic.ttf similarity index 100% rename from app/src/fonts/Luciole-Bold-Italic.ttf rename to app/assets/fonts/Luciole-Bold-Italic.ttf diff --git a/app/src/fonts/Luciole-Bold.ttf b/app/assets/fonts/Luciole-Bold.ttf similarity index 100% rename from app/src/fonts/Luciole-Bold.ttf rename to app/assets/fonts/Luciole-Bold.ttf diff --git a/app/src/fonts/Luciole-Regular-Italic.ttf b/app/assets/fonts/Luciole-Regular-Italic.ttf similarity index 100% rename from app/src/fonts/Luciole-Regular-Italic.ttf rename to app/assets/fonts/Luciole-Regular-Italic.ttf diff --git a/app/src/fonts/Luciole-Regular.ttf b/app/assets/fonts/Luciole-Regular.ttf similarity index 100% rename from app/src/fonts/Luciole-Regular.ttf rename to app/assets/fonts/Luciole-Regular.ttf diff --git a/app/index.js b/app/index.js index b3f5872a6..7b16ad0c3 100644 --- a/app/index.js +++ b/app/index.js @@ -8,11 +8,14 @@ import { name as appName } from './app.json'; import { TamaguiProvider } from 'tamagui'; import { createTamagui } from 'tamagui'; import { config } from '@tamagui/config/v2-native' +import myAppConfig from './tamagui.config'; + + const tamaguiConfig = createTamagui(config) const Root = () => ( - + ); diff --git a/app/react-native.config.js b/app/react-native.config.js index 1d72cf810..d1b5d0964 100644 --- a/app/react-native.config.js +++ b/app/react-native.config.js @@ -1,3 +1,7 @@ module.exports = { - assets: ['./src/fonts/'], + project: { + ios: {}, + android: {}, + }, + assets: ['./assets/fonts'], }; \ No newline at end of file diff --git a/app/src/screens/MainScreen.tsx b/app/src/screens/MainScreen.tsx index 0fd2fdcb4..13ec94118 100644 --- a/app/src/screens/MainScreen.tsx +++ b/app/src/screens/MainScreen.tsx @@ -332,7 +332,7 @@ const MainScreen: React.FC = ({ Help -

How to scan your passport ?

+

How to scan your passport ?

1. Find the location of the NFC chip of your passport. If you are struggling this post will help you to find it. diff --git a/app/tamagui.config.ts b/app/tamagui.config.ts index d2936b387..3ee2530b8 100644 --- a/app/tamagui.config.ts +++ b/app/tamagui.config.ts @@ -1,5 +1,5 @@ -import { config } from '@tamagui/config/v3' -import { createTamagui, createFont } from 'tamagui' // or '@tamagui/core' +import { config } from '@tamagui/config/v2-native' +import { createTamagui, createFont } from 'tamagui' export type AppConfig = typeof appConfig @@ -41,15 +41,20 @@ const Luciole = createFont({ }, }) -// Extend the existing config with your fonts -const extendedConfig = { + +const extendedConfig = createTamagui({ ...config, fonts: { ...config.fonts, - Luciole, // Add the Luciole font to your configuration + // Replace or add the 'Luciole' font as needed. Assuming 'body' is a key you want to replace/add. + body: Luciole, + heading: Luciole, + // If you have other font roles (e.g., 'heading'), you might want to add or replace them here as well. }, -} -const appConfig = createTamagui(extendedConfig) + // Include any other customizations to the config here +}); + +const myAppConfig = createTamagui(extendedConfig) -export default appConfig \ No newline at end of file +export default myAppConfig \ No newline at end of file