# Textstim\_vs\_textbox.py demo not working

**URL:** <https://discourse.psychopy.org/t/textstim-vs-textbox-py-demo-not-working/2055>\
**Category:** Coding\
**Created:** [March 6, 2017, 4:01am UTC](https://discourse.psychopy.org/t/textstim-vs-textbox-py-demo-not-working/2055 "2017-03-06T04:01:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexHolcombe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alexholcombe/32/180_2.png) [@AlexHolcombe](https://discourse.psychopy.org/u/AlexHolcombe)\
**Post date:** [March 6, 2017, 4:01am UTC](https://discourse.psychopy.org/t/textstim-vs-textbox-py-demo-not-working/2055/1 "2017-03-06T04:01:56Z")

</div>

The textstim\_vs\_textbox.py demo no longer seems to work. The problem seems to be that getFontManager is no longer defined in fontmanager.py, ([psychopy/psychopy/visual/textbox/fontmanager.py at 057736cd951f2d313cb7bb4b11a55829a60a9441 · psychopy/psychopy · GitHub](https://github.com/psychopy/psychopy/blob/057736cd951f2d313cb7bb4b11a55829a60a9441/psychopy/visual/textbox/fontmanager.py)) did it get accidentally deleted?

The error I get from running the demo is

> fm=visual.TextBox.getFontManager()  
> File “/Applications/PsychoPy2\_1.84.2.app/Contents/Resources/lib/python2.7/psychopy/contrib/lazy\_import.py”, line 112, in **getattribute**  
> return getattr(obj, attr)  
> AttributeError: type object ‘TextBox’ has no attribute ‘getFontManager’

I was looking at the demo because I am trying to draw individual letters very fast. I’m guessing that TextStim is always faster than TextBox for this? Thanks for any advice.

Alex

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [March 7, 2017, 3:33am UTC](https://discourse.psychopy.org/t/textstim-vs-textbox-py-demo-not-working/2055/2 "2017-03-07T03:33:14Z")

</div>

Hi Alex,

// `.getFontManager()` is defined in the textbox ` __init__.py` rather than `fontmanager.py .` //

Try adding this import:

```
from psychopy.visual import textbox

```

and then access the font manager like this:

```
fm = textbox.getFontManager()

```

Looks like this demo might have fallen foul of some reorganisation of `psychopy.visual` that happened a while back.

Have made a pull request to fix this but perhaps someone who understands the visual importing better than me could do better?  
[https://github.com/psychopy/psychopy/pull/1364](https://github.com/psychopy/psychopy/pull/1364)
