# Possible DrawFormattedText bug?

**URL:** <https://psychtoolbox.discourse.group/t/possible-drawformattedtext-bug/2003>\
**Category:** Uncategorized\
**Created:** [August 28, 2013, 6:51pm UTC](https://psychtoolbox.discourse.group/t/possible-drawformattedtext-bug/2003 "2013-08-28T18:51:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [August 28, 2013, 6:51pm UTC](https://psychtoolbox.discourse.group/t/possible-drawformattedtext-bug/2003/1 "2013-08-28T18:51:51Z")

</div>

This is an odd one, but I've encountered a situation in which it appears that DrawFormattedText either works or doesn't, depending solely on whether its output arguments are requested or not.  
  
This is MATLAB 2013a on a MacBook Pro, Mountain Lion (OS X 10.8), PTB 3.0.11 .  
  
  
Attached is the code that will reproduce the bug. just run triangleTest\_bugReport. Two calls are made to DrawFormattedText, with the only difference being that in one case, the output arguments are requested as [~,~,~]. If the output is requested, the text draws correctly. If it is not, the text disappears and it appears as though the function has decided not to try (outputs a 0).  
  
Restarting MATLAB, 'clear all', and other such initializing tricks do not appear to change matters.  
I do not have access to another machine and will be delighted if someone on a different OS and/or same OS but different box could tell me if it reproduces for them.  
  
  
  
Alik Widge, MD, PhD  
Research Fellow, Division of Neurotherapeutics  
MGH Psychiatry  
[awidge@...](mailto:awidge@...)  
206-866-5435

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [August 29, 2013, 9:45am UTC](https://psychtoolbox.discourse.group/t/possible-drawformattedtext-bug/2003/2 "2013-08-29T09:45:08Z")

</div>

There we go -- that's the trick. Until you explained this, I couldn't comprehend some of the stuff at the bottom of 'doc DrawFormattedText'. Going back and rereading it fresh this AM, it does indeed describe exactly the behavior you mention (and I didn't consider requesting only \*two\* output arguments as a test).  
  

Thanks!
