Skip to content

Commit

Permalink
Add an option to allow players add full Chinese glyphs ranges. (Cleve…
Browse files Browse the repository at this point in the history
…rRaven#79322)

* Add an option to allow add full Chinese g;yphs ranges.

* Update src/cata_imgui.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/options.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update options.cpp

Fix words.

* Fix words

fix them, again

* Update description of option.cpp

This requires restart.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
EliadOArias and github-actions[bot] authored Jan 28, 2025
1 parent 3660a31 commit e5624c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cata_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ void cataimgui::client::load_fonts( UNUSED const Font_Ptr &gui_font,
b.AddRanges( io.Fonts->GetGlyphRangesDefault() );
AddGlyphRangesFromCLDR( &b, lang );
AddGlyphRangesMisc( &b );
if( get_option<bool>( "IMGUI_LOAD_CHINESE" ) ) {
b.AddRanges( io.Fonts->GetGlyphRangesChineseFull() );
}
ImVector<ImWchar> ranges;
b.BuildRanges( &ranges );

Expand Down
5 changes: 5 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,11 @@ void options_manager::add_options_graphics()
to_translation( "If true, use SDL ASCII line drawing routine instead of Unicode Line Drawing characters. Use this option when your selected font doesn't contain necessary glyphs." ),
true, COPT_CURSES_HIDE
);

add( "IMGUI_LOAD_CHINESE", page_id, to_translation( "Chinese glyph ranges in ImGui" ),
to_translation( "If true, ImGui will add glyphs of full Chinese, include zh_CN, zh_TW, ja. Use this option when your need all Chinese glyphs. Requires restart." ),
false, COPT_CURSES_HIDE
);
} );
#endif // TILES

Expand Down

0 comments on commit e5624c2

Please sign in to comment.