From 1ccecd7231dfefd459396623cc932806422b0b0b Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 30 Oct 2008 22:43:54 +0000 Subject: [PATCH] text-default-underscore-height --- panda/src/text/config_text.cxx | 5 +++++ panda/src/text/config_text.h | 1 + panda/src/text/textProperties.I | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/panda/src/text/config_text.cxx b/panda/src/text/config_text.cxx index abc7d3631c..47a56b2a6d 100644 --- a/panda/src/text/config_text.cxx +++ b/panda/src/text/config_text.cxx @@ -168,6 +168,11 @@ ConfigVariableInt text_max_never_break "characters in a row, do not treat any of them as special and " "instead break the line wherever we can.")); +ConfigVariableDouble text_default_underscore_height +("text-default-underscore-height", -0.2, + PRC_DESC("Specifies the default height of the underscore line, relative " + "to the text baseline, when underscoring is enabled.")); + ConfigVariableEnum text_minfilter ("text-minfilter", Texture::FT_linear_mipmap_linear, PRC_DESC("The default texture minfilter type for dynamic text fonts")); diff --git a/panda/src/text/config_text.h b/panda/src/text/config_text.h index 9e25a88aca..199f6d33f6 100644 --- a/panda/src/text/config_text.h +++ b/panda/src/text/config_text.h @@ -47,6 +47,7 @@ extern wstring get_text_soft_hyphen_output(); extern ConfigVariableDouble text_hyphen_ratio; extern wstring get_text_never_break_before(); extern ConfigVariableInt text_max_never_break; +extern ConfigVariableDouble text_default_underscore_height; extern ConfigVariableEnum text_minfilter; extern ConfigVariableEnum text_magfilter; diff --git a/panda/src/text/textProperties.I b/panda/src/text/textProperties.I index 7f27c786c5..179482e4db 100644 --- a/panda/src/text/textProperties.I +++ b/panda/src/text/textProperties.I @@ -346,7 +346,7 @@ has_underscore_height() const { //////////////////////////////////////////////////////////////////// INLINE float TextProperties:: get_underscore_height() const { - return _underscore_height; + return has_underscore_height() ? _underscore_height : text_default_underscore_height; } ////////////////////////////////////////////////////////////////////