rename TextMaker to PNMTextMaker

This commit is contained in:
David Rose 2002-04-07 23:08:11 +00:00
parent a9928bad55
commit 8723b8aede
11 changed files with 95 additions and 95 deletions

View File

@ -15,7 +15,7 @@
indexify.cxx indexify.h \ indexify.cxx indexify.h \
photo.cxx photo.h \ photo.cxx photo.h \
rollDirectory.cxx rollDirectory.h \ rollDirectory.cxx rollDirectory.h \
textGlyph.cxx textGlyph.h \ pnmTextGlyph.cxx pnmTextGlyph.h \
textMaker.cxx textMaker.h pnmTextMaker.cxx pnmTextMaker.h
#end bin_target #end bin_target

View File

@ -19,7 +19,7 @@
#include "indexImage.h" #include "indexImage.h"
#include "rollDirectory.h" #include "rollDirectory.h"
#include "photo.h" #include "photo.h"
#include "textMaker.h" #include "pnmTextMaker.h"
#include "indexParameters.h" #include "indexParameters.h"
#include "pnmImage.h" #include "pnmImage.h"
@ -88,7 +88,7 @@ add_photo(int photo_index) {
// failure. // failure.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool IndexImage:: bool IndexImage::
generate_images(const Filename &archive_dir, TextMaker *text_maker) { generate_images(const Filename &archive_dir, PNMTextMaker *text_maker) {
int count = _photos.size(); int count = _photos.size();
int num_rows = (count + thumb_count_x - 1) / thumb_count_x; int num_rows = (count + thumb_count_x - 1) / thumb_count_x;
int actual_index_height = thumb_y_space + num_rows * (thumb_height + thumb_caption_height + thumb_y_space); int actual_index_height = thumb_y_space + num_rows * (thumb_height + thumb_caption_height + thumb_y_space);
@ -248,7 +248,7 @@ generate_images(const Filename &archive_dir, TextMaker *text_maker) {
pinfo._x_place + x_center, pinfo._x_place + x_center,
pinfo._y_place + y_center); pinfo._y_place + y_center);
if (text_maker != (TextMaker *)NULL) { if (text_maker != (PNMTextMaker *)NULL) {
text_maker->generate_into(photo->get_frame_number(), index_image, text_maker->generate_into(photo->get_frame_number(), index_image,
pinfo._x_place + thumb_width / 2, pinfo._x_place + thumb_width / 2,
pinfo._y_place + thumb_height + thumb_caption_height); pinfo._y_place + thumb_height + thumb_caption_height);

View File

@ -26,7 +26,7 @@
class RollDirectory; class RollDirectory;
class Photo; class Photo;
class TextMaker; class PNMTextMaker;
class PNMImage; class PNMImage;
class PNMImageHeader; class PNMImageHeader;
@ -42,7 +42,7 @@ public:
~IndexImage(); ~IndexImage();
bool add_photo(int index); bool add_photo(int index);
bool generate_images(const Filename &archive_dir, TextMaker *text_maker); bool generate_images(const Filename &archive_dir, PNMTextMaker *text_maker);
bool generate_html(ostream &root_html, const Filename &archive_dir, bool generate_html(ostream &root_html, const Filename &archive_dir,
const Filename &roll_dir_root); const Filename &roll_dir_root);

View File

@ -19,7 +19,7 @@
#include "indexify.h" #include "indexify.h"
#include "rollDirectory.h" #include "rollDirectory.h"
#include "notify.h" #include "notify.h"
#include "textMaker.h" #include "pnmTextMaker.h"
#include "default_font.h" #include "default_font.h"
#include "default_index_icons.h" #include "default_index_icons.h"
#include "indexParameters.h" #include "indexParameters.h"
@ -213,7 +213,7 @@ Indexify() {
&Indexify::dispatch_filename, NULL, &up_icon); &Indexify::dispatch_filename, NULL, &up_icon);
_photo_extension = "jpg"; _photo_extension = "jpg";
_text_maker = (TextMaker *)NULL; _text_maker = (PNMTextMaker *)NULL;
_font_aa_factor = 4.0; _font_aa_factor = 4.0;
} }
@ -230,7 +230,7 @@ Indexify::
delete roll_dir; delete roll_dir;
} }
if (_text_maker != (TextMaker *)NULL) { if (_text_maker != (PNMTextMaker *)NULL) {
delete _text_maker; delete _text_maker;
} }
} }
@ -324,23 +324,23 @@ post_command_line() {
if (caption_font_size != 0) { if (caption_font_size != 0) {
if (!_font_filename.empty()) { if (!_font_filename.empty()) {
_text_maker = new TextMaker(_font_filename, 0); _text_maker = new PNMTextMaker(_font_filename, 0);
if (!_text_maker->is_valid()) { if (!_text_maker->is_valid()) {
delete _text_maker; delete _text_maker;
_text_maker = (TextMaker *)NULL; _text_maker = (PNMTextMaker *)NULL;
} }
} }
if (_text_maker == (TextMaker *)NULL) { if (_text_maker == (PNMTextMaker *)NULL) {
_text_maker = new TextMaker(default_font, default_font_size, 0); _text_maker = new PNMTextMaker(default_font, default_font_size, 0);
if (!_text_maker->is_valid()) { if (!_text_maker->is_valid()) {
nout << "Unable to open default font.\n"; nout << "Unable to open default font.\n";
delete _text_maker; delete _text_maker;
_text_maker = (TextMaker *)NULL; _text_maker = (PNMTextMaker *)NULL;
} }
} }
if (_text_maker != (TextMaker *)NULL) { if (_text_maker != (PNMTextMaker *)NULL) {
_text_maker->set_pixel_size(caption_font_size, _font_aa_factor); _text_maker->set_pixel_size(caption_font_size, _font_aa_factor);
} }
} }

View File

@ -26,7 +26,7 @@
#include "pvector.h" #include "pvector.h"
class RollDirectory; class RollDirectory;
class TextMaker; class PNMTextMaker;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Class : Indexify // Class : Indexify
@ -57,7 +57,7 @@ public:
typedef pvector<RollDirectory *> RollDirs; typedef pvector<RollDirectory *> RollDirs;
RollDirs _roll_dirs; RollDirs _roll_dirs;
TextMaker *_text_maker; PNMTextMaker *_text_maker;
}; };
#endif #endif

View File

@ -1,4 +1,4 @@
// Filename: textGlyph.cxx // Filename: pnmTextGlyph.cxx
// Created by: drose (03Apr02) // Created by: drose (03Apr02)
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -16,15 +16,15 @@
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
#include "textGlyph.h" #include "pnmTextGlyph.h"
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextGlyph::Constructor // Function: PNMTextGlyph::Constructor
// Access: Public // Access: Public
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextGlyph:: PNMTextGlyph::
TextGlyph(double advance) : PNMTextGlyph(double advance) :
_advance(advance) _advance(advance)
{ {
_left = 0; _left = 0;
@ -33,21 +33,21 @@ TextGlyph(double advance) :
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextGlyph::Destructor // Function: PNMTextGlyph::Destructor
// Access: Public // Access: Public
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextGlyph:: PNMTextGlyph::
~TextGlyph() { ~PNMTextGlyph() {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextGlyph::rescale // Function: PNMTextGlyph::rescale
// Access: Public // Access: Public
// Description: After the image has been rendered large by FreeType, // Description: After the image has been rendered large by FreeType,
// scales it small again for placing. // scales it small again for placing.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextGlyph:: void PNMTextGlyph::
rescale(double scale_factor) { rescale(double scale_factor) {
if (scale_factor == 1.0) { if (scale_factor == 1.0) {
return; return;
@ -103,23 +103,23 @@ rescale(double scale_factor) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextGlyph::get_advance // Function: PNMTextGlyph::get_advance
// Access: Public // Access: Public
// Description: Returns the number of pixels by which the pen should // Description: Returns the number of pixels by which the pen should
// be advanced after rendering this glyph. // be advanced after rendering this glyph.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
int TextGlyph:: int PNMTextGlyph::
get_advance() const { get_advance() const {
return _int_advance; return _int_advance;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextGlyph::place // Function: PNMTextGlyph::place
// Access: Public // Access: Public
// Description: Copies the glyph to the indicated destination image // Description: Copies the glyph to the indicated destination image
// at the indicated origin. // at the indicated origin.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextGlyph:: void PNMTextGlyph::
place(PNMImage &dest_image, int xp, int yp) { place(PNMImage &dest_image, int xp, int yp) {
if (!_image.is_valid()) { if (!_image.is_valid()) {
// If we have no image, do nothing. // If we have no image, do nothing.

View File

@ -1,4 +1,4 @@
// Filename: textGlyph.h // Filename: pnmTextGlyph.h
// Created by: drose (03Apr02) // Created by: drose (03Apr02)
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -16,21 +16,21 @@
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
#ifndef TEXTGLYPH_H #ifndef PNMTEXTGLYPH_H
#define TEXTGLYPH_H #define PNMTEXTGLYPH_H
#include "pandatoolbase.h" #include "pandatoolbase.h"
#include "pnmImage.h" #include "pnmImage.h"
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Class : TextGlyph // Class : PNMTextGlyph
// Description : A single glyph in the font. // Description : A single glyph in a PNMTextMaker.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
class TextGlyph { class PNMTextGlyph {
public: public:
TextGlyph(double advance); PNMTextGlyph(double advance);
~TextGlyph(); ~PNMTextGlyph();
void rescale(double scale_factor); void rescale(double scale_factor);
int get_advance() const; int get_advance() const;
@ -44,7 +44,7 @@ private:
double _advance; double _advance;
int _int_advance; int _int_advance;
friend class TextMaker; friend class PNMTextMaker;
}; };
#endif #endif

View File

@ -16,25 +16,25 @@
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
#include "textMaker.h" #include "pnmTextMaker.h"
#include "textGlyph.h" #include "pnmTextGlyph.h"
#include "filename.h" #include "filename.h"
#include "pnmImage.h" #include "pnmImage.h"
FT_Library TextMaker::_ft_library; FT_Library PNMTextMaker::_ft_library;
bool TextMaker::_ft_initialized = false; bool PNMTextMaker::_ft_initialized = false;
bool TextMaker::_ft_ok = false; bool PNMTextMaker::_ft_ok = false;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::Constructor // Function: PNMTextMaker::Constructor
// Access: Public // Access: Public
// Description: The constructor expects the name of some font file // Description: The constructor expects the name of some font file
// that FreeType can read, along with face_index, // that FreeType can read, along with face_index,
// indicating which font within the file to load // indicating which font within the file to load
// (usually 0). // (usually 0).
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextMaker:: PNMTextMaker::
TextMaker(const Filename &font_filename, int face_index) { PNMTextMaker(const Filename &font_filename, int face_index) {
_is_valid = false; _is_valid = false;
if (!_ft_initialized) { if (!_ft_initialized) {
@ -92,14 +92,14 @@ TextMaker(const Filename &font_filename, int face_index) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::Constructor // Function: PNMTextMaker::Constructor
// Access: Public // Access: Public
// Description: This constructor works as above, but it takes the // Description: This constructor works as above, but it takes the
// font data from an in-memory buffer instead of from a // font data from an in-memory buffer instead of from a
// named file. // named file.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextMaker:: PNMTextMaker::
TextMaker(const char *font_data, int font_data_size, int face_index) { PNMTextMaker(const char *font_data, int font_data_size, int face_index) {
_is_valid = false; _is_valid = false;
if (!_ft_initialized) { if (!_ft_initialized) {
@ -144,12 +144,12 @@ TextMaker(const char *font_data, int font_data_size, int face_index) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::Destructor // Function: PNMTextMaker::Destructor
// Access: Public // Access: Public
// Description: // Description:
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextMaker:: PNMTextMaker::
~TextMaker() { ~PNMTextMaker() {
empty_cache(); empty_cache();
if (_is_valid) { if (_is_valid) {
@ -159,18 +159,18 @@ TextMaker::
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::is_valid // Function: PNMTextMaker::is_valid
// Access: Public // Access: Public
// Description: Returns true if the TextMaker is valid and ready to // Description: Returns true if the PNMTextMaker is valid and ready to
// generate text, false otherwise. // generate text, false otherwise.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool TextMaker:: bool PNMTextMaker::
is_valid() const { is_valid() const {
return _is_valid; return _is_valid;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::set_pixel_size // Function: PNMTextMaker::set_pixel_size
// Access: Public // Access: Public
// Description: Specifies the pixel size of the font to use to // Description: Specifies the pixel size of the font to use to
// generate future text. If the scale_factor is // generate future text. If the scale_factor is
@ -185,7 +185,7 @@ is_valid() const {
// scale_factor to produce the requested pixel_size // scale_factor to produce the requested pixel_size
// output from the closest matching input size. // output from the closest matching input size.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextMaker:: void PNMTextMaker::
set_pixel_size(int pixel_size, double scale_factor) { set_pixel_size(int pixel_size, double scale_factor) {
nassertv(_is_valid); nassertv(_is_valid);
reset_scale(pixel_size, scale_factor); reset_scale(pixel_size, scale_factor);
@ -193,20 +193,20 @@ set_pixel_size(int pixel_size, double scale_factor) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::generate_into // Function: PNMTextMaker::generate_into
// Access: Public // Access: Public
// Description: Generates text into the indicated image at the // Description: Generates text into the indicated image at the
// indicated position. Currently, text is centered // indicated position. Currently, text is centered
// horizontally, with the baseline on the y position. // horizontally, with the baseline on the y position.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextMaker:: void PNMTextMaker::
generate_into(const string &text, PNMImage &dest_image, int x, int y) { generate_into(const string &text, PNMImage &dest_image, int x, int y) {
// First, measure the total width in pixels, so we can center. // First, measure the total width in pixels, so we can center.
int width = 0; int width = 0;
string::const_iterator ti; string::const_iterator ti;
for (ti = text.begin(); ti != text.end(); ++ti) { for (ti = text.begin(); ti != text.end(); ++ti) {
int ch = (unsigned char)(*ti); int ch = (unsigned char)(*ti);
TextGlyph *glyph = get_glyph(ch); PNMTextGlyph *glyph = get_glyph(ch);
width += glyph->get_advance(); width += glyph->get_advance();
} }
@ -216,19 +216,19 @@ generate_into(const string &text, PNMImage &dest_image, int x, int y) {
// Now place the text. // Now place the text.
for (ti = text.begin(); ti != text.end(); ++ti) { for (ti = text.begin(); ti != text.end(); ++ti) {
int ch = (unsigned char)(*ti); int ch = (unsigned char)(*ti);
TextGlyph *glyph = get_glyph(ch); PNMTextGlyph *glyph = get_glyph(ch);
glyph->place(dest_image, xp, yp); glyph->place(dest_image, xp, yp);
xp += glyph->get_advance(); xp += glyph->get_advance();
} }
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::get_glyph // Function: PNMTextMaker::get_glyph
// Access: Private // Access: Private
// Description: Returns the glyph for the indicated index, or NULL if // Description: Returns the glyph for the indicated index, or NULL if
// it is not defined in the font. // it is not defined in the font.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextGlyph *TextMaker:: PNMTextGlyph *PNMTextMaker::
get_glyph(int character) { get_glyph(int character) {
int glyph_index = FT_Get_Char_Index(_face, character); int glyph_index = FT_Get_Char_Index(_face, character);
@ -238,23 +238,23 @@ get_glyph(int character) {
return (*gi).second; return (*gi).second;
} }
TextGlyph *glyph = make_glyph(glyph_index); PNMTextGlyph *glyph = make_glyph(glyph_index);
_glyphs.insert(Glyphs::value_type(glyph_index, glyph)); _glyphs.insert(Glyphs::value_type(glyph_index, glyph));
return glyph; return glyph;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::make_glyph // Function: PNMTextMaker::make_glyph
// Access: Private // Access: Private
// Description: Creates a new TextGlyph object for the indicated // Description: Creates a new PNMTextGlyph object for the indicated
// index, if possible. // index, if possible.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
TextGlyph *TextMaker:: PNMTextGlyph *PNMTextMaker::
make_glyph(int glyph_index) { make_glyph(int glyph_index) {
int error = FT_Load_Glyph(_face, glyph_index, FT_LOAD_RENDER); int error = FT_Load_Glyph(_face, glyph_index, FT_LOAD_RENDER);
if (error) { if (error) {
nout << "Unable to render glyph " << glyph_index << "\n"; nout << "Unable to render glyph " << glyph_index << "\n";
return (TextGlyph *)NULL; return (PNMTextGlyph *)NULL;
} }
FT_GlyphSlot slot = _face->glyph; FT_GlyphSlot slot = _face->glyph;
@ -264,12 +264,12 @@ make_glyph(int glyph_index) {
if (bitmap.width == 0 || bitmap.rows == 0) { if (bitmap.width == 0 || bitmap.rows == 0) {
// If we got an empty bitmap, it's a special case. // If we got an empty bitmap, it's a special case.
TextGlyph *glyph = new TextGlyph(advance); PNMTextGlyph *glyph = new PNMTextGlyph(advance);
glyph->rescale(_scale_factor); glyph->rescale(_scale_factor);
return glyph; return glyph;
} else { } else {
TextGlyph *glyph = new TextGlyph(advance); PNMTextGlyph *glyph = new PNMTextGlyph(advance);
PNMImage &glyph_image = glyph->_image; PNMImage &glyph_image = glyph->_image;
glyph_image.clear(bitmap.width, bitmap.rows, 1); glyph_image.clear(bitmap.width, bitmap.rows, 1);
@ -322,12 +322,12 @@ make_glyph(int glyph_index) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::reset_scale // Function: PNMTextMaker::reset_scale
// Access: Private // Access: Private
// Description: Sets the font to use the appropriate scale pixels, // Description: Sets the font to use the appropriate scale pixels,
// and sets _scale_factor accordingly. // and sets _scale_factor accordingly.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool TextMaker:: bool PNMTextMaker::
reset_scale(int pixel_size, double scale_factor) { reset_scale(int pixel_size, double scale_factor) {
_scale_factor = scale_factor; _scale_factor = scale_factor;
int want_pixel_size = (int)(pixel_size * _scale_factor + 0.5); int want_pixel_size = (int)(pixel_size * _scale_factor + 0.5);
@ -372,26 +372,26 @@ reset_scale(int pixel_size, double scale_factor) {
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::empty_cache // Function: PNMTextMaker::empty_cache
// Access: Private // Access: Private
// Description: Empties the cache of previously-generated glyphs. // Description: Empties the cache of previously-generated glyphs.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextMaker:: void PNMTextMaker::
empty_cache() { empty_cache() {
Glyphs::iterator gi; Glyphs::iterator gi;
for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) { for (gi = _glyphs.begin(); gi != _glyphs.end(); ++gi) {
TextGlyph *glyph = (*gi).second; PNMTextGlyph *glyph = (*gi).second;
delete glyph; delete glyph;
} }
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: TextMaker::initialize_ft_library // Function: PNMTextMaker::initialize_ft_library
// Access: Private, Static // Access: Private, Static
// Description: Should be called exactly once to initialize the // Description: Should be called exactly once to initialize the
// FreeType library. // FreeType library.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void TextMaker:: void PNMTextMaker::
initialize_ft_library() { initialize_ft_library() {
if (!_ft_initialized) { if (!_ft_initialized) {
int error = FT_Init_FreeType(&_ft_library); int error = FT_Init_FreeType(&_ft_library);

View File

@ -1,4 +1,4 @@
// Filename: textMaker.h // Filename: pnmTextMaker.h
// Created by: drose (03Apr02) // Created by: drose (03Apr02)
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
@ -16,8 +16,8 @@
// //
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
#ifndef TEXTMAKER_H #ifndef PNMTEXTMAKER_H
#define TEXTMAKER_H #define PNMTEXTMAKER_H
#include "pandatoolbase.h" #include "pandatoolbase.h"
#include "pmap.h" #include "pmap.h"
@ -28,18 +28,18 @@
class Filename; class Filename;
class PNMImage; class PNMImage;
class TextGlyph; class PNMTextGlyph;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Class : TextMaker // Class : PNMTextMaker
// Description : An object that uses Freetype to generate text at a // Description : An object that uses Freetype to generate text at a
// fixed pixel size into a PNMImage. // fixed pixel size into a PNMImage.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
class TextMaker : public Namable { class PNMTextMaker : public Namable {
public: public:
TextMaker(const Filename &font_filename, int face_index); PNMTextMaker(const Filename &font_filename, int face_index);
TextMaker(const char *font_data, int font_data_size, int face_index); PNMTextMaker(const char *font_data, int font_data_size, int face_index);
~TextMaker(); ~PNMTextMaker();
bool is_valid() const; bool is_valid() const;
@ -49,8 +49,8 @@ public:
PNMImage &dest_image, int x, int y); PNMImage &dest_image, int x, int y);
private: private:
TextGlyph *get_glyph(int character); PNMTextGlyph *get_glyph(int character);
TextGlyph *make_glyph(int glyph_index); PNMTextGlyph *make_glyph(int glyph_index);
bool reset_scale(int pixel_size, double scale_factor); bool reset_scale(int pixel_size, double scale_factor);
void empty_cache(); void empty_cache();
@ -58,7 +58,7 @@ private:
bool _is_valid; bool _is_valid;
typedef pmap<int, TextGlyph *> Glyphs; typedef pmap<int, PNMTextGlyph *> Glyphs;
Glyphs _glyphs; Glyphs _glyphs;
FT_Face _face; FT_Face _face;

View File

@ -273,7 +273,7 @@ get_index_image(int n) const {
// success, false on failure. // success, false on failure.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool RollDirectory:: bool RollDirectory::
generate_images(const Filename &archive_dir, TextMaker *text_maker) { generate_images(const Filename &archive_dir, PNMTextMaker *text_maker) {
nassertr(!_index_images.empty(), false); nassertr(!_index_images.empty(), false);
IndexImages::iterator ii; IndexImages::iterator ii;

View File

@ -26,7 +26,7 @@
class Photo; class Photo;
class IndexImage; class IndexImage;
class TextMaker; class PNMTextMaker;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Class : RollDirectory // Class : RollDirectory
@ -52,7 +52,7 @@ public:
int get_num_index_images() const; int get_num_index_images() const;
IndexImage *get_index_image(int n) const; IndexImage *get_index_image(int n) const;
bool generate_images(const Filename &archive_dir, TextMaker *text_maker); bool generate_images(const Filename &archive_dir, PNMTextMaker *text_maker);
bool generate_html(ostream &root_html, const Filename &archive_dir, bool generate_html(ostream &root_html, const Filename &archive_dir,
const Filename &roll_dir_root); const Filename &roll_dir_root);