This commit is contained in:
David Rose 2003-09-12 05:10:14 +00:00
parent 949a1f51d5
commit a5b7fe25c5
2 changed files with 20 additions and 9 deletions

View File

@ -117,13 +117,13 @@ EggMakeFont() : EggWriter(true, false) {
&EggMakeFont::dispatch_double, NULL, &_point_size); &EggMakeFont::dispatch_double, NULL, &_point_size);
add_option add_option
("bp", "n", 0, ("pm", "n", 0,
"The number of extra pixels around a single character in the " "The number of extra pixels around a single character in the "
"generated polygon. This may be a floating-point number.", "generated polygon. This may be a floating-point number.",
&EggMakeFont::dispatch_double, NULL, &_poly_margin); &EggMakeFont::dispatch_double, NULL, &_poly_margin);
add_option add_option
("bt", "n", 0, ("tm", "n", 0,
"The number of extra pixels around each character in the texture map. " "The number of extra pixels around each character in the texture map. "
"This may only be an integer.", "This may only be an integer.",
&EggMakeFont::dispatch_int, NULL, &_tex_margin); &EggMakeFont::dispatch_int, NULL, &_tex_margin);
@ -138,6 +138,13 @@ EggMakeFont() : EggWriter(true, false) {
"matching font to the desired pixel size.", "matching font to the desired pixel size.",
&EggMakeFont::dispatch_double, NULL, &_scale_factor); &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 add_option
("noaa", "", 0, ("noaa", "", 0,
"Disable low-level antialiasing by the Freetype library. " "Disable low-level antialiasing by the Freetype library. "
@ -200,12 +207,20 @@ run() {
if (!_text_maker->is_valid()) { if (!_text_maker->is_valid()) {
exit(1); 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_point_size(_point_size);
_text_maker->set_scale_factor(_scale_factor);
_text_maker->set_native_antialias(!_no_native_aa && !_got_interior); _text_maker->set_native_antialias(!_no_native_aa && !_got_interior);
_text_maker->set_interior_flag(_got_interior); _text_maker->set_interior_flag(_got_interior);
_text_maker->set_pixels_per_unit(_pixels_per_unit); _text_maker->set_pixels_per_unit(_pixels_per_unit);
_text_maker->set_scale_factor(_scale_factor);
if (_range.is_empty()) { if (_range.is_empty()) {
// If there's no specified range, the default is the entire ASCII // If there's no specified range, the default is the entire ASCII
// set. // set.
@ -222,11 +237,6 @@ run() {
bool needs_color = (_fg[0] != _fg[1] || _fg[1] != _fg[2] || bool needs_color = (_fg[0] != _fg[1] || _fg[1] != _fg[2] ||
_bg[0] != _bg[1] || _bg[1] != _bg[2] || _bg[0] != _bg[1] || _bg[1] != _bg[2] ||
_interior[0] != _interior[1] || _interior[1] != _interior[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_alpha) {
if (needs_color) { if (needs_color) {

View File

@ -68,6 +68,7 @@ private:
double _poly_margin; double _poly_margin;
int _tex_margin; int _tex_margin;
double _scale_factor; double _scale_factor;
bool _no_reduce;
bool _no_native_aa; bool _no_native_aa;
Filename _input_font_filename; Filename _input_font_filename;