Skip to content

Commit 7e7544c

Browse files
committed
Define Sans as default font on Windows
1 parent 9f1c9fb commit 7e7544c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

source/matplot/core/figure_type.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ namespace matplot {
1818
figure_type::figure_type(size_t index) : figure_type(index, true) {}
1919

2020
figure_type::figure_type(size_t index, bool quiet_mode)
21-
: quiet_mode_(quiet_mode), number_(index) {}
21+
: quiet_mode_(quiet_mode), number_(index) {
22+
#if defined(_WIN32) || defined(_WIN64) || defined(__MINGW32__) || defined(__CYGWIN__)
23+
// On windows, Helvetica will fallback to Sans anyway
24+
// So we avoid this warning by setting it to Sans already
25+
font_ = "Sans";
26+
#endif
27+
}
2228

2329
#ifdef MATPLOT_BUILD_FOR_DOCUMENTATION_IMAGES
2430
figure_type::~figure_type() { save("example.svg", "svg"); }

source/matplot/core/figure_type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ namespace matplot {
285285
void run_multiplot_command();
286286

287287
private:
288-
std::string generate_window_title() const;
288+
[[nodiscard]] std::string generate_window_title() const;
289289

290290
private:
291291
// The default backend for this figure

0 commit comments

Comments
 (0)