mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
hard-set text quality for now
This commit is contained in:
parent
d7cffaa4f5
commit
976e367e52
@ -181,6 +181,9 @@ ConfigVariableEnum<Texture::FilterType> text_magfilter
|
|||||||
ConfigVariableEnum<Texture::WrapMode> text_wrap_mode
|
ConfigVariableEnum<Texture::WrapMode> text_wrap_mode
|
||||||
("text-wrap-mode", Texture::WM_border_color,
|
("text-wrap-mode", Texture::WM_border_color,
|
||||||
PRC_DESC("The default wrap mode for dynamic text fonts"));
|
PRC_DESC("The default wrap mode for dynamic text fonts"));
|
||||||
|
ConfigVariableEnum<Texture::QualityLevel> text_quality_level
|
||||||
|
("text-quality-level", Texture::QL_best,
|
||||||
|
PRC_DESC("The default quality level for dynamic text fonts; see Texture::set_quality_level()."));
|
||||||
|
|
||||||
ConfigVariableEnum<TextFont::RenderMode> text_render_mode
|
ConfigVariableEnum<TextFont::RenderMode> text_render_mode
|
||||||
("text-render-mode", TextFont::RM_texture,
|
("text-render-mode", TextFont::RM_texture,
|
||||||
|
@ -39,7 +39,7 @@ DynamicTextPage(DynamicTextFont *font, int page_number) :
|
|||||||
|
|
||||||
// It's usually pretty important for text to look its best, and it
|
// It's usually pretty important for text to look its best, and it
|
||||||
// doesn't usually have a high fill factor.
|
// doesn't usually have a high fill factor.
|
||||||
set_quality_level(Texture::QL_best);
|
set_quality_level(text_quality_level);
|
||||||
|
|
||||||
_x_size = _font->get_page_x_size();
|
_x_size = _font->get_page_x_size();
|
||||||
_y_size = _font->get_page_y_size();
|
_y_size = _font->get_page_y_size();
|
||||||
|
@ -26,6 +26,10 @@
|
|||||||
#include "renderState.h"
|
#include "renderState.h"
|
||||||
#include "dcast.h"
|
#include "dcast.h"
|
||||||
|
|
||||||
|
// Temporary
|
||||||
|
#include "textureCollection.h"
|
||||||
|
#include "nodePath.h"
|
||||||
|
|
||||||
TypeHandle StaticTextFont::_type_handle;
|
TypeHandle StaticTextFont::_type_handle;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -41,6 +45,19 @@ StaticTextFont(PandaNode *font_def) {
|
|||||||
_font = font_def;
|
_font = font_def;
|
||||||
_glyphs.clear();
|
_glyphs.clear();
|
||||||
|
|
||||||
|
// This bit is a temporary hack. We find all of the textures
|
||||||
|
// referenced by the font, and hard-set them to the specified
|
||||||
|
// quality level for text. This should not remain more than a
|
||||||
|
// couple of weeks; after that time, we'll remove this and require
|
||||||
|
// users to set their desired quality level in static fonts
|
||||||
|
// explicitly.
|
||||||
|
NodePath np(font_def);
|
||||||
|
TextureCollection tc = np.find_all_textures();
|
||||||
|
int num_textures = tc.get_num_textures();
|
||||||
|
for (int i = 0; i < num_textures; ++i) {
|
||||||
|
tc.get_texture(i)->set_quality_level(text_quality_level);
|
||||||
|
}
|
||||||
|
|
||||||
find_characters(font_def, RenderState::make_empty());
|
find_characters(font_def, RenderState::make_empty());
|
||||||
_is_valid = !_glyphs.empty();
|
_is_valid = !_glyphs.empty();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user