Closed GoogleCodeExporter closed 8 years ago
thanks for reporting this.
Can you attach the code for this? Thanks.
Original comment by olikr...@gmail.com
on 26 Jun 2014 at 7:39
It's slightly more complicated than I reported. It depends on following lines.
When I add another font the original line changes position.
Original comment by nottle...@gmail.com
on 26 Jun 2014 at 7:55
Hmmm... the attached example does not contain setFontPosTop().
Can you attach an example which actually demonstrates the problem?
Original comment by olikr...@gmail.com
on 26 Jun 2014 at 8:01
Sorry about that - dunno what went wrong. Try this ...
Original comment by nottle...@gmail.com
on 26 Jun 2014 at 8:03
Attachments:
ok, i have this:
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFontPosTop();
u8g.setFont(u8g_font_helvR08);
u8g.drawStr( 0, 0, "Hello World!");
// Try with/ without below lines
u8g.setFontPosTop();
u8g.setFont(u8g_font_profont11);
u8g.drawStr( 32, 25, "see yah!");
}
so the second drawStr is not working, right?
Original comment by olikr...@gmail.com
on 26 Jun 2014 at 8:24
No, it's the first one. If you comment out the 3 lines at the bottom then
"hello world" is printed at the top. If you then add the last 2 or three
lines (the second PosTop has no effect) the "hello world" disappears off the
top and you're just left with the "see yah!" line.
What happening is the reference position is moving back from top to baseline.
Original comment by nottle...@gmail.com
on 26 Jun 2014 at 8:31
ah, i see the problem. setFontPosTop must be used only after setting the font.
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFont(u8g_font_helvR08);
u8g.setFontPosTop();
u8g.drawStr( 0, 0, "Hello World!");
// Try with/ without below lines
u8g.setFont(u8g_font_profont11);
u8g.setFontPosTop();
u8g.drawStr( 32, 25, "see yah!");
}
Maybe i should be more clear in the documentation about this.
Original comment by olikr...@gmail.com
on 26 Jun 2014 at 8:33
I thought I'd tried that but you're right.
You probably need to fix this then:
http://code.google.com/p/u8glib/wiki/tstring
as that's what I was following.
At least someone's reading your guide ;-)
Original comment by nottle...@gmail.com
on 26 Jun 2014 at 8:43
oh, indeed. Excellent point. Fixed this.
Thanks a lot again for reporting this.
Original comment by olikr...@gmail.com
on 26 Jun 2014 at 8:56
also updated the documentation for the reference manual
Original comment by olikr...@gmail.com
on 28 Jun 2014 at 9:04
Original issue reported on code.google.com by
nottle...@gmail.com
on 26 Jun 2014 at 7:13