1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-26 23:04:49 +03:00

fixup linux build for changes I made over on macOS

This commit is contained in:
Wez Furlong 2019-02-22 15:58:19 -08:00
parent 332b0faeaa
commit 7277559abc
3 changed files with 9 additions and 3 deletions

View File

@ -195,6 +195,7 @@ impl TextStyle {
}
pub fn font_with_fallback(&self) -> Vec<FontAttributes> {
#[allow(unused_mut)]
let mut font = self.font.clone();
#[cfg(target_os = "macos")]
font.push(FontAttributes {

View File

@ -18,7 +18,12 @@ impl FontConfigAndFreeType {
}
impl FontSystem for FontConfigAndFreeType {
fn load_font(&self, config: &Config, style: &TextStyle) -> Result<Box<NamedFont>, Error> {
fn load_font(
&self,
config: &Config,
style: &TextStyle,
font_scale: f64,
) -> Result<Box<NamedFont>, Error> {
let fonts = style.font_with_fallback();
let mut pattern = if fonts.len() >= 1 {
let mut pattern = FontPattern::new()?;
@ -41,7 +46,7 @@ impl FontSystem for FontConfigAndFreeType {
} else {
FontPattern::parse(&style.fontconfig_pattern)?
};
pattern.add_double("size", config.font_size)?;
pattern.add_double("size", config.font_size * font_scale)?;
pattern.add_double("dpi", config.dpi)?;
Ok(Box::new(NamedFontImpl::new(pattern)?))

View File

@ -257,7 +257,7 @@ impl GuiEventLoop {
// we always load the cell_height for font 0,
// regardless of which font we are shaping here,
// so that we can scale glyphs appropriately
let metrics = fontconfig.default_font_metrics();
let metrics = fontconfig.default_font_metrics()?;
let initial_cols = 80u16;
let initial_rows = 24u16;