From a5b7fe25c510dfdf4094c801398b649ccb8e1c8b Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 12 Sep 2003 05:10:14 +0000 Subject: [PATCH] add -nr --- pandatool/src/egg-mkfont/eggMakeFont.cxx | 28 ++++++++++++++++-------- pandatool/src/egg-mkfont/eggMakeFont.h | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pandatool/src/egg-mkfont/eggMakeFont.cxx b/pandatool/src/egg-mkfont/eggMakeFont.cxx index 648d9a5cab..5a1b2fc203 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.cxx +++ b/pandatool/src/egg-mkfont/eggMakeFont.cxx @@ -117,13 +117,13 @@ EggMakeFont() : EggWriter(true, false) { &EggMakeFont::dispatch_double, NULL, &_point_size); add_option - ("bp", "n", 0, + ("pm", "n", 0, "The number of extra pixels around a single character in the " "generated polygon. This may be a floating-point number.", &EggMakeFont::dispatch_double, NULL, &_poly_margin); add_option - ("bt", "n", 0, + ("tm", "n", 0, "The number of extra pixels around each character in the texture map. " "This may only be an integer.", &EggMakeFont::dispatch_int, NULL, &_tex_margin); @@ -138,6 +138,13 @@ EggMakeFont() : EggWriter(true, false) { "matching font to the desired pixel size.", &EggMakeFont::dispatch_double, NULL, &_scale_factor); + add_option + ("nr", "", 0, + "Don't actually reduce the images after applying the scale factor, but " + "leave them at their inflated sizes. Presumably you will reduce " + "them later, for instance with egg-palettize.", + &EggMakeFont::dispatch_none, &_no_reduce); + add_option ("noaa", "", 0, "Disable low-level antialiasing by the Freetype library. " @@ -200,12 +207,20 @@ run() { if (!_text_maker->is_valid()) { exit(1); } + + if (_no_reduce) { + _tex_margin *= _scale_factor; + _poly_margin *= _scale_factor; + _pixels_per_unit *= _scale_factor; + _scale_factor = 1.0; + } + _text_maker->set_point_size(_point_size); - _text_maker->set_scale_factor(_scale_factor); _text_maker->set_native_antialias(!_no_native_aa && !_got_interior); _text_maker->set_interior_flag(_got_interior); _text_maker->set_pixels_per_unit(_pixels_per_unit); - + _text_maker->set_scale_factor(_scale_factor); + if (_range.is_empty()) { // If there's no specified range, the default is the entire ASCII // set. @@ -222,11 +237,6 @@ run() { bool needs_color = (_fg[0] != _fg[1] || _fg[1] != _fg[2] || _bg[0] != _bg[1] || _bg[1] != _bg[2] || _interior[0] != _interior[1] || _interior[1] != _interior[2]); - cerr << "needs_alpha = " << needs_alpha << "\n" - << "needs_color = " << needs_color << "\n" - << "fg = " << _fg << "\n" - << "bg = " << _bg << "\n" - << "interior = " << _interior << "\n"; if (needs_alpha) { if (needs_color) { diff --git a/pandatool/src/egg-mkfont/eggMakeFont.h b/pandatool/src/egg-mkfont/eggMakeFont.h index 8952c772f9..98497700d5 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.h +++ b/pandatool/src/egg-mkfont/eggMakeFont.h @@ -68,6 +68,7 @@ private: double _poly_margin; int _tex_margin; double _scale_factor; + bool _no_reduce; bool _no_native_aa; Filename _input_font_filename;