我想使用特殊字体生成 R-Diagrams,即 Cormorant-Garamond-Light(Cormorant-Light 也是可能的)。问题是它适用于所有其他字体,但对于这种字体,所有空格都将被忽略。
library(ggplot2)
library(extrafont)
data = data.frame(read.table(file="PATH/TO/FILE"))
p = ggplot(data = data, aes(x = data[1], y = data[2]))
p = p + xlab("Time t/s")
p = p + ylab("Temperature T/°C")
p = p + theme(text = element_text(family = "Cormorant Garamond Light"))
Run Code Online (Sandbox Code Playgroud)
编译后,有一个警告,其中包含以下内容:
1: 在 grid.Call(L_textBounds, as.graphicsAnnot(x$label), ... : 字符 0x20 的字体宽度未知
生成的 pdf 文件如下所示(代码被缩短以使其更快阅读) 上面代码的编译 pdf
感谢您的潜在帮助!
使用 Material-UI,Masonry 组件的宽度不会填充父容器的宽度。这个缺失空间的宽度正是间距的宽度,如果它旁边有一个元素,这是有意义的。
我尝试将砌体的宽度计算为 Box 元素的宽度加上 8 * 间距,但是一旦涉及滚动条,这种情况就会中断。
如何使用 Masonry 容器的整个宽度?
mwe(只是文档中的一个示例,顶部添加了一个 Box):
const heights = [150, 30, 90, 70, 110, 150, 130, 80, 50, 90, 100, 150, 30, 50, 80];
const Item = styled(Paper)(({ theme }) => ({
...theme.typography.body2,
color: theme.palette.text.secondary,
border: '1px solid black',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}));
<Container>
<Box style={{ border: '1px solid black', padding: '20px' }}>
<Typography variant="h5">
An Element to show the width of the contianer
</Typography>
</Box>
<Box style={{ marginTop: …Run Code Online (Sandbox Code Playgroud)