Re: [dev] [st] bitmap font and chscale 1< line drawing bug

2016-09-08 Thread lemon
On Wed, Sep 07, 2016 at 09:39:08PM -0700, Eric Pruitt wrote:
> Even if you don't debug and / or fix the problem, at least post the
> offending commit, and I will take a look.

I was able to fix it the problem by rolling back part of commit
528241aa3835e2f1f052abeeaf891737712955a0
and all of 
0e48a1995eee1c2babc58523ef0be296e4b1c3e8

Here is my patch, it works with my setup but I haven't tested it
rigorously. 

diff --git a/st.c b/st.c
index 2594c65..ca126d7 100644
--- a/st.c
+++ b/st.c
@@ -3345,6 +3346,9 @@ xloadfonts(char *fontstr, double fontsize)
defaultfontsize = usedfontsize;
}
 
+   FcConfigSubstitute(0, pattern, FcMatchPattern);
+   FcDefaultSubstitute(pattern);
+
if (xloadfont(, pattern))
die("st: can't open font %s\n", fontstr);
 
@@ -3667,7 +3671,7 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph 
*glyphs, int len, int x
specs[numspecs].font = frc[f].font;
specs[numspecs].glyph = glyphidx;
specs[numspecs].x = (short)xp;
-   specs[numspecs].y = (short)yp;
+   specs[numspecs].y = (short)(winy + frc[f].font->ascent);
xp += runewidth;
numspecs++;
}

--
lemon




Re: [dev] [st] bitmap font and chscale 1< line drawing bug

2016-09-07 Thread lemon
On Wed, Sep 07, 2016 at 06:02:53PM -0700, Eric Pruitt wrote:
> On Wed, Sep 07, 2016 at 06:01:48PM -0700, Eric Pruitt wrote:
> > On Wed, Sep 07, 2016 at 05:51:49PM -0700, le...@bitmessage.ch wrote:
> > > After moving to st-0.7, I am experiencing a bug with line drawing. When
> > > using a bitmap font (eg terminus) and a chscale=1.2 in config.h, every
> > > vertical line has gaps in it (ex tree or tmux). This persists for 
> > > different
> > > bitmap fonts
> > > but goes away when chscale is set to 1.0.
> >
> > Did this not happen before st-0.7? I implemented the ch* factors in a
> > simple way just to control the invisible bounding boxes for each
> > character, and they don't scale the font itself; the behavior you're
> > seeing is working as intended, and it's also what I observed when I was
> > testing the feature and experimented with different scaling factors. I
> > have noticed that on some operating systems, even using the exact same
> > st compile options and fonts, I get slightly different results -- on my
> > work computer, there are 1-pixel gaps between vertical lines (not pipe
> > but "│"), but at home, the gaps aren't there. I don't find this annoying
> > enough to invest any effort into figuring out why that happens despite
> > both computers being Debian-based.
> 
> Also, if this doesn't happen in earlier versions, you could use
> git-bisect (https://git-scm.com/docs/git-bisect) to figure out which
> commit introduced the problem.
> 
> Eric
 
This did not happen in st-0.6. Okay I'll check out git-bisect and see if
I can figure it out. I'll submit a patch or pull request if I find a
solution. Thanks.

lemon




[dev] [st] bitmap font and chscale 1< line drawing bug

2016-09-07 Thread lemon
After moving to st-0.7, I am experiencing a bug with line drawing. When
using a bitmap font (eg terminus) and a chscale=1.2 in config.h, every
vertical line has gaps in it (ex tree or tmux). This persists for different 
bitmap fonts
but goes away when chscale is set to 1.0. 

gcc version 5.4.0 (CRUX-x86_64-multilib)
ncurses version 6.0