Montag95 / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

Function u8g_DrawStr(u8g_t *u8g, u8g_uint_t x, u8g_uint_t y, const char *s) #264

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
C function  u8g_DrawStr(...) returns the dx position of the drawn string in 
pixels, noticed this when writing an autowrap function to display text...

1)This is not documented in the API wiki...
2)The return value is basically the pixel width of the string...  I don't see 
any usage for this information in the AVR C API, maybe it is used in the 
Arduino print implementation? 

Thus suggestion:

Instead please consider returning  the x position of the end of the string in 
pixels, I have looked at the source code and  this is already available.  Also 
removing the calculation for dx (t incremented for every glyph drawn) removes 8 
bytes of codes.. a small reduction in code size.

Please close this if I am wrong.

If you are interested as previously stated I have written a function to draw 
strings that autowrap for a given width)...

Regards...
Phil

Original issue reported on code.google.com by philippe...@gmail.com on 16 Jun 2014 at 8:45

GoogleCodeExporter commented 8 years ago
Sorry did not mean to flag this as a defect but enhancement...

Original comment by philippe...@gmail.com on 16 Jun 2014 at 8:47

GoogleCodeExporter commented 8 years ago
Thanks for reporting this.

Regarding the x position.
My assumption was, that
x += u8g_DrawStr(...);
should be easy enough. 

Original comment by olikr...@gmail.com on 17 Jun 2014 at 5:47

GoogleCodeExporter commented 8 years ago
documentation fixed

I agree to what you wrote, but still i would like to keep the code as it is.

Original comment by olikr...@gmail.com on 17 Jun 2014 at 7:00

GoogleCodeExporter commented 8 years ago
Olikr,

I see you have already change the API doc you are quick... is it possible to 
contact you thru e-mail to discuss possible enhancement?  Do you speak French?

Phil

Original comment by philippe...@gmail.com on 17 Jun 2014 at 9:00

GoogleCodeExporter commented 8 years ago
My e-mail adr is mentioned in the source code. I am from Germany, unfortunately 
not able to speak French.

Original comment by olikr...@gmail.com on 18 Jun 2014 at 5:00

GoogleCodeExporter commented 8 years ago
documentation has been updated, closing this

Original comment by olikr...@gmail.com on 19 Jun 2014 at 6:50