Add Atkinson Hyperlegible Mono font support
PiperOrigin-RevId: 937799904 Change-Id: I89e4652cc45afdd9a55b3042395c4a56c70289fb
This commit is contained in:
committed by
Copybara-Service
parent
4b8a8fae92
commit
b6a0db7a17
@@ -84,6 +84,13 @@ static void InitImGui(SDL_Window* window, float content_scale,
|
||||
constexpr ImWchar icon_ranges[] = {0xf000, 0xf3ff, 0x000};
|
||||
io.Fonts->AddFontFromMemoryTTF(data, size, 13.f, &icon_cfg, icon_ranges);
|
||||
|
||||
ImFontConfig mono_cfg;
|
||||
mono_cfg.FontDataOwnedByAtlas = false;
|
||||
font = mju_openResource("", "font:AtkinsonHyperlegibleMono-Regular.ttf", nullptr,
|
||||
nullptr, 0);
|
||||
size = mju_readResource(font, const_cast<const void**>(&data));
|
||||
io.Fonts->AddFontFromMemoryTTF(data, size, 14.f, &mono_cfg);
|
||||
|
||||
// Note: we purposefully do not "close" the font resources as ImGui may
|
||||
// need them again to resize fonts.
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ cmake_minimum_required(VERSION 3.16)
|
||||
include(third_party_deps/dear_imgui)
|
||||
include(third_party_deps/implot)
|
||||
include(third_party_deps/atkinson_hyperlegible_next)
|
||||
include(third_party_deps/atkinson_hyperlegible_mono)
|
||||
include(third_party_deps/font_awesome)
|
||||
|
||||
# Common configuration shared between mujoco_studio and mujoco_live.
|
||||
@@ -81,6 +82,16 @@ function(configure_studio_target TARGET_NAME)
|
||||
${STUDIO_ASSETS_DIR}
|
||||
COMMENT "Copying fontawesome-webfont.ttf to build directory"
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET ${TARGET_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${STUDIO_ASSETS_DIR}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E copy
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../_deps/atkinson_hyperlegible_mono-src/fonts/ttf/AtkinsonHyperlegibleMono-Regular.ttf"
|
||||
${STUDIO_ASSETS_DIR}/AtkinsonHyperlegibleMono-Regular.ttf
|
||||
COMMENT "Copying AtkinsonHyperlegibleMono-Regular font to build directory"
|
||||
)
|
||||
|
||||
# Filament backend requires additional files to be copied into an "assets" folder.
|
||||
if(MUJOCO_USE_FILAMENT)
|
||||
|
||||
@@ -143,6 +143,7 @@ var Module = {
|
||||
"assets/fontawesome-webfont.ttf",
|
||||
"assets/ibl.ktx",
|
||||
"assets/AtkinsonHyperlegibleNext[wght].ttf",
|
||||
"assets/AtkinsonHyperlegibleMono-Regular.ttf",
|
||||
"assets/pbr.filamat",
|
||||
"assets/pbr_transparent.filamat",
|
||||
"assets/pbr_packed.filamat",
|
||||
|
||||
Reference in New Issue
Block a user