# 2D text (angled) with background

**URL:** https://forum.techsoft3d.com/t/2d-text-angled-with-background/5202
**Category:** HOOPS Visualize Desktop
**Tags:** how-to, code, knowledge-base
**Created:** [August 14, 2026, 11:03pm UTC](https://forum.techsoft3d.com/t/2d-text-angled-with-background/5202 "2026-08-14T23:03:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simon](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@simon](https://forum.techsoft3d.com/u/simon)
#### Post date: [August 14, 2026, 11:03pm UTC](https://forum.techsoft3d.com/t/2d-text-angled-with-background/5202/1 "2026-08-14T23:03:59Z")

</div>

For 2D texts, by default, backgrounds will be screen aligned.

If you call HC\_Set\_Text\_Path() to  
angle you texts, text’s background will look like the screenshot below.

 ![2026-08-14_15-19-07](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/b/be344f789c91d059151ee97ecf08a166c7a92e31.png)

If you want to maintain background size, you should:

- Insert Text at the origin
- Rotate a bit around Z-axis
- Translate text to the old insertion point

Sample Code:

```auto
void CSolidHoopsView::OnExtraSlot2()
{
HC_Open_Segment_By_Key(m_pHView->GetModelKey()); {
HC_Open_Segment("text");
HC_Set_Color("text=black, faces=yellow, edges=black");
HC_Set_Text_Font("background=shape=box, backgrounds,transforms=on, name=sans serif, size=36 points");
HC_Insert_Text_With_Encoding(0, 0, 0, "UTF8", "TEST123");
HC_Close_Segment();
} HC_Close_Segment();

HVector front, top;
front.Set(0, 0, 1);
top.Set(0, 1, 0);
m_pHView->SetViewAxis(&front, &top);
m_pHView->SetViewMode(ViewMode::HViewFront);
m_pHView->Update();

}

void CSolidHoopsView::OnExtraSlot3()
{

HC_Open_Segment_By_Key(m_pHView->GetModelKey()); {

	HC_Open_Segment("text");
	HC_Set_Color("text=black, faces=yellow, edges=black");
	HC_Rotate_Object(0, 0, 45);		    
    HC_Translate_Object(0.2f, 0.1f, 0.0f);
	HC_Close_Segment();
} HC_Close_Segment();

m_pHView->Update();

}

```

 ![Snag_811eed28](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/2/23fc3299a2c8cb7cb31eaae5595d2a4ceeacb4bc.png)
