# Text stimulus on a new set up

**URL:** <https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910>\
**Category:** Support\
**Created:** [August 31, 2023, 8:54am UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910 "2023-08-31T08:54:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [August 31, 2023, 8:54am UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/1 "2023-08-31T08:54:16Z")

</div>

Hi Chris,

I’m setting up MWorks in a new set up (new M2 Mac mini + new Mac OS) and observing a weird effect of number of displays on a text stimulus. We can’t see the text stimulus (other stimuli are fine) when we are using only one display. With two displays, it works fine. We match the preference in MWorks server (like width/height of mirror window, etc) but nothing helps. In old Mac/MWorks, a single display and the same MWorks code work fine.

Do you have any suggestion or idea to resolve this? I suspect it could be related to font/size…

Thanks,  
Hansem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 31, 2023, 1:35pm UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/2 "2023-08-31T13:35:25Z")

</div>

Hi Hansem,

That is strange. What you happens when you run the attached experiment? It should fill the display with repetitions of “Hi!” and generate the following warning in the server console:

```
WARNING: Text for stimulus "stim" does not fit within the specified region and will be truncated

```

Thanks,  
Chris  
[text\_fullscreen.mwel.zip](https://mworks.discourse.group/uploads/short-url/6uSkMczX9Z8mg8SRzK2SVI0sZ0N.zip) (706 Bytes)

---

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [September 2, 2023, 3:32am UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/3 "2023-09-02T03:32:08Z")

</div>

Thanks for your quick reply, Chris!

We’ve tested your code and it works totally fine. One thing we tried in our code is that we used the ‘fullscreen’ option and then we saw the text stimulus, even with only one display (i.e., in a mirror window). But now somehow its location is weird and I suspect that it might be something to do with font size and its interaction with x\_size, etc. One question I have now is how the size of the text stimulus is decided given font size, x\_size, and other miscellaneous options like max\_x\_size, fullscreen, etc.

Again, everything works fine with two displays so it’s not super-critical at this point.

Best,  
Hansem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 5, 2023, 2:17pm UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/4 "2023-09-05T14:17:18Z")

</div>

Hi Hansem,

I think I may have misunderstood your initial problem description. When you said “using only one display”, I thought you meant you were using a fullscreen window on that display and controlling the experiment via MWClient on a different Mac. Did you actually mean that you selected “Mirror window only” in MWServer’s display options?

If you’re using only a mirror window, then you won’t be able to use the same font size as you’d use on a fullscreen window. The reason: the [font\_size](https://mworks.github.io/documentation/latest/components/text_stimulus.html#font-size) parameter takes values in [points](https://en.wikipedia.org/wiki/Point_(typography)), which have no relation to the visual-angle-based sizes of MWorks stimuli. For example, text rendered in a 12-point Helvetica font in an MWorks text stimulus should be about the same size on screen as the same text in the same font in a TextEdit document. This is true for both fullscreen stimulus display windows and mirror-window-only stimulus displays. However, the size of the text _relative to other MWorks stimuli_ is going to be different for fullscreen vs mirror window only, because the windows are different sizes.

As for the relation between font\_size and the other size parameters: [x\_size](https://mworks.github.io/documentation/latest/components/text_stimulus.html#x-size) and [y\_size](https://mworks.github.io/documentation/latest/components/text_stimulus.html#y-size) set the size of the rectangle in which the text is drawn. However, they don’t affect the font size at all. If the font is too large for the text to fit in the rectangle, it will be truncated. (MWorks issues a warning if this happens.) If the font is much too large, the text may be completely truncated (i.e. disappear entirely). This might be why you can’t see the text stimulus in some cases.

I implemented things this way because points are the standard measure of font size. That said, I appreciate how this can sometimes make sizing a text stimulus awkward, and making it possible to specify font sizes in degrees is [on my to-do list](https://github.com/mworks/mworks-issues/issues/308). In the meantime, though, if you want the text in an experiment designed for fullscreen display to work in mirror-window-only mode, you’ll have to make the font size smaller.

Note that text stimuli have worked this way ever since they were first added. I’m puzzled as to why you’d see a difference after upgrading MWorks and/or macOS.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![hansem](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hansem](https://mworks.discourse.group/u/hansem)\
**Post date:** [September 12, 2023, 8:14am UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/5 "2023-09-12T08:14:41Z")

</div>

Hi Chris,

Thanks for your kind explanation! It makes sense to me. I was using “mirror window only” and I guess what I have to do now is to adjust the font size to prevent the truncation.  
And I think it has nothing to do with the upgrading mworks or Mac. I expect this would have been happening even in the old Mac, if I just use the mirror window.

Thanks,  
Hansem

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 12, 2023, 1:10pm UTC](https://mworks.discourse.group/t/text-stimulus-on-a-new-set-up/910/6 "2023-09-12T13:10:55Z")

</div>


