# Why does myTextRenderComponent fill the screen on my packaged game?

**URL:** <https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225>\
**Category:** Blueprint\
**Tags:** unreal-engine, Packaging, textrendercomponent, question, Blueprint\
**Created:** [May 13, 2014, 1:31pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225 "2014-05-13T13:31:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skye\_Mohlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skye\_Mohlin](https://forums.unrealengine.com/u/Skye_Mohlin)\
**Post date:** [May 13, 2014, 1:31pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/1 "2014-05-13T13:31:14Z")

</div>

Hi, we were doing a test-package today, and realised that the TextRenderComponents we have on our 3d-HUD literally fills the screen:

![6191-screenshot+2014-05-13+15.25.24.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/2/e923ada8635fd96a75db7d0b0c6e33f704f0b7b5.png)

It seems to be something to do with it’s original scale, as when we scale the blueproint that owns these components, they scale with it as well (get even bigger). Is this a bug or something we’re doing wrong (it works fine in all preview-modes)?

//Thanks in Advance

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [May 13, 2014, 2:41pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/2 "2014-05-13T14:41:59Z")

</div>

Hey SkyInAPond -

Could you upload a screenshot of you HUD blueprints so we can try to reproduce and diagnose the issue for you?

Also take a glance at the Content Examples Blueprint\_HUD level as this HUD uses a slightly different way of rendering out the HUD based on screen space which might work better for your goal.

Thanks

-Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Skye\_Mohlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skye\_Mohlin](https://forums.unrealengine.com/u/Skye_Mohlin)\
**Post date:** [May 13, 2014, 10:26pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/3 "2014-05-13T22:26:53Z")

</div>

It is literally just a Pawn-blueprint, in which I’ve added a few TextRenderComponents (along with other objects, since the HUD is actually attached to the Pawn). I never set the size in the graph, only the text:

 ![6221-components.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/7/2474c8b03a69552f9ce0d8a9f85e72e9b4fc475b.jpeg)

 ![6222-text.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/7/c57628af56437d15ab26abfab3a05f4cbfe50589.jpeg)

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [May 14, 2014, 1:55pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/4 "2014-05-14T13:55:52Z")

</div>

Hey SkyInAPond -

I have been working on trying to reproduce your issue and have been unsuccessful as of yet. I do want to check does any element within the Pawn class have a function which scales them? If you are willing, I would be happy to look at the actual uasset, but either way I will keep working on it.

-Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Skye\_Mohlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skye\_Mohlin](https://forums.unrealengine.com/u/Skye_Mohlin)\
**Post date:** [May 14, 2014, 5:01pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/5 "2014-05-14T17:01:00Z")

</div>

Can I send it to you personally, I’d rather not have others accessing it? 😛

BTW, changing the original to about 5% of the original worked and got them back close to the correct size.

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [May 14, 2014, 5:11pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/6 "2014-05-14T17:11:51Z")

</div>

I understand. If you are able to fix it by just reducing the correct size it sounds like there could be a scale that is being applied somewhere in the assets chain. I noticed in you component screenshot you have multiple world size values for your text render objects, but the same X and Y scale. Is the world size how you are adjusting the scale or are you doing it through the Transform scaling?

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Skye\_Mohlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skye\_Mohlin](https://forums.unrealengine.com/u/Skye_Mohlin)\
**Post date:** [May 15, 2014, 8:01am UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/7 "2014-05-15T08:01:12Z")

</div>

Indeed I am adjusting it via the World Size variable! Is this the wrong approach?

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [May 15, 2014, 6:38pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/8 "2014-05-15T18:38:02Z")

</div>

Hi SkyInAPond -

Not necessarily, but the scaling issue you are having is somewhere in the asset creation chain whether in import or a blueprint, you will have to track down any part in the chain where the text is changed and ensure that it is not also associated with a change in scale setting or font size change.

-Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Skye\_Mohlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skye\_Mohlin](https://forums.unrealengine.com/u/Skye_Mohlin)\
**Post date:** [May 15, 2014, 6:44pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/9 "2014-05-15T18:44:00Z")

</div>

Ok, thank you very much! 😉

---

<div class="post-metadata">

**Author:** ![MulleDK19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MulleDK19](https://forums.unrealengine.com/u/MulleDK19)\
**Post date:** [November 12, 2014, 2:18pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/10 "2014-11-12T14:18:24Z")

</div>

This is really annoying. TextRenderComponent is useless after packaging. The text is 40 billion times larger in packaged games, and the characters are all wrong.

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [November 18, 2014, 10:56pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/11 "2014-11-18T22:56:24Z")

</div>

Hey MulleDK19 -

Have you looked into your asset creation chain as mentioned below? As a test you should be able to package Content Examples which has many text render components in and out of blueprints which should package correctly.

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![MulleDK19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MulleDK19](https://forums.unrealengine.com/u/MulleDK19)\
**Post date:** [November 19, 2014, 11:07am UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/12 "2014-11-19T11:07:10Z")

</div>

Now sure what you mean by creation chain.

But this has been a problem since the first UE4 release. It’s all TextRenderComponents in any project of any asset. But only after packaging.

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [November 19, 2014, 3:15pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/13 "2014-11-19T15:15:53Z")

</div>

Hey MulleDK19 -

By Creation Chain, I mean the process that you have in getting the text render component into your world, be it either through a blueprint of just placing the component directly into the level.

Just to confirm exact what you are saying, if you package Content Examples all Text Render Components increase in scale, or only projects you have created with text render components increase in scale?

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![MulleDK19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MulleDK19](https://forums.unrealengine.com/u/MulleDK19)\
**Post date:** [November 19, 2014, 8:52pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/14 "2014-11-19T20:52:35Z")

</div>

It seems to work with the Content Examples. And trying to reproduce it on new projects has yielded no results.

I just know that every time I’ve tried to use the TextRenderComponent in any of my projects, they become oversized in the packaged game, and I have to make them tiny in the editor, to have them a reasonable size in the packaged game. It’s not based on scaling on any parents, or any calls that scales them. And I’d assume that would show in the editor if that was the case.

Recently I added a text render component to two different actors; my character, and a simple actor with just a mesh, and both were enormous in the packaged game. Furthermore, all the characters appeared as just squares, like ☐☐☐☐☐☐☐☐

---

<div class="post-metadata">

**Author:** ![Lovecraft\_K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lovecraft\_K](https://forums.unrealengine.com/u/Lovecraft_K)\
**Post date:** [November 19, 2014, 9:19pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/15 "2014-11-19T21:19:24Z")

</div>

Hey MulleDK19 -

This has to do with font setup when you first import it into the engine, since the engine treats fonts as a texture, some fonts will include pages and those pages will vary based on imported font size, larger font usually equals more pages. However, all of this should be visible in the Editor before packaging. And you are not doing anything more than spawning the text render component? I am happy to continue to look into this if you can send me a project in which this occurs and if you are using a custom (not engine specific) font I will need that as well. You can upload a zip here if small enough or upload to dropbox and post a link.

Thank You

Eric Ketchum

---

<div class="post-metadata">

**Author:** ![Skelezoid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skelezoid](https://forums.unrealengine.com/u/Skelezoid)\
**Post date:** [May 13, 2015, 5:32pm UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/16 "2015-05-13T17:32:56Z")

</div>

I’ve been having the same issue for a while now for my offline fonts (runtime fonts in UMG are fine). I’ve done some digging using the latest engine version, 4.7.6, and I think I have an answer.

**The root of the problem seems to be that an offline font asset isn’t loaded into memory when an actor’s TextRenderComponent is being setup**. For me, this happens only on Windows cooked/packaged builds (iOS doesn’t have this issue). Playing in the editor or playing a stand-alone instance through the editor avoids the issue. I suspect the offline font asset is already in memory at this point.

The TextRenderComponent has a property, InvDefaultSize, that is used in the render matrix calculations for the characters to display. Normally, this should be a small number (at WorldSize 26 this is 1.0/26.0, or 0.03846). However, in my cooked Windows builds, I was seeing this value as 1.0 when my breakpoint in AActor::BeingPlay was hit on the offending actor. Digging into the engine source, UTextRenderComponent will set InvDefaultSize to 1.0f in two scenarios:

1. If the font’s GetMaxCharHeight() returns 1 (meaning the characters are 1 pixel tall in the texture sheet).

2. If UTextRenderComponent::SetFont is called without a valid UFont pointer (TextRenderComponent.cpp, line 870). This is the most likely cause.

Only actors I placed in the level seem to have this issue. As a work-around, any actors that have a TextRenderComponent with a custom font should be spawned after the player has entered the level (I do this in my GameMode’s BeginPlay function). There’s a better solution out there (or one that may require a fix in the engine code), but this will at least get you around the problem in the meantime.

Hope this helps someone out there!

---

<div class="post-metadata">

**Author:** ![tomvernon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomvernon](https://forums.unrealengine.com/u/tomvernon)\
**Post date:** [February 10, 2017, 9:52am UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/17 "2017-02-10T09:52:43Z")

</div>

In case anyone else is running into this issue, I was able to fix this by making a minor change to the engine source in TextRenderComponent.cpp, thanks to the hints in vanzeipel’s post. As stated above it seems that InvDefaultSize isn’t correctly initialised in some situations (one of those being a text render component with a custom font in a standalone windows build). To fix, I added this small snippet to the bottom of UTextRenderComponent::PostLoad() :

```
		if (Font)
		{
			float LocalWorldSize = Font->GetMaxCharHeight();
			InvDefaultSize = 1.0f / LocalWorldSize;
		}

```

Hope that’s of use to someone!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_36c68e4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_36c68e4a](https://forums.unrealengine.com/u/anonymous_user_36c68e4a)\
**Post date:** [January 29, 2018, 10:37am UTC](https://forums.unrealengine.com/t/why-does-mytextrendercomponent-fill-the-screen-on-my-packaged-game/283225/18 "2018-01-29T10:37:48Z")

</div>

Further to Tom’s fix…I’ve come across a case where even this doesn’t work because the PostLoad for the TextRenderComponent is called BEFORE the PostLoad for the Font (which initialises GetMaxCharHeight()).

IMHO the most robust solution is for GetMaxCharHeight to self-test and call CacheCharacterCountAndMaxCharHeight() if it’s uninitialised - but that still requires Tom’s fix to correctly set up the TextRenderComponents.
