如何在文本字段中以粗体或斜体显示单个单词?有点像这样:
<Text>This is a sentence <b>with</b> one word in bold</Text>
Run Code Online (Sandbox Code Playgroud)
如果我为粗体字符创建一个新的文本字段,它会将它分成另一行,这样肯定不是这样做的.这就像在<p>标签中创建<p>标签只是为了使一个单词变为粗体.
我正在尝试在 react-pdf 中使用斜体样式。
一切正常,直到我使用font-style: italic;.
在 react-pdf 中是否有另一种方式将文本样式设置为斜体?
const Italic = styled.Text`
font-size: 12px;
lineheight: 20px;
text-align: left;
font-family: "Roboto Condensed";
letter-spacing: 0.5px;
font-style: italic;//problem is with this line
font-weight:400;
`;
Run Code Online (Sandbox Code Playgroud)
它给了我错误:
未捕获(承诺)错误:无法解析未定义的字体,fontWeight 400