Browse Source

text-default-underscore-height

David Rose 17 years ago
parent
commit
1ccecd7231
3 changed files with 7 additions and 1 deletions
  1. 5 0
      panda/src/text/config_text.cxx
  2. 1 0
      panda/src/text/config_text.h
  3. 1 1
      panda/src/text/textProperties.I

+ 5 - 0
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<Texture::FilterType> text_minfilter
 ("text-minfilter", Texture::FT_linear_mipmap_linear,
  PRC_DESC("The default texture minfilter type for dynamic text fonts"));

+ 1 - 0
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<Texture::FilterType> text_minfilter;
 extern ConfigVariableEnum<Texture::FilterType> text_magfilter;

+ 1 - 1
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;
 }
 
 ////////////////////////////////////////////////////////////////////