mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-06 01:40:22 -05:00
render: use FreeType face from font, instead of from cairo's scaled font
This commit is contained in:
parent
cb02c9cf41
commit
27dca15caf
1 changed files with 2 additions and 6 deletions
8
render.c
8
render.c
|
|
@ -315,20 +315,18 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell,
|
||||||
if (res != 1)
|
if (res != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FT_Face ft_face = cairo_ft_scaled_font_lock_face(font->font);
|
FT_Face ft_face = font->face;
|
||||||
|
|
||||||
FT_UInt glyph_idx = FT_Get_Char_Index(ft_face, wc);
|
FT_UInt glyph_idx = FT_Get_Char_Index(ft_face, wc);
|
||||||
FT_Error ft_err = FT_Load_Glyph(ft_face, glyph_idx, FT_LOAD_DEFAULT);
|
FT_Error ft_err = FT_Load_Glyph(ft_face, glyph_idx, FT_LOAD_DEFAULT);
|
||||||
if (ft_err != 0) {
|
if (ft_err != 0) {
|
||||||
LOG_ERR("FT_Load_Glyph");
|
LOG_ERR("FT_Load_Glyph");
|
||||||
cairo_ft_scaled_font_unlock_face(font->font);
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
ft_err = FT_Render_Glyph(ft_face->glyph, FT_RENDER_MODE_NORMAL);
|
ft_err = FT_Render_Glyph(ft_face->glyph, FT_RENDER_MODE_NORMAL);
|
||||||
if (ft_err != 0) {
|
if (ft_err != 0) {
|
||||||
LOG_ERR("FT_Render_Glyph");
|
LOG_ERR("FT_Render_Glyph");
|
||||||
cairo_ft_scaled_font_unlock_face(font->font);
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -366,7 +364,7 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell,
|
||||||
copy[r * stride + c] = bitmap->buffer[r * bitmap->pitch + c];
|
copy[r * stride + c] = bitmap->buffer[r * bitmap->pitch + c];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_ERR("unimplemented FT bitmap pixel mode: %d", bitmap->pixel_mode);
|
LOG_ERR("unimplemented FT bitmap pixel mode: %d", bitmap->pixel_mode);
|
||||||
abort();
|
abort();
|
||||||
|
|
@ -387,8 +385,6 @@ render_cell(struct terminal *term, struct buffer *buf, const struct cell *cell,
|
||||||
e->left = left;
|
e->left = left;
|
||||||
e->top = top;
|
e->top = top;
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_ft_scaled_font_unlock_face(font->font);
|
|
||||||
} else {
|
} else {
|
||||||
glyph = e->surf;
|
glyph = e->surf;
|
||||||
left = e->left;
|
left = e->left;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue