I am running this code with Juce 3.2.0 on Windows 10:
AttributedString text("Some text for TextLayout that sometimes has the correct height, sometimes not."); const int width = 200; TextLayout textLayout; textLayout.createLayout(text, width); const int height = (int)textLayout.getHeight(); textLayout.draw(someGraphicsInstance);
This gives inconsistent results. Sometimes this results in a height of 45 Pixels with lines being wrapped at 200 pixels, sometimes it results in a height of 15 Pixels. In the latter case, the text also wraps at 200 pixels, but the text does not continue on a new line, but on top of the previous text (at the start position).
Am I doing something wrong, or is this a known bug?