News for hackers. Stuff that matters.
Re:A string of unexpected lengths by ChuckMcM on Friday February 20, 2015 @04:17PM (#9083096)
Here I thought everyone learned this when they started colorizing their bash prompt and suddenly their terminal session would wrap the line before the cursor got to the right side of the screen :-)

The article fails to discuss non-monospaced fonts, which make this problem even more pronounced. For a long time Word would screw up a ligature if it also included a color change. The only hope is length(source_data, rendering_environment) as a function.

Re:A string of unexpected lengths by zokier on Friday February 20, 2015 @04:40PM (#9083237)
> The article fails to discuss non-monospaced fonts, which make this problem even more pronounced

I think proportional fonts makes this issue less pronounced because for more people it makes intuitive sense that you can't get string width by just counting characters, and thus they end up using proper measurement functions.

Re:A string of unexpected lengths by ChuckMcM on Friday February 20, 2015 @05:58PM (#9083655)
That is an excellent point.