React Native에서 컴포넌트에 대한 모든 텍스트 노드를 줄 바꿈해야합니다.
확인 당신의 대답이이 공식 문서 : 어떤 목적을위한 Offical Doc
// we define available font weight and styles for each font here
const font = {
OpenSans: {
weights: {
ExtraBold: '800',
Bold: '700',
SemiBold: '600',
Light: '300',
Normal: '400'
},
styles: {
Italic: 'italic'
}
},
Verdana: ...,
Tahoma: ...,
...
}
// generate styles for a font with given weight and style
export const fontMaker = (options = {}) => {
let { weight, style, family } = Object.assign({
weight: null,
style: null,
family: 'OpenSans'
}, options)
const { weights, styles } = font[family]
if (Platform.OS === 'android') {
weight = weights[weight] ? weight : ''
style = styles[style] ? style : ''
const suffix = weight + style
return {
fontFamily: family + (suffix.length ? `-${suffix}` : '')
}
} else {
weight = weights[weight] || weights.Normal
style = styles[style] || 'normal'
return {
fontFamily: family,
fontWeight: weight,
fontStyle: style
}
}
}
Refernce
u는 하나의 단어에서 다른 글꼴 스타일을 사용하는 그게입니다 어떻게 하시겠습니까? –
@Adarsh Sreeram, 한 문장에 여러 바이트의 중국어 단어를 표시하고 싶습니다! 예를 들어, MidPlane00과 MidPlane02라는 두 개의 글꼴 파일이 있습니다. 서로 다른 중국어 단어가 포함되어 있습니다.이 두 단어가 하나 인 ' ' 글꼴을 그룹화하기 위해 fontFamily를 사용하는 것만으로 생각할 수 있습니다. –