# Indented lines of text not working with TextBox

**URL:** <https://discourse.libcinder.org/t/indented-lines-of-text-not-working-with-textbox/1750>\
**Category:** Using Cinder\
**Created:** [December 9, 2020, 5:50pm UTC](https://discourse.libcinder.org/t/indented-lines-of-text-not-working-with-textbox/1750 "2020-12-09T17:50:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![totalgee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/totalgee/32/274_2.png) [@totalgee](https://discourse.libcinder.org/u/totalgee)\
**Post date:** [December 9, 2020, 5:50pm UTC](https://discourse.libcinder.org/t/indented-lines-of-text-not-working-with-textbox/1750/1 "2020-12-09T17:50:15Z")

</div>

Hi there, I’m trying to draw some source code (indented with tabs) using `gl::TextureFont::drawStringWrapped()`, but it’s not respecting the tabs (tested on Windows). So I replaced the tabs by spaces, but it still seems to strip whitespace at the start of lines…

I think it’s the function `TextBox::calculateLineBreaks()` that’s not calculating the glyphs correctly. Aha – I just found this comment in the function `lineBreakUtf8()`:

```auto
// eat any spaces we'd start on on the next line

```

Any suggestions on how to avoid this behaviour? It’s pretty deeply ingrained in the glyph calculation code, and I don’t see a way to switch it off (e.g. using `DrawOptions`).

Thanks,  
Glen.

---

<div class="post-metadata">

**Author:** ![totalgee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/totalgee/32/274_2.png) [@totalgee](https://discourse.libcinder.org/u/totalgee)\
**Post date:** [December 9, 2020, 6:16pm UTC](https://discourse.libcinder.org/t/indented-lines-of-text-not-working-with-textbox/1750/2 "2020-12-09T18:16:21Z")

</div>

Hmm, the hacky workaround I discovered was to add spaces after tabs at the start of indented lines (rather than _replacing_ the tabs, just add spaces _after them_). Because the `TextBox` code doesn’t check for “any whitespace” at the start of lines, but specifically for `' '` (the space character)… So, that works (if a bit hacky), and I can now see my nicely indented code. 😉
