mirror of
https://github.com/wez/wezterm.git
synced 2024-11-24 07:46:59 +03:00
more dyn courtesy of cargo +nightly fix
This commit is contained in:
parent
b43c207167
commit
0a1dd49409
@ -48,7 +48,7 @@ impl FontSystem for CoreTextSystem {
|
|||||||
config: &Config,
|
config: &Config,
|
||||||
style: &TextStyle,
|
style: &TextStyle,
|
||||||
font_scale: f64,
|
font_scale: f64,
|
||||||
) -> Result<Box<NamedFont>, Error> {
|
) -> Result<Box<dyn NamedFont>, Error> {
|
||||||
let mut fonts = Vec::new();
|
let mut fonts = Vec::new();
|
||||||
for font_attr in style.font_with_fallback() {
|
for font_attr in style.font_with_fallback() {
|
||||||
let col = match create_for_family(&font_attr.family) {
|
let col = match create_for_family(&font_attr.family) {
|
||||||
@ -80,11 +80,11 @@ impl FontSystem for CoreTextSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NamedFont for NamedFontImpl {
|
impl NamedFont for NamedFontImpl {
|
||||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> {
|
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> {
|
||||||
self.fonts
|
self.fonts
|
||||||
.get(idx)
|
.get(idx)
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let f: &Font = f;
|
let f: &dyn Font = f;
|
||||||
f
|
f
|
||||||
})
|
})
|
||||||
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
||||||
|
@ -36,7 +36,7 @@ impl FontSystem for FontLoaderAndFreeType {
|
|||||||
config: &Config,
|
config: &Config,
|
||||||
style: &TextStyle,
|
style: &TextStyle,
|
||||||
font_scale: f64,
|
font_scale: f64,
|
||||||
) -> Result<Box<NamedFont>, Error> {
|
) -> Result<Box<dyn NamedFont>, Error> {
|
||||||
let mut lib = ftwrap::Library::new()?;
|
let mut lib = ftwrap::Library::new()?;
|
||||||
// Some systems don't support this mode, so if it fails, we don't
|
// Some systems don't support this mode, so if it fails, we don't
|
||||||
// care to abort the rest of what we're doing
|
// care to abort the rest of what we're doing
|
||||||
@ -70,11 +70,11 @@ impl FontSystem for FontLoaderAndFreeType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NamedFont for NamedFontImpl {
|
impl NamedFont for NamedFontImpl {
|
||||||
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> {
|
fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> {
|
||||||
self.fonts
|
self.fonts
|
||||||
.get(idx)
|
.get(idx)
|
||||||
.map(|f| {
|
.map(|f| {
|
||||||
let f: &Font = f;
|
let f: &dyn Font = f;
|
||||||
f
|
f
|
||||||
})
|
})
|
||||||
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
.ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))
|
||||||
|
Loading…
Reference in New Issue
Block a user