try to implement fonts

This commit is contained in:
Rémi Colin
2024-02-14 17:12:47 +01:00
parent d654f9006c
commit d52d133bb9
8 changed files with 23 additions and 11 deletions

View File

@@ -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 = () => (
<TamaguiProvider config={tamaguiConfig}>
<TamaguiProvider config={myAppConfig}>
<App />
</TamaguiProvider>
);

View File

@@ -1,3 +1,7 @@
module.exports = {
assets: ['./src/fonts/'],
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts'],
};

View File

@@ -332,7 +332,7 @@ const MainScreen: React.FC<MainScreenProps> = ({
<Dialog.Title>Help</Dialog.Title>
<HelpCircle mt="$1" alignSelf='center' size="$2" />
</XStack>
<H3 mt="$3">How to scan your passport ?</H3>
<H3 fontFamily="Luciole" mt="$3">How to scan your passport ?</H3>
<YStack>
<Text>1. Find the location of the NFC chip of your passport.</Text>
<Text>If you are struggling <Text color="#3185FC">this post</Text> will help you to find it.</Text>

View File

@@ -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
export default myAppConfig