1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(freetype): fix outline font being cropped (#6639)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX 2024-08-06 16:23:43 +08:00 committed by GitHub
parent bd7ef59034
commit 7e3be59dda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -137,7 +137,7 @@ static bool freetype_glyph_create_cb(lv_freetype_glyph_cache_data_t * data, void
FT_UInt glyph_index = FT_Get_Char_Index(face, data->unicode);
FT_Set_Pixel_Sizes(face, 0, dsc->size);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_COMPUTE_METRICS | FT_LOAD_NO_BITMAP);
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_COMPUTE_METRICS | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT);
if(error) {
FT_ERROR_MSG("FT_Load_Glyph", error);
lv_mutex_unlock(&dsc->cache_node->face_lock);

View File

@ -128,7 +128,7 @@ static bool freetype_image_create_cb(lv_freetype_image_cache_data_t * data, void
FT_Face face = dsc->cache_node->face;
FT_Set_Pixel_Sizes(face, 0, dsc->size);
error = FT_Load_Glyph(face, data->glyph_index, FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL);
error = FT_Load_Glyph(face, data->glyph_index, FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_AUTOHINT);
if(error) {
FT_ERROR_MSG("FT_Load_Glyph", error);
lv_mutex_unlock(&dsc->cache_node->face_lock);

View File

@ -303,8 +303,11 @@ static lv_freetype_outline_t outline_create(
return NULL;
}
/* Load glyph */
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP);
/**
* Disable AUTOHINT(https://freetype.org/autohinting/hinter.html) to avoid display clipping
* caused by inconsistent glyph measurement and outline.
*/
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT | FT_LOAD_NO_BITMAP | FT_LOAD_NO_AUTOHINT);
if(error) {
FT_ERROR_MSG("FT_Load_Glyph", error);
return NULL;