Extract platform-dependant FontSystem

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-03-24 16:51:28 +01:00
co-authored by Nathan Sobo
parent e0e4cff815
commit 9178e91cc0
17 changed files with 453 additions and 399 deletions
+3 -6
View File
@@ -109,12 +109,9 @@ impl Element for Label {
colors = vec![(0..text_len, ColorU::black())];
}
let line = ctx.text_layout_cache.layout_str(
self.text.as_str(),
self.font_size,
styles.as_slice(),
ctx.font_cache,
);
let line =
ctx.text_layout_cache
.layout_str(self.text.as_str(), self.font_size, styles.as_slice());
let size = vec2f(
line.width.max(constraint.min.x()).min(constraint.max.x()),