I'm submitting a ... (check one with "x")
Current behavior:
I can't use a third font as a default font for UI Kitten.
Expected behavior:
I can use a third font as a default font for UI Kitten.
Hi! Currently, you can do this with custom mapping
import React from 'react';
import { mapping, light as theme } from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
const strictTheme = { ['text-font-family']: 'OpenSans' }; // <-- Your Font
const customMapping = { strict: strictTheme };
const App = () => (
<ApplicationProvider
mapping={mapping}
theme={theme}
customMapping={customMapping}
/>
);
export default App;
Thanks 馃檹 @artyorsh .
Hey @artyorsh, I tried your solution but this only applies for <Text category='p1' />, another component has text not applied. How to resolve for this case?
import React from 'react';
import { mapping, light as theme } from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
const customMapping = {
...mapping,
strict: {
...mapping.strict,
'text-font-family': 'dosis-regular'
}
};
const App = () => (
<ApplicationProvider
mapping={customMapping}
theme={theme}
/>
);
export default App;

@cuongw just follow my code. You do not need to merge it with default mapping since this will be done by UI Kitten
@artyorsh you have a little typo in your snippet:
const customMapping = { strict: scrictTheme };
should be
const customMapping = { strict: strictTheme };
Hello,
What about use different font weight?
this is my custom-mapping.json
{
"strict": {
"text-font-family": "Montserrat"
}
}
Then in my App.js
await Font.loadAsync({
Montserrat: require('./assets/fonts/Montserrat-Medium.ttf')
})
But all my <Text> elements show with Montserrat-Medium.ttf font.
How can I set up different weights?
Thank you
@jgutierro shows medium because you load medium? 馃What do you expect?
@artyorsh as I said in my last question: How can I set up different weights?
For example I would like to show a bold version of Montserrat all over <Text category='label'>
You may use custom mapping and add fontFamily for each category variant.
See the original implementation here
Thank you so much Artur!
Most helpful comment
Hi! Currently, you can do this with custom mapping