Open Codelica opened 2 years ago
After looking though the Eva mapping.json file Button section further, I found the issue. Basically the textFontFamily
is set to text-font-family
, which is in turn set to OpenSans-Regular
for me.
...
"appearances": {
"filled": {
"mapping": {
"textFontFamily": "text-font-family",
"iconMarginHorizontal": 4
},
...
However, later the textFontWeight
for all the button sizes is set to bold
. So it seems that Android's font renderer must be able to manually "bold" OpenSans-Regular where iOS doesn't. By setting textFontFamily
to OpenSans-Bold
things are not consistent for me. π
I'm facing the same issue without using Expo. I'm wondering, did you find a solution @Codelica or should I use a wrapper to make font styles consistent in both platforms IOS and Android?
@lbuttignol in the end my issue was that some styles were requesting bold styling from OpenSans-Regular
which Android tried to accommodate by adding some stroke weight where iOS didn't. By setting those areas to OpenSans-Bold
, both were bolded as expected. If that's what you're running into, you should be able to normalize things with a "component mapping" for Kitten UI. For me it was adding a section like this that gets merged into ApplicationProvider
, since I was only really seeing it in the filled buttons.
...
"components": {
"Button": {
"meta": {
"scope": "all",
"appearances": {},
"parameters": {},
"states": {},
"variantGroups": {}
},
"appearances": {
"filled": {
"mapping": {
"textFontFamily": "OpenSans-Bold"
},
}
}
},
...
Does somebody find any solution yet?
π¬ Question
My Expo/RN app is setup to user OpenSans per instructions and after adding font-family info to my mapping file (for all text styles) everything is very consistent across iOS and Android -- except for Button text.
As mentioned, I do have OpenSans installed, loaded during startup, and configured with the following mapping:
However when doing a simple
<Button>Text</Button>
the results seem inconsistent across platforms. The following screenshot was taken with the following code:I left a little "calendar event time" section from the app below it just to show that text is very consistent otherwise.
From the sample you can see that I can make things consistent by using a function component wrapper, but am curious if I have something wrong before having to do that throughout ?
Thanks.. Kitten is awesome :)
UI Kitten and Eva version