diff options
| author | Po Lu | 2023-12-26 14:09:42 +0800 |
|---|---|---|
| committer | Po Lu | 2023-12-26 14:10:57 +0800 |
| commit | 60199ac01d711d3240146afedd830b774eb5c5d2 (patch) | |
| tree | 5e964e9fa86210860ee5cc55692409fe0df1c1d6 /src | |
| parent | cd91ecedcbdf03ae13f45cb173360b11f13a0bc0 (diff) | |
| download | emacs-60199ac01d711d3240146afedd830b774eb5c5d2.tar.gz emacs-60199ac01d711d3240146afedd830b774eb5c5d2.zip | |
; * src/ftfont.c (ftfont_glyph_metrics): Comment on advance rounding.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftfont.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index d3c836c0f2d..46abe35ff9a 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -1572,6 +1572,12 @@ ftfont_glyph_metrics (FT_Face ft_face, int c, int *advance, int *lbearing, | |||
| 1572 | if (FT_Load_Glyph (ft_face, c, FT_LOAD_DEFAULT) == 0) | 1572 | if (FT_Load_Glyph (ft_face, c, FT_LOAD_DEFAULT) == 0) |
| 1573 | { | 1573 | { |
| 1574 | FT_Glyph_Metrics *m = &ft_face->glyph->metrics; | 1574 | FT_Glyph_Metrics *m = &ft_face->glyph->metrics; |
| 1575 | |||
| 1576 | /* At first glance this might appear to truncate the glyph's | ||
| 1577 | horizontal advance, but FreeType internally rounds the | ||
| 1578 | advance width to a pixel boundary prior to returning these | ||
| 1579 | metrics. */ | ||
| 1580 | |||
| 1575 | *advance = m->horiAdvance >> 6; | 1581 | *advance = m->horiAdvance >> 6; |
| 1576 | *lbearing = m->horiBearingX >> 6; | 1582 | *lbearing = m->horiBearingX >> 6; |
| 1577 | *rbearing = (m->horiBearingX + m->width) >> 6; | 1583 | *rbearing = (m->horiBearingX + m->width) >> 6; |