mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
Adding workaround for Variable Fonts causing too wide letter spacing
This commit is contained in:
parent
dbd1d6ece0
commit
08f137a8a0
@ -15,6 +15,8 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
|
||||
|
||||
### Changelog:
|
||||
|
||||
2021-04-21 - Added (temporary?) hack for Variable Fonts (VT) support
|
||||
|
||||
2021-03-10 - Added sixel support
|
||||
|
||||
2021-02-26 - Added the dynamic cursor color patch
|
||||
@ -172,6 +174,12 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the
|
||||
- [wide-glyphs](https://www.reddit.com/r/suckless/comments/jt90ai/update_support_for_proper_glyph_rendering_in_st/)
|
||||
- adds proper support for wide glyphs, as opposed to rendering smaller or cut glyphs
|
||||
|
||||
- [wide-glyph-spacing](https://github.com/googlefonts/Inconsolata/issues/42#issuecomment-737508890)
|
||||
- there is a known issue that Google's Variable Fonts (VF) can end up with letter spacing
|
||||
that is too wide in programs that use Xft, for example Inconsolata v3.000
|
||||
- this is intended as a temporary workaround / patch / hack until (if) this is fixed in the
|
||||
Xft library itself
|
||||
|
||||
- [workingdir](https://st.suckless.org/patches/workingdir/)
|
||||
- allows user to specify the initial path st should use as the working directory
|
||||
|
||||
|
@ -272,6 +272,16 @@
|
||||
*/
|
||||
#define WIDE_GLYPHS_PATCH 0
|
||||
|
||||
/* There is a known issue that Google's Variable Fonts (VF) can end up with letter spacing
|
||||
* that is too wide in programs that use Xft, for example Inconsolata v3.000.
|
||||
*
|
||||
* This is intended as a temporary patch / hack until (if) this is fixed in the Xft library
|
||||
* itself.
|
||||
*
|
||||
* https://github.com/googlefonts/Inconsolata/issues/42#issuecomment-737508890
|
||||
*/
|
||||
#define WIDE_GLYPH_SPACING_PATCH 0
|
||||
|
||||
/* This patch allows user to specify the initial path st should use as the working directory.
|
||||
* https://st.suckless.org/patches/workingdir/
|
||||
*/
|
||||
|
4
x.c
4
x.c
@ -1025,7 +1025,11 @@ xloadfont(Font *f, FcPattern *pattern)
|
||||
f->rbearing = f->match->max_advance_width;
|
||||
|
||||
f->height = f->ascent + f->descent;
|
||||
#if WIDE_GLYPH_SPACING_PATCH
|
||||
f->width = DIVCEIL(extents.xOff > 18 ? extents.xOff / 3 : extents.xOff, strlen(ascii_printable));
|
||||
#else
|
||||
f->width = DIVCEIL(extents.xOff, strlen(ascii_printable));
|
||||
#endif //WIDE_GLYPH_SPACING_PATCH
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user