diff --git a/pandatool/src/egg-mkfont/eggMakeFont.cxx b/pandatool/src/egg-mkfont/eggMakeFont.cxx index 3049e4696b..6435206fd9 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.cxx +++ b/pandatool/src/egg-mkfont/eggMakeFont.cxx @@ -142,6 +142,15 @@ EggMakeFont() : EggWriter(true, false) { "both the polygon size and the texture map spacing.", &EggMakeFont::dispatch_int, NULL, &_tex_margin); + add_option + ("rm", "n", 0, + "The amount of padding in screen units to place around the glyph when " + "rendered. This differs from -pm in that it has no effect on the " + "generated texture map, only on the generated egg. Use this in order to " + "space the characters out in case they appear to be too close together " + "when rendered. The default is 0.", + &EggMakeFont::dispatch_double, NULL, &_render_margin); + add_option ("sf", "factor", 0, "The scale factor of the generated image. This is the factor by which " @@ -213,6 +222,7 @@ EggMakeFont() : EggWriter(true, false) { _point_size = 10.0; _poly_margin = 1.0; _tex_margin = 2; + _render_margin = 0.0; _palette_size[0] = _palette_size[1] = 256; _face_index = 0; @@ -562,7 +572,7 @@ make_geom(PNMTextGlyph *glyph, int character) { // Now create a single point where the origin of the next character // will be. - EggVertex *v0 = make_vertex(LPoint2d(glyph->get_advance() / _pixels_per_unit, 0.0)); + EggVertex *v0 = make_vertex(LPoint2d(glyph->get_advance() / _pixels_per_unit + _render_margin, 0.0)); EggPoint *point = new EggPoint; group->add_child(point); point->add_vertex(v0); diff --git a/pandatool/src/egg-mkfont/eggMakeFont.h b/pandatool/src/egg-mkfont/eggMakeFont.h index a817eb84ed..9930005957 100644 --- a/pandatool/src/egg-mkfont/eggMakeFont.h +++ b/pandatool/src/egg-mkfont/eggMakeFont.h @@ -75,6 +75,7 @@ private: double _point_size; double _poly_margin; int _tex_margin; + double _render_margin; bool _got_scale_factor; double _scale_factor; bool _no_reduce;