Update web font families def (#5749)
(cherry picked from commit db7b875c52)
This commit is contained in:
+3
-3
@@ -4,7 +4,7 @@ import {useFonts} from 'expo-font'
|
|||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {Device, device} from '#/storage'
|
import {Device, device} from '#/storage'
|
||||||
|
|
||||||
const FAMILIES = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Liberation Sans", Helvetica, Arial, sans-serif`
|
const WEB_FONT_FAMILIES = `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"`
|
||||||
|
|
||||||
const factor = 0.0625 // 1 - (15/16)
|
const factor = 0.0625 // 1 - (15/16)
|
||||||
const fontScaleMultipliers: Record<Device['fontScale'], number> = {
|
const fontScaleMultipliers: Record<Device['fontScale'], number> = {
|
||||||
@@ -48,7 +48,7 @@ export function applyFonts(style: TextStyle, fontFamily: 'system' | 'theme') {
|
|||||||
|
|
||||||
// fallback families only supported on web
|
// fallback families only supported on web
|
||||||
if (isWeb) {
|
if (isWeb) {
|
||||||
style.fontFamily += `, ${FAMILIES}`
|
style.fontFamily += `, ${WEB_FONT_FAMILIES}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +59,7 @@ export function applyFonts(style: TextStyle, fontFamily: 'system' | 'theme') {
|
|||||||
} else {
|
} else {
|
||||||
// fallback families only supported on web
|
// fallback families only supported on web
|
||||||
if (isWeb) {
|
if (isWeb) {
|
||||||
style.fontFamily = style.fontFamily || FAMILIES
|
style.fontFamily = style.fontFamily || WEB_FONT_FAMILIES
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user