Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
1.9.3.10904
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other
I’m using drivework and I want to make the font size larger, but I can’t find the interface for font size. Can you help me?
Dear @deng.shigang,
May I know which font? Is it the output text in the GL window?
yes.
In the sample_stereo_disparity example, I wanted to change the code so that the font size for the depth values displayed when the mouse clicks is larger. But I don’t know where to modify.
Dear @deng.shigang,
We have dwRenderEngine_setFont to set the font of render engine. If you asking to change the size of display text when mouse is clicked, you can do like below in the code.
// Render depth on mouse click
if (m_depthFlag[side])
{
uint32_t imageRow = static_cast<uint32_t>(m_depth[side].y * m_disparityCPU[side]->prop.height);
uint32_t imageCol = static_cast<uint32_t>(m_depth[side].x * m_disparityCPU[side]->prop.width);
uint32_t disp = m_disparityCPU[side]->data[0][imageRow * m_disparityCPU[side]->prop.width + imageCol];
char depth[10];
sprintf(depth, "%.1f", m_focalLength[side] * m_baseline / (disp * m_depthGain));
#Newly added snippet in code to increase font size
dwRenderEngineFont newFont = DW_RENDER_ENGINE_FONT_VERDANA_64;
dwRenderEngine_setFont(newFont, m_renderEngine);
std::cout << "Depth font is " << font << std::endl;
CHECK_DW_ERROR(dwRenderEngine_setColor(DW_RENDER_ENGINE_COLOR_WHITE, m_renderEngine));
CHECK_DW_ERROR(dwRenderEngine_renderText2D(depth, dwVector2f{m_depth[side].x, m_depth[side].y}, m_renderEngine));
}
}
Thank you very much. Problem solved