mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-12 19:02:40 +00:00
Deprecated--
svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=506839
This commit is contained in:
parent
fb0b66bbf1
commit
2d4e0d47b0
|
@ -34,7 +34,7 @@ TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolutio
|
||||||
class fontPool *pool, double _enlargement)
|
class fontPool *pool, double _enlargement)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement << endl;
|
kDebug(kvs::dvi) << "TeXFontDefinition::TeXFontDefinition(...); fontname=" << nfontname << ", enlargement=" << _enlargement << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enlargement = _enlargement;
|
enlargement = _enlargement;
|
||||||
|
@ -60,7 +60,7 @@ TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolutio
|
||||||
TeXFontDefinition::~TeXFontDefinition()
|
TeXFontDefinition::~TeXFontDefinition()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi" << endl;
|
kDebug(kvs::dvi) << "discarding font " << fontname << " at " << (int)(enlargement * MFResolutions[font_pool->getMetafontMode()] + 0.5) << " dpi" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (font != 0) {
|
if (font != 0) {
|
||||||
|
@ -86,7 +86,7 @@ TeXFontDefinition::~TeXFontDefinition()
|
||||||
void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )" << endl;
|
kDebug(kvs::dvi) << "void TeXFontDefinition::fontNameReceiver( " << fname << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
flags |= TeXFontDefinition::FONT_LOADED;
|
flags |= TeXFontDefinition::FONT_LOADED;
|
||||||
|
@ -104,7 +104,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
||||||
QString filename_test(font_pool->getExtraSearchPath() + "/" + filename);
|
QString filename_test(font_pool->getExtraSearchPath() + "/" + filename);
|
||||||
file = fopen( QFile::encodeName(filename_test), "r");
|
file = fopen( QFile::encodeName(filename_test), "r");
|
||||||
if (file == 0) {
|
if (file == 0) {
|
||||||
kdError(kvs::dvi) << i18n("Cannot find font %1, file %2.").arg(fontname).arg(filename) << endl;
|
kError(kvs::dvi) << i18n("Cannot find font %1, file %2.").arg(fontname).arg(filename) << endl;
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
filename = filename_test;
|
filename = filename_test;
|
||||||
|
@ -120,7 +120,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
||||||
font = new TeXFont_PK(this);
|
font = new TeXFont_PK(this);
|
||||||
set_char_p = &dviRenderer::set_char;
|
set_char_p = &dviRenderer::set_char;
|
||||||
if ((checksum != 0) && (checksum != font->checksum))
|
if ((checksum != 0) && (checksum != font->checksum))
|
||||||
kdWarning(kvs::dvi) << i18n("Checksum mismatch for font file %1").arg(filename) << endl;
|
kWarning(kvs::dvi) << i18n("Checksum mismatch for font file %1").arg(filename) << endl;
|
||||||
fontTypeName = "TeX PK";
|
fontTypeName = "TeX PK";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -152,12 +152,12 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
||||||
|
|
||||||
if (enc.isEmpty() == false) {
|
if (enc.isEmpty() == false) {
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "Font " << fontname << " uses encoding " << enc << endl;
|
kDebug(kvs::dvi) << "Font " << fontname << " uses encoding " << enc << endl;
|
||||||
#endif
|
#endif
|
||||||
font = new TeXFont_PFB(this, font_pool->encodingPool.findByName(enc), font_pool->fontsByTeXName.findSlant(fontname) );
|
font = new TeXFont_PFB(this, font_pool->encodingPool.findByName(enc), font_pool->fontsByTeXName.findSlant(fontname) );
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "Font " << fontname << " does not have an encoding." << endl;
|
kDebug(kvs::dvi) << "Font " << fontname << " does not have an encoding." << endl;
|
||||||
#endif
|
#endif
|
||||||
font = new TeXFont_PFB(this);
|
font = new TeXFont_PFB(this);
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
|
||||||
#else
|
#else
|
||||||
// If we don't have the FreeType library, we should never have
|
// If we don't have the FreeType library, we should never have
|
||||||
// reached this point. Complain, and leave this font blank
|
// reached this point. Complain, and leave this font blank
|
||||||
kdError(kvs::dvi) << i18n("Cannot recognize format for font file %1").arg(filename) << endl;
|
kError(kvs::dvi) << i18n("Cannot recognize format for font file %1").arg(filename) << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ void TeXFontDefinition::setDisplayResolution(double _displayResolution_in_dpi)
|
||||||
void TeXFontDefinition::mark_as_used()
|
void TeXFontDefinition::mark_as_used()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONT
|
#ifdef DEBUG_FONT
|
||||||
kdDebug(kvs::dvi) << "TeXFontDefinition::mark_as_used()" << endl;
|
kDebug(kvs::dvi) << "TeXFontDefinition::mark_as_used()" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (flags & TeXFontDefinition::FONT_IN_USE)
|
if (flags & TeXFontDefinition::FONT_IN_USE)
|
||||||
|
|
|
@ -29,9 +29,9 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
if (enc != 0)
|
if (enc != 0)
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=" << enc->encodingFullName << " )" << endl;
|
||||||
else
|
else
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PFB::TeXFont_PFB( parent=" << parent << ", encoding=0 )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fatalErrorInFontLoading = false;
|
fatalErrorInFontLoading = false;
|
||||||
|
@ -40,13 +40,13 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
|
||||||
|
|
||||||
if ( error == FT_Err_Unknown_File_Format ) {
|
if ( error == FT_Err_Unknown_File_Format ) {
|
||||||
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.").arg(parent->filename);
|
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.").arg(parent->filename);
|
||||||
kdError(kvs::dvi) << errorMessage << endl;
|
kError(kvs::dvi) << errorMessage << endl;
|
||||||
fatalErrorInFontLoading = true;
|
fatalErrorInFontLoading = true;
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
if ( error ) {
|
if ( error ) {
|
||||||
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.").arg(parent->filename);
|
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.").arg(parent->filename);
|
||||||
kdError(kvs::dvi) << errorMessage << endl;
|
kError(kvs::dvi) << errorMessage << endl;
|
||||||
fatalErrorInFontLoading = true;
|
fatalErrorInFontLoading = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,12 +80,12 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
|
||||||
// the FreeType library function 'FT_Get_Name_Index()' to
|
// the FreeType library function 'FT_Get_Name_Index()' to
|
||||||
// associate glyph indices to those names.
|
// associate glyph indices to those names.
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << "Trying to associate glyph indices to names from the encoding vector." << endl;
|
kDebug(kvs::dvi) << "Trying to associate glyph indices to names from the encoding vector." << endl;
|
||||||
#endif
|
#endif
|
||||||
for(int i=0; i<256; i++) {
|
for(int i=0; i<256; i++) {
|
||||||
charMap[i] = FT_Get_Name_Index( face, (FT_String *)(enc->glyphNameVector[i].ascii()) );
|
charMap[i] = FT_Get_Name_Index( face, (FT_String *)(enc->glyphNameVector[i].ascii()) );
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i] << endl;
|
kDebug(kvs::dvi) << i << ": " << enc->glyphNameVector[i] << ", GlyphIndex=" << charMap[i] << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,14 +105,14 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
|
||||||
// Feed the charMap array with the charmap data found in the
|
// Feed the charMap array with the charmap data found in the
|
||||||
// previous step.
|
// previous step.
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font." << endl;
|
kDebug(kvs::dvi) << "No encoding given: using charmap platform=7, encoding=2 that is contained in the font." << endl;
|
||||||
#endif
|
#endif
|
||||||
for(int i=0; i<256; i++)
|
for(int i=0; i<256; i++)
|
||||||
charMap[i] = FT_Get_Char_Index( face, i );
|
charMap[i] = FT_Get_Char_Index( face, i );
|
||||||
} else {
|
} else {
|
||||||
if ((found == 0) && (face->charmap != 0)) {
|
if ((found == 0) && (face->charmap != 0)) {
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
|
kDebug(kvs::dvi) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
|
||||||
", encoding=" << face->charmap->encoding_id << " that is contained in the font." << endl;
|
", encoding=" << face->charmap->encoding_id << " that is contained in the font." << endl;
|
||||||
#endif
|
#endif
|
||||||
for(int i=0; i<256; i++)
|
for(int i=0; i<256; i++)
|
||||||
|
@ -120,7 +120,7 @@ TeXFont_PFB::TeXFont_PFB(TeXFontDefinition *parent, fontEncoding *enc, double sl
|
||||||
} else {
|
} else {
|
||||||
// As a last resort, we use the identity map.
|
// As a last resort, we use the identity map.
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << "No encoding given, no suitable charmaps found in the font: using identity charmap." << endl;
|
kDebug(kvs::dvi) << "No encoding given, no suitable charmaps found in the font: using identity charmap." << endl;
|
||||||
#endif
|
#endif
|
||||||
for(int i=0; i<256; i++)
|
for(int i=0; i<256; i++)
|
||||||
charMap[i] = i;
|
charMap[i] = i;
|
||||||
|
@ -139,12 +139,12 @@ TeXFont_PFB::~TeXFont_PFB()
|
||||||
glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
|
glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PFB
|
#ifdef DEBUG_PFB
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PFB::getGlyph( ch=" << ch << ", '" << (char)(ch) << "', generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Paranoia checks
|
// Paranoia checks
|
||||||
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
|
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
|
||||||
kdError(kvs::dvi) << "TeXFont_PFB::getGlyph(): Argument is too big." << endl;
|
kError(kvs::dvi) << "TeXFont_PFB::getGlyph(): Argument is too big." << endl;
|
||||||
return glyphtable;
|
return glyphtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
|
||||||
QString msg = i18n("FreeType reported an error when setting the character size for font file %1.").arg(parent->filename);
|
QString msg = i18n("FreeType reported an error when setting the character size for font file %1.").arg(parent->filename);
|
||||||
if (errorMessage.isEmpty())
|
if (errorMessage.isEmpty())
|
||||||
errorMessage = msg;
|
errorMessage = msg;
|
||||||
kdError(kvs::dvi) << msg << endl;
|
kError(kvs::dvi) << msg << endl;
|
||||||
g->shrunkenCharacter.resize(1,1);
|
g->shrunkenCharacter.resize(1,1);
|
||||||
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
||||||
return g;
|
return g;
|
||||||
|
@ -185,7 +185,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
|
||||||
QString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
QString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
||||||
if (errorMessage.isEmpty())
|
if (errorMessage.isEmpty())
|
||||||
errorMessage = msg;
|
errorMessage = msg;
|
||||||
kdError(kvs::dvi) << msg << endl;
|
kError(kvs::dvi) << msg << endl;
|
||||||
g->shrunkenCharacter.resize(1,1);
|
g->shrunkenCharacter.resize(1,1);
|
||||||
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
||||||
return g;
|
return g;
|
||||||
|
@ -197,7 +197,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
|
||||||
QString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
QString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
||||||
if (errorMessage.isEmpty())
|
if (errorMessage.isEmpty())
|
||||||
errorMessage = msg;
|
errorMessage = msg;
|
||||||
kdError(kvs::dvi) << msg << endl;
|
kError(kvs::dvi) << msg << endl;
|
||||||
g->shrunkenCharacter.resize(1,1);
|
g->shrunkenCharacter.resize(1,1);
|
||||||
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
g->shrunkenCharacter.fill(QColor(255, 255, 255));
|
||||||
return g;
|
return g;
|
||||||
|
@ -208,7 +208,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
|
||||||
if ((slot->bitmap.width == 0) || (slot->bitmap.rows == 0)) {
|
if ((slot->bitmap.width == 0) || (slot->bitmap.rows == 0)) {
|
||||||
if (errorMessage.isEmpty())
|
if (errorMessage.isEmpty())
|
||||||
errorMessage = i18n("Glyph #%1 is empty.").arg(ch);
|
errorMessage = i18n("Glyph #%1 is empty.").arg(ch);
|
||||||
kdError(kvs::dvi) << i18n("Glyph #%1 from font file %2 is empty.").arg(ch).arg(parent->filename) << endl;
|
kError(kvs::dvi) << i18n("Glyph #%1 from font file %2 is empty.").arg(ch).arg(parent->filename) << endl;
|
||||||
g->shrunkenCharacter.resize( 15, 15 );
|
g->shrunkenCharacter.resize( 15, 15 );
|
||||||
g->shrunkenCharacter.fill(QColor(255, 0, 0));
|
g->shrunkenCharacter.fill(QColor(255, 0, 0));
|
||||||
g->x2 = 0;
|
g->x2 = 0;
|
||||||
|
@ -280,7 +280,7 @@ glyph* TeXFont_PFB::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCo
|
||||||
QString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
QString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.").arg(ch).arg(parent->filename);
|
||||||
if (errorMessage.isEmpty())
|
if (errorMessage.isEmpty())
|
||||||
errorMessage = msg;
|
errorMessage = msg;
|
||||||
kdError(kvs::dvi) << msg << endl;
|
kError(kvs::dvi) << msg << endl;
|
||||||
g->dvi_advance_in_units_of_design_size_by_2e20 = 1;
|
g->dvi_advance_in_units_of_design_size_by_2e20 = 1;
|
||||||
}
|
}
|
||||||
g->dvi_advance_in_units_of_design_size_by_2e20 = (qint32)(((qint64)(1<<20) * (qint64)face->glyph->metrics.horiAdvance) / (qint64)face->units_per_EM);
|
g->dvi_advance_in_units_of_design_size_by_2e20 = (qint32)(((qint64)(1<<20) * (qint64)face->glyph->metrics.horiAdvance) / (qint64)face->units_per_EM);
|
||||||
|
|
|
@ -80,23 +80,23 @@ TeXFont_PK::TeXFont_PK(TeXFontDefinition *parent)
|
||||||
: TeXFont(parent)
|
: TeXFont(parent)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK( parent=" << parent << ")" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
|
for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
|
||||||
characterBitmaps[i] = 0;
|
characterBitmaps[i] = 0;
|
||||||
file = fopen(QFile::encodeName(parent->filename), "r");
|
file = fopen(QFile::encodeName(parent->filename), "r");
|
||||||
if (file == 0)
|
if (file == 0)
|
||||||
kdError(kvs::dvi) << i18n("Cannot open font file %1.").arg(parent->filename) << endl;
|
kError(kvs::dvi) << i18n("Cannot open font file %1.").arg(parent->filename) << endl;
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
else
|
else
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
read_PK_index();
|
read_PK_index();
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK() ended" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK() ended" << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ TeXFont_PK::~TeXFont_PK()
|
||||||
glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
|
glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QColor& color)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Paranoia checks
|
// Paranoia checks
|
||||||
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
|
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
|
||||||
kdError(kvs::dvi) << "TeXFont_PK::getGlyph(): Argument is too big." << endl;
|
kError(kvs::dvi) << "TeXFont_PK::getGlyph(): Argument is too big." << endl;
|
||||||
return glyphtable;
|
return glyphtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
|
||||||
// If the character is not defined in the PK file, mark the
|
// If the character is not defined in the PK file, mark the
|
||||||
// character as missing, and print an error message
|
// character as missing, and print an error message
|
||||||
if (g->addr == 0) {
|
if (g->addr == 0) {
|
||||||
kdError(kvs::dvi) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2").arg(ch).arg(parent->filename) << endl;
|
kError(kvs::dvi) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2").arg(ch).arg(parent->filename) << endl;
|
||||||
g->addr = -1;
|
g->addr = -1;
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,7 @@ static quint32 bit_masks[33] = {
|
||||||
int TeXFont_PK::PK_get_nyb(FILE *fp)
|
int TeXFont_PK::PK_get_nyb(FILE *fp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "PK_get_nyb" << endl;
|
kDebug(kvs::dvi) << "PK_get_nyb" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned temp;
|
unsigned temp;
|
||||||
|
@ -389,7 +389,7 @@ int TeXFont_PK::PK_get_nyb(FILE *fp)
|
||||||
int TeXFont_PK::PK_packed_num(FILE *fp)
|
int TeXFont_PK::PK_packed_num(FILE *fp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "PK_packed_num" << endl;
|
kDebug(kvs::dvi) << "PK_packed_num" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -421,7 +421,7 @@ int TeXFont_PK::PK_packed_num(FILE *fp)
|
||||||
void TeXFont_PK::PK_skip_specials()
|
void TeXFont_PK::PK_skip_specials()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() called" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
|
@ -429,7 +429,7 @@ void TeXFont_PK::PK_skip_specials()
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
if (fp == 0)
|
if (fp == 0)
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials(): file == 0" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials(): file == 0" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -459,7 +459,7 @@ void TeXFont_PK::PK_skip_specials()
|
||||||
while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START);
|
while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START);
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() ended" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::PK_skip_specials() ended" << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ void TeXFont_PK::PK_skip_specials()
|
||||||
void TeXFont_PK::read_PK_char(unsigned int ch)
|
void TeXFont_PK::read_PK_char(unsigned int ch)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "read_PK_char" << endl;
|
kDebug(kvs::dvi) << "read_PK_char" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -496,7 +496,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "loading pk char " << ch << ", char type " << n << endl;
|
kDebug(kvs::dvi) << "loading pk char " << ch << ", char type " << n << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (characterBitmaps[ch] == 0)
|
if (characterBitmaps[ch] == 0)
|
||||||
|
@ -558,7 +558,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
|
||||||
// (Ultra-)Sparc processors.
|
// (Ultra-)Sparc processors.
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "big Endian byte ordering" << endl;
|
kDebug(kvs::dvi) << "big Endian byte ordering" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (PK_dyn_f == 14) { /* get raster by bits */
|
if (PK_dyn_f == 14) { /* get raster by bits */
|
||||||
|
@ -644,7 +644,7 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
|
||||||
// Intel and Alpha processors.
|
// Intel and Alpha processors.
|
||||||
|
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "small Endian byte ordering" << endl;
|
kDebug(kvs::dvi) << "small Endian byte ordering" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (PK_dyn_f == 14) { /* get raster by bits */
|
if (PK_dyn_f == 14) { /* get raster by bits */
|
||||||
|
@ -720,17 +720,17 @@ void TeXFont_PK::read_PK_char(unsigned int ch)
|
||||||
void TeXFont_PK::read_PK_index()
|
void TeXFont_PK::read_PK_index()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (file == 0) {
|
if (file == 0) {
|
||||||
kdError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
|
kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int magic = two(file);
|
int magic = two(file);
|
||||||
if (magic != PK_MAGIC) {
|
if (magic != PK_MAGIC) {
|
||||||
kdError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file is not a PK file" << endl;
|
kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file is not a PK file" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ void TeXFont_PK::read_PK_index()
|
||||||
int hppp = sfour(file);
|
int hppp = sfour(file);
|
||||||
int vppp = sfour(file);
|
int vppp = sfour(file);
|
||||||
if (hppp != vppp)
|
if (hppp != vppp)
|
||||||
kdWarning(kvs::dvi) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp << endl;
|
kWarning(kvs::dvi) << i18n("Font has non-square aspect ratio ") << vppp << ":" << hppp << endl;
|
||||||
|
|
||||||
// Read glyph directory (really a whole pass over the file).
|
// Read glyph directory (really a whole pass over the file).
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -769,10 +769,10 @@ void TeXFont_PK::read_PK_index()
|
||||||
glyphtable[ch].x2 = PK_flag_byte;
|
glyphtable[ch].x2 = PK_flag_byte;
|
||||||
fseek(file, (long) bytes_left, SEEK_CUR);
|
fseek(file, (long) bytes_left, SEEK_CUR);
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr << endl;
|
kDebug(kvs::dvi) << "Scanning pk char " << ch << "at " << glyphtable[ch].addr << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef DEBUG_PK
|
#ifdef DEBUG_PK
|
||||||
kdDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl;
|
kDebug(kvs::dvi) << "TeXFont_PK::read_PK_index() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,12 +21,12 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
: TeXFont(parent)
|
: TeXFont(parent)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_TFM
|
#ifdef DEBUG_TFM
|
||||||
kdDebug(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( parent=" << parent << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QFile file( parent->filename );
|
QFile file( parent->filename );
|
||||||
if ( !file.open( QIODevice::ReadOnly ) ) {
|
if ( !file.open( QIODevice::ReadOnly ) ) {
|
||||||
kdError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
|
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QDataStream stream( &file );
|
QDataStream stream( &file );
|
||||||
|
@ -36,7 +36,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
quint16 lf, lh, bc, ec, nw, nh, nd;
|
quint16 lf, lh, bc, ec, nw, nh, nd;
|
||||||
stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd;
|
stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd;
|
||||||
#ifdef DEBUG_TFM
|
#ifdef DEBUG_TFM
|
||||||
kdDebug(kvs::dvi) << "lf= " << lf << endl
|
kDebug(kvs::dvi) << "lf= " << lf << endl
|
||||||
<< "lh= " << lh << endl
|
<< "lh= " << lh << endl
|
||||||
<< "bc= " << bc << endl
|
<< "bc= " << bc << endl
|
||||||
<< "ec= " << ec << endl
|
<< "ec= " << ec << endl
|
||||||
|
@ -45,7 +45,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
<< "nd= " << nd << endl;
|
<< "nd= " << nd << endl;
|
||||||
#endif
|
#endif
|
||||||
if ((bc > ec) || (ec >= TeXFontDefinition::max_num_of_chars_in_font)) {
|
if ((bc > ec) || (ec >= TeXFontDefinition::max_num_of_chars_in_font)) {
|
||||||
kdError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries." << endl;
|
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries." << endl;
|
||||||
file.close();
|
file.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
file.at(24);
|
file.at(24);
|
||||||
stream >> checksum >> design_size_in_TeX_points.value;
|
stream >> checksum >> design_size_in_TeX_points.value;
|
||||||
#ifdef DEBUG_TFM
|
#ifdef DEBUG_TFM
|
||||||
kdDebug(kvs::dvi) << "checksum = " << checksum << endl
|
kDebug(kvs::dvi) << "checksum = " << checksum << endl
|
||||||
<< "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl
|
<< "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl
|
||||||
<< " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl;
|
<< " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -93,7 +93,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
quint8 byte;
|
quint8 byte;
|
||||||
stream >> byte;
|
stream >> byte;
|
||||||
if (byte >= nw)
|
if (byte >= nw)
|
||||||
kdError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
|
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
|
||||||
else {
|
else {
|
||||||
characterWidth_in_units_of_design_size[characterCode] = widthTable_in_units_of_design_size[byte];
|
characterWidth_in_units_of_design_size[characterCode] = widthTable_in_units_of_design_size[byte];
|
||||||
g->dvi_advance_in_units_of_design_size_by_2e20 = widthTable_in_units_of_design_size[byte].value;
|
g->dvi_advance_in_units_of_design_size_by_2e20 = widthTable_in_units_of_design_size[byte].value;
|
||||||
|
@ -102,7 +102,7 @@ TeXFont_TFM::TeXFont_TFM(TeXFontDefinition *parent)
|
||||||
stream >> byte;
|
stream >> byte;
|
||||||
byte = byte >> 4;
|
byte = byte >> 4;
|
||||||
if (byte >= nh)
|
if (byte >= nh)
|
||||||
kdError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
|
kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
|
||||||
else
|
else
|
||||||
characterHeight_in_units_of_design_size[characterCode] = heightTable_in_units_of_design_size[byte];
|
characterHeight_in_units_of_design_size[characterCode] = heightTable_in_units_of_design_size[byte];
|
||||||
|
|
||||||
|
@ -121,12 +121,12 @@ TeXFont_TFM::~TeXFont_TFM()
|
||||||
glyph* TeXFont_TFM::getGlyph(quint16 characterCode, bool generateCharacterPixmap, const QColor& color)
|
glyph* TeXFont_TFM::getGlyph(quint16 characterCode, bool generateCharacterPixmap, const QColor& color)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_TFM
|
#ifdef DEBUG_TFM
|
||||||
kdDebug(kvs::dvi) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
kDebug(kvs::dvi) << "TeXFont_TFM::getGlyph( ch=" << ch << ", generateCharacterPixmap=" << generateCharacterPixmap << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Paranoia checks
|
// Paranoia checks
|
||||||
if (characterCode >= TeXFontDefinition::max_num_of_chars_in_font) {
|
if (characterCode >= TeXFontDefinition::max_num_of_chars_in_font) {
|
||||||
kdError(kvs::dvi) << "TeXFont_TFM::getGlyph(): Argument is too big." << endl;
|
kError(kvs::dvi) << "TeXFont_TFM::getGlyph(): Argument is too big." << endl;
|
||||||
return glyphtable;
|
return glyphtable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,9 @@ quint8 bigEndianByteReader::readUINT8()
|
||||||
// necessary for virtual fonts, which do not end whith EOP.
|
// necessary for virtual fonts, which do not end whith EOP.
|
||||||
if (command_pointer >= end_pointer) {
|
if (command_pointer >= end_pointer) {
|
||||||
#ifdef DEBUG_ENDIANREADER
|
#ifdef DEBUG_ENDIANREADER
|
||||||
kdError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
|
kError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
|
||||||
kdError(kvs::dvi) << "end_pointer = " << end_pointer << endl;
|
kError(kvs::dvi) << "end_pointer = " << end_pointer << endl;
|
||||||
kdError(kvs::dvi) << "command_pointer = " << command_pointer << endl;
|
kError(kvs::dvi) << "command_pointer = " << command_pointer << endl;
|
||||||
#endif
|
#endif
|
||||||
return EOP;
|
return EOP;
|
||||||
}
|
}
|
||||||
|
|
16
dviFile.cpp
16
dviFile.cpp
|
@ -83,7 +83,7 @@ dvifile::dvifile(const dvifile *old, fontPool *fp)
|
||||||
size_of_file = old->size_of_file;
|
size_of_file = old->size_of_file;
|
||||||
end_pointer = dvi_Data()+size_of_file;
|
end_pointer = dvi_Data()+size_of_file;
|
||||||
if (dvi_Data() == 0) {
|
if (dvi_Data() == 0) {
|
||||||
kdError(kvs::dvi) << "Not enough memory to copy the DVI-file." << endl;
|
kError(kvs::dvi) << "Not enough memory to copy the DVI-file." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ void dvifile::read_postamble()
|
||||||
command_pointer += len;
|
command_pointer += len;
|
||||||
|
|
||||||
#ifdef DEBUG_FONTS
|
#ifdef DEBUG_FONTS
|
||||||
kdDebug(kvs::dvi) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design << endl;
|
kDebug(kvs::dvi) << "Postamble: define font \"" << fontname << "\" scale=" << scale << " design=" << design << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// According to section A.4 of the DVI driver standard, this font
|
// According to section A.4 of the DVI driver standard, this font
|
||||||
|
@ -234,11 +234,11 @@ void dvifile::read_postamble()
|
||||||
void dvifile::prepare_pages()
|
void dvifile::prepare_pages()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIFILE
|
#ifdef DEBUG_DVIFILE
|
||||||
kdDebug(kvs::dvi) << "prepare_pages" << endl;
|
kDebug(kvs::dvi) << "prepare_pages" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (page_offset.resize(total_pages+1) == false) {
|
if (page_offset.resize(total_pages+1) == false) {
|
||||||
kdError(kvs::dvi) << "No memory for page list!" << endl;
|
kError(kvs::dvi) << "No memory for page list!" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(int i=0; i<=total_pages; i++)
|
for(int i=0; i<=total_pages; i++)
|
||||||
|
@ -267,7 +267,7 @@ void dvifile::prepare_pages()
|
||||||
dvifile::dvifile(const QString& fname, fontPool* pool)
|
dvifile::dvifile(const QString& fname, fontPool* pool)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIFILE
|
#ifdef DEBUG_DVIFILE
|
||||||
kdDebug(kvs::dvi) << "init_dvi_file: " << fname << endl;
|
kDebug(kvs::dvi) << "init_dvi_file: " << fname << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
errorMsg = QString::null;
|
errorMsg = QString::null;
|
||||||
|
@ -289,13 +289,13 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
|
||||||
// whole memory buffer is readable
|
// whole memory buffer is readable
|
||||||
end_pointer = dvi_Data()+size_of_file;
|
end_pointer = dvi_Data()+size_of_file;
|
||||||
if (dvi_Data() == 0) {
|
if (dvi_Data() == 0) {
|
||||||
kdError(kvs::dvi) << i18n("Not enough memory to load the DVI-file.");
|
kError(kvs::dvi) << i18n("Not enough memory to load the DVI-file.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.readBlock((char *)dvi_Data(), size_of_file);
|
file.readBlock((char *)dvi_Data(), size_of_file);
|
||||||
file.close();
|
file.close();
|
||||||
if (file.status() != QFile::Status(IO_Ok)) {
|
if (file.status() != QFile::Status(IO_Ok)) {
|
||||||
kdError(kvs::dvi) << i18n("Could not load the DVI-file.");
|
kError(kvs::dvi) << i18n("Could not load the DVI-file.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
|
||||||
dvifile::~dvifile()
|
dvifile::~dvifile()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIFILE
|
#ifdef DEBUG_DVIFILE
|
||||||
kdDebug(kvs::dvi) << "destroy dvi-file" << endl;
|
kDebug(kvs::dvi) << "destroy dvi-file" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Delete converted PDF files
|
// Delete converted PDF files
|
||||||
|
|
|
@ -69,7 +69,7 @@ dviRenderer::dviRenderer(QWidget *par)
|
||||||
currentlyDrawnPage(0)
|
currentlyDrawnPage(0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer( parent=" << par << " )" << endl;
|
kDebug(kvs::dvi) << "dviRenderer( parent=" << par << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(&font_pool, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) );
|
connect(&font_pool, SIGNAL( setStatusBarText( const QString& ) ), this, SIGNAL( setStatusBarText( const QString& ) ) );
|
||||||
|
@ -82,7 +82,7 @@ dviRenderer::dviRenderer(QWidget *par)
|
||||||
dviRenderer::~dviRenderer()
|
dviRenderer::~dviRenderer()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdDebug(kvs::dvi) << "~dviRenderer" << endl;
|
kDebug(kvs::dvi) << "~dviRenderer" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
|
@ -118,34 +118,34 @@ void dviRenderer::showInfo()
|
||||||
void dviRenderer::drawPage(double resolution, RenderedDocumentPagePixmap* page)
|
void dviRenderer::drawPage(double resolution, RenderedDocumentPagePixmap* page)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, page number " << page->getPageNumber() << endl;
|
kDebug(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, page number " << page->getPageNumber() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Paranoid safety checks
|
// Paranoid safety checks
|
||||||
if (page == 0) {
|
if (page == 0) {
|
||||||
kdError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl;
|
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (page->getPageNumber() == 0) {
|
if (page->getPageNumber() == 0) {
|
||||||
kdError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0" << endl;
|
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
if ( dviFile == 0 ) {
|
if ( dviFile == 0 ) {
|
||||||
kdError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
|
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
|
||||||
page->clear();
|
page->clear();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (page->getPageNumber() > dviFile->total_pages) {
|
if (page->getPageNumber() > dviFile->total_pages) {
|
||||||
kdError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->getPageNumber()
|
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->getPageNumber()
|
||||||
<< " but the current dviFile has only " << dviFile->total_pages << " pages." << endl;
|
<< " but the current dviFile has only " << dviFile->total_pages << " pages." << endl;
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( dviFile->dvi_Data() == 0 ) {
|
if ( dviFile->dvi_Data() == 0 ) {
|
||||||
kdError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
|
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
|
||||||
page->clear();
|
page->clear();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return;
|
return;
|
||||||
|
@ -271,7 +271,7 @@ void dviRenderer::showThatSourceInformationIsPresent()
|
||||||
void dviRenderer::embedPostScript()
|
void dviRenderer::embedPostScript()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::embedPostScript()" << endl;
|
kDebug(kvs::dvi) << "dviRenderer::embedPostScript()" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!dviFile)
|
if (!dviFile)
|
||||||
|
@ -317,7 +317,7 @@ void dviRenderer::embedPostScript()
|
||||||
|
|
||||||
// Prescan phase starts here
|
// Prescan phase starts here
|
||||||
#ifdef PERFORMANCE_MEASUREMENT
|
#ifdef PERFORMANCE_MEASUREMENT
|
||||||
kdDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl;
|
kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl;
|
||||||
QTime preScanTimer;
|
QTime preScanTimer;
|
||||||
preScanTimer.start();
|
preScanTimer.start();
|
||||||
#endif
|
#endif
|
||||||
|
@ -346,7 +346,7 @@ void dviRenderer::embedPostScript()
|
||||||
|
|
||||||
|
|
||||||
#ifdef PERFORMANCE_MEASUREMENT
|
#ifdef PERFORMANCE_MEASUREMENT
|
||||||
kdDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl;
|
kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl;
|
||||||
#endif
|
#endif
|
||||||
current_page = currPageSav;
|
current_page = currPageSav;
|
||||||
_isModified = true;
|
_isModified = true;
|
||||||
|
@ -380,7 +380,7 @@ bool dviRenderer::isValidFile(const QString& filename) const
|
||||||
bool dviRenderer::setFile(const QString &fname, const KUrl &base)
|
bool dviRenderer::setFile(const QString &fname, const KUrl &base)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::setFile( fname='" << fname << "', ref='" << ref << "', sourceMarker=" << sourceMarker << " )" << endl;
|
kDebug(kvs::dvi) << "dviRenderer::setFile( fname='" << fname << "', ref='" << ref << "', sourceMarker=" << sourceMarker << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//QMutexLocker lock(&mutex);
|
//QMutexLocker lock(&mutex);
|
||||||
|
@ -489,7 +489,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
|
||||||
|
|
||||||
// PRESCAN STARTS HERE
|
// PRESCAN STARTS HERE
|
||||||
#ifdef PERFORMANCE_MEASUREMENT
|
#ifdef PERFORMANCE_MEASUREMENT
|
||||||
kdDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl;
|
kDebug(kvs::dvi) << "Time elapsed till prescan phase starts " << performanceTimer.elapsed() << "ms" << endl;
|
||||||
QTime preScanTimer;
|
QTime preScanTimer;
|
||||||
preScanTimer.start();
|
preScanTimer.start();
|
||||||
#endif
|
#endif
|
||||||
|
@ -537,7 +537,7 @@ bool dviRenderer::setFile(const QString &fname, const KUrl &base)
|
||||||
|
|
||||||
|
|
||||||
#ifdef PERFORMANCE_MEASUREMENT
|
#ifdef PERFORMANCE_MEASUREMENT
|
||||||
kdDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl;
|
kDebug(kvs::dvi) << "Time required for prescan phase: " << preScanTimer.restart() << "ms" << endl;
|
||||||
#endif
|
#endif
|
||||||
current_page = currPageSav;
|
current_page = currPageSav;
|
||||||
// PRESCAN ENDS HERE
|
// PRESCAN ENDS HERE
|
||||||
|
@ -559,7 +559,7 @@ Anchor dviRenderer::parseReference(const QString &reference)
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
|
|
||||||
#ifdef DEBUG_DVIRENDERER
|
#ifdef DEBUG_DVIRENDERER
|
||||||
kdError(kvs::dvi) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
|
kError(kvs::dvi) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dviFile == 0) {
|
if (dviFile == 0) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ extern QPainter *foreGroundPainter;
|
||||||
void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
|
void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_RENDER
|
#ifdef DEBUG_RENDER
|
||||||
kdDebug(kvs::dvi) << "set_char #" << ch << endl;
|
kDebug(kvs::dvi) << "set_char #" << ch << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glyph *g;
|
glyph *g;
|
||||||
|
@ -207,13 +207,13 @@ void dviRenderer::set_empty_char(unsigned int, unsigned int)
|
||||||
void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
|
void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_RENDER
|
#ifdef DEBUG_RENDER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )" << endl;
|
kDebug(kvs::dvi) << "dviRenderer::set_vf_char( cmd=" << cmd << ", ch=" << ch << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned char c;
|
static unsigned char c;
|
||||||
macro *m = &currinf.fontp->macrotable[ch];
|
macro *m = &currinf.fontp->macrotable[ch];
|
||||||
if (m->pos == NULL) {
|
if (m->pos == NULL) {
|
||||||
kdError(kvs::dvi) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
|
kError(kvs::dvi) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
|
||||||
m->pos = m->end = &c;
|
m->pos = m->end = &c;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ void dviRenderer::set_vf_char(unsigned int cmd, unsigned int ch)
|
||||||
void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
|
void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_RENDER
|
#ifdef DEBUG_RENDER
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" << endl;
|
kDebug(kvs::dvi) << "dviRenderer::set_no_char( cmd=" << cmd << ", ch =" << ch << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (currinf._virtual) {
|
if (currinf._virtual) {
|
||||||
|
@ -268,7 +268,7 @@ void dviRenderer::set_no_char(unsigned int cmd, unsigned int ch)
|
||||||
void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
|
void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_RENDER
|
#ifdef DEBUG_RENDER
|
||||||
kdDebug(kvs::dvi) << "draw_part" << endl;
|
kDebug(kvs::dvi) << "draw_part" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qint32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0;
|
qint32 RRtmp=0, WWtmp=0, XXtmp=0, YYtmp=0, ZZtmp=0;
|
||||||
|
@ -369,7 +369,7 @@ void dviRenderer::draw_part(double current_dimconv, bool is_vfmacro)
|
||||||
// that at the end of a page, the stack should always be
|
// that at the end of a page, the stack should always be
|
||||||
// empty.
|
// empty.
|
||||||
if (!stack.isEmpty()) {
|
if (!stack.isEmpty()) {
|
||||||
kdDebug(kvs::dvi) << "DRAW: The stack was not empty when the EOP command was encountered." << endl;
|
kDebug(kvs::dvi) << "DRAW: The stack was not empty when the EOP command was encountered." << endl;
|
||||||
errorMsg = i18n("The stack was not empty when the EOP command was encountered.");
|
errorMsg = i18n("The stack was not empty when the EOP command was encountered.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -591,14 +591,14 @@ void dviRenderer::draw_page()
|
||||||
// elapsed till the kdvi_multipage was constructed, and print
|
// elapsed till the kdvi_multipage was constructed, and print
|
||||||
// it. Set the flag so that is message will not be printed again.
|
// it. Set the flag so that is message will not be printed again.
|
||||||
if (performanceFlag == 0) {
|
if (performanceFlag == 0) {
|
||||||
kdDebug(kvs::dvi) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms" << endl;
|
kDebug(kvs::dvi) << "Time elapsed till the first page is drawn: " << performanceTimer.restart() << "ms" << endl;
|
||||||
performanceFlag = 1;
|
performanceFlag = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_RENDER
|
#ifdef DEBUG_RENDER
|
||||||
kdDebug(kvs::dvi) <<"draw_page" << endl;
|
kDebug(kvs::dvi) <<"draw_page" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!accessibilityBackground)
|
if (!accessibilityBackground)
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern void parse_special_argument(const QString& strg, const char* argument_nam
|
||||||
void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
|
void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl;
|
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Encapsulated Postscript File
|
// Encapsulated Postscript File
|
||||||
|
@ -226,7 +226,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *beginningOfSpecialCommand)
|
||||||
void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecialCommand)
|
void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecialCommand)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl;
|
kDebug(kvs::dvi) << "dviRenderer::prescan_embedPS( cp = " << cp << " ) " << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Encapsulated Postscript File
|
// Encapsulated Postscript File
|
||||||
|
@ -241,7 +241,7 @@ void dviRenderer::prescan_removePageSizeInfo(char *cp, quint8 *beginningOfSpecia
|
||||||
void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp)
|
void dviRenderer::prescan_ParsePapersizeSpecial(const QString& _cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "Papersize-Special : papersize" << _cp << endl;
|
kDebug(kvs::dvi) << "Papersize-Special : papersize" << _cp << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString cp = _cp.simplified();
|
QString cp = _cp.simplified();
|
||||||
|
@ -280,7 +280,7 @@ void dviRenderer::prescan_ParseHTMLAnchorSpecial(const QString& _cp)
|
||||||
void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
|
void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "PostScript-special, header " << cp.latin1() << endl;
|
kDebug(kvs::dvi) << "PostScript-special, header " << cp.latin1() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString _file = cp;
|
QString _file = cp;
|
||||||
|
@ -303,7 +303,7 @@ void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
|
||||||
void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
|
void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "PostScript-special, literal header " << cp.latin1() << endl;
|
kDebug(kvs::dvi) << "PostScript-special, literal header " << cp.latin1() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PS_interface->PostScriptHeaderString->append( " @defspecial \n" );
|
PS_interface->PostScriptHeaderString->append( " @defspecial \n" );
|
||||||
|
@ -315,7 +315,7 @@ void dviRenderer::prescan_ParsePSBangSpecial(const QString& cp)
|
||||||
void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
|
void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdError(kvs::dvi) << "PostScript-special, literal PostScript " << cp.latin1() << endl;
|
kError(kvs::dvi) << "PostScript-special, literal PostScript " << cp.latin1() << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300;
|
double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300;
|
||||||
|
@ -330,7 +330,7 @@ void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
|
||||||
void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
|
void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "PostScript-special, direct PostScript " << cp << endl;
|
kDebug(kvs::dvi) << "PostScript-special, direct PostScript " << cp << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Unfortunately, in some TeX distribution the hyperref package uses
|
// Unfortunately, in some TeX distribution the hyperref package uses
|
||||||
|
@ -394,7 +394,7 @@ void dviRenderer::prescan_ParsePSSpecial(const QString& cp)
|
||||||
void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp)
|
void dviRenderer::prescan_ParsePSFileSpecial(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl;
|
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString include_command = cp.simplified();
|
QString include_command = cp.simplified();
|
||||||
|
@ -618,7 +618,7 @@ void dviRenderer::prescan_setChar(unsigned int ch)
|
||||||
void dviRenderer::prescan(parseSpecials specialParser)
|
void dviRenderer::prescan(parseSpecials specialParser)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PRESCAN
|
#ifdef DEBUG_PRESCAN
|
||||||
kdDebug(kvs::dvi) << "dviRenderer::prescan( ... )" << endl;
|
kDebug(kvs::dvi) << "dviRenderer::prescan( ... )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (resolutionInDPI == 0.0)
|
if (resolutionInDPI == 0.0)
|
||||||
|
|
|
@ -41,7 +41,7 @@ void DVIWidget::mousePressEvent(QMouseEvent* e)
|
||||||
RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNumber));
|
RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNumber));
|
||||||
if (pageData == 0)
|
if (pageData == 0)
|
||||||
{
|
{
|
||||||
kdDebug(kvs::dvi) << "DVIWidget::mousePressEvent(...) pageData for page #" << pageNumber << " is empty" << endl;
|
kDebug(kvs::dvi) << "DVIWidget::mousePressEvent(...) pageData for page #" << pageNumber << " is empty" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ void DVIWidget::mouseMoveEvent(QMouseEvent* e)
|
||||||
// Get a pointer to the page contents
|
// Get a pointer to the page contents
|
||||||
RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNumber));
|
RenderedDviPagePixmap* pageData = dynamic_cast<RenderedDviPagePixmap*>(documentCache->getPage(pageNumber));
|
||||||
if (pageData == 0) {
|
if (pageData == 0) {
|
||||||
kdDebug(kvs::dvi) << "DVIWidget::mouseMoveEvent(...) pageData for page #" << pageNumber << " is empty" << endl;
|
kDebug(kvs::dvi) << "DVIWidget::mouseMoveEvent(...) pageData for page #" << pageNumber << " is empty" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ void DVIExport::start(const QString& command,
|
||||||
process_->start(command, args, QIODevice::ReadOnly);
|
process_->start(command, args, QIODevice::ReadOnly);
|
||||||
if (!process_->waitForStarted(-1))
|
if (!process_->waitForStarted(-1))
|
||||||
#endif
|
#endif
|
||||||
kdError(kvs::dvi) << command << " failed to start" << endl;
|
kError(kvs::dvi) << command << " failed to start" << endl;
|
||||||
else
|
else
|
||||||
started_ = true;
|
started_ = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ DVISourceEditor::DVISourceEditor(dviRenderer& parent,
|
||||||
dynamic_cast<const RenderedDviPagePixmap*> parent->currentlyDrawnPage;
|
dynamic_cast<const RenderedDviPagePixmap*> parent->currentlyDrawnPage;
|
||||||
if (currentDVIPage)
|
if (currentDVIPage)
|
||||||
{
|
{
|
||||||
kdDebug(kvs::dvi) << "Source hyperlink to " << currentDVIPage->sourceHyperLinkList[i].linkText << endl;
|
kDebug(kvs::dvi) << "Source hyperlink to " << currentDVIPage->sourceHyperLinkList[i].linkText << endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -76,13 +76,13 @@ DVISourceEditor::DVISourceEditor(dviRenderer& parent,
|
||||||
command = command.replace( "%l", QString::number(splitter.line()) ).replace( "%f", KProcess::quote(TeXfile) );
|
command = command.replace( "%l", QString::number(splitter.line()) ).replace( "%f", KProcess::quote(TeXfile) );
|
||||||
|
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "Calling program: " << command << endl;
|
kDebug(kvs::dvi) << "Calling program: " << command << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set up a shell process with the editor command.
|
// Set up a shell process with the editor command.
|
||||||
process_ = new KShellProcess;
|
process_ = new KShellProcess;
|
||||||
if (process_ == 0) {
|
if (process_ == 0) {
|
||||||
kdError(kvs::dvi) << "Could not allocate ShellProcess for the editor command." << endl;
|
kError(kvs::dvi) << "Could not allocate ShellProcess for the editor command." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
connect(process_, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(output_receiver(KProcess *, char *, int)));
|
connect(process_, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(output_receiver(KProcess *, char *, int)));
|
||||||
|
@ -104,7 +104,7 @@ DVISourceEditor::DVISourceEditor(dviRenderer& parent,
|
||||||
*process_ << command;
|
*process_ << command;
|
||||||
process_->closeStdin();
|
process_->closeStdin();
|
||||||
if (!process_->start(KProcess::NotifyOnExit, KProcess::AllOutput))
|
if (!process_->start(KProcess::NotifyOnExit, KProcess::AllOutput))
|
||||||
kdError(kvs::dvi) << "Editor failed to start" << endl;
|
kError(kvs::dvi) << "Editor failed to start" << endl;
|
||||||
else
|
else
|
||||||
started_ = true;
|
started_ = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
|
||||||
bool possibleNumberMixUp = false;
|
bool possibleNumberMixUp = false;
|
||||||
|
|
||||||
#ifdef DEBUG_SOURCESPLITTER
|
#ifdef DEBUG_SOURCESPLITTER
|
||||||
kdDebug(kvs::dvi) << "DVI_SourceSplitter: srclink " << srclink << endl;
|
kDebug(kvs::dvi) << "DVI_SourceSplitter: srclink " << srclink << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//remove src: if necessary
|
//remove src: if necessary
|
||||||
|
@ -46,7 +46,7 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
|
||||||
linepart = linepart.trimmed();
|
linepart = linepart.trimmed();
|
||||||
|
|
||||||
#ifdef DEBUG_SOURCESPLITTER
|
#ifdef DEBUG_SOURCESPLITTER
|
||||||
kdDebug(kvs::dvi) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart << endl;
|
kDebug(kvs::dvi) << "DVI_SourceSplitter: filepart " << filepart << " linepart " << linepart << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//test if the file exists
|
//test if the file exists
|
||||||
|
@ -70,12 +70,12 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
|
||||||
{
|
{
|
||||||
tempInfo.setFile(linepart.right(index) + tempFileName);
|
tempInfo.setFile(linepart.right(index) + tempFileName);
|
||||||
#ifdef DEBUG_SOURCESPLITTER
|
#ifdef DEBUG_SOURCESPLITTER
|
||||||
kdDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl;
|
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl;
|
||||||
#endif
|
#endif
|
||||||
if ( tempInfo.exists() ) { found = true; break;}
|
if ( tempInfo.exists() ) { found = true; break;}
|
||||||
tempInfo.setFile(linepart.right(index) + tempFileName + ".tex");
|
tempInfo.setFile(linepart.right(index) + tempFileName + ".tex");
|
||||||
#ifdef DEBUG_SOURCESPLITTER
|
#ifdef DEBUG_SOURCESPLITTER
|
||||||
kdDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl;
|
kDebug(kvs::dvi) << "DVI_SourceSplitter: trying " << tempInfo.fileName() << endl;
|
||||||
#endif
|
#endif
|
||||||
if ( tempInfo.exists() ) { found = true; break;}
|
if ( tempInfo.exists() ) { found = true; break;}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,6 @@ DVI_SourceFileSplitter::DVI_SourceFileSplitter(const QString &srclink, const QSt
|
||||||
if (!ok) m_line = 0;
|
if (!ok) m_line = 0;
|
||||||
|
|
||||||
#ifdef DEBUG_SOURCESPLITTER
|
#ifdef DEBUG_SOURCESPLITTER
|
||||||
kdDebug(kvs::dvi) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line << endl;
|
kDebug(kvs::dvi) << "DVI_SourceSplitter: result: file " << m_fileInfo.absoluteFilePath() << " line " << m_line << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
fontEncoding::fontEncoding(const QString &encName)
|
fontEncoding::fontEncoding(const QString &encName)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTENC
|
#ifdef DEBUG_FONTENC
|
||||||
kdDebug(kvs::dvi) << "fontEncoding( " << encName << " )" << endl;
|
kDebug(kvs::dvi) << "fontEncoding( " << encName << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_isValid = false;
|
_isValid = false;
|
||||||
|
@ -37,7 +37,7 @@ fontEncoding::fontEncoding(const QString &encName)
|
||||||
QIODevice::ReadOnly|QIODevice::Text);
|
QIODevice::ReadOnly|QIODevice::Text);
|
||||||
|
|
||||||
if (!kpsewhich.waitForStarted()) {
|
if (!kpsewhich.waitForStarted()) {
|
||||||
kdError(kvs::dvi) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl;
|
kError(kvs::dvi) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,12 +46,12 @@ fontEncoding::fontEncoding(const QString &encName)
|
||||||
|
|
||||||
const QString encFileName = QString(kpsewhich.readAll()).trimmed();
|
const QString encFileName = QString(kpsewhich.readAll()).trimmed();
|
||||||
if (encFileName.isEmpty()) {
|
if (encFileName.isEmpty()) {
|
||||||
kdError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl;
|
kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FONTENC
|
#ifdef DEBUG_FONTENC
|
||||||
kdDebug(kvs::dvi) << "FileName of the encoding: " << encFileName << endl;
|
kDebug(kvs::dvi) << "FileName of the encoding: " << encFileName << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QFile file( encFileName );
|
QFile file( encFileName );
|
||||||
|
@ -69,7 +69,7 @@ fontEncoding::fontEncoding(const QString &encName)
|
||||||
// Find the name of the encoding
|
// Find the name of the encoding
|
||||||
encodingFullName = fileContent.section('[', 0, 0).simplified().mid(1);
|
encodingFullName = fileContent.section('[', 0, 0).simplified().mid(1);
|
||||||
#ifdef DEBUG_FONTENC
|
#ifdef DEBUG_FONTENC
|
||||||
kdDebug(kvs::dvi) << "encodingFullName: " << encodingFullName << endl;
|
kDebug(kvs::dvi) << "encodingFullName: " << encodingFullName << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplified();
|
fileContent = fileContent.section('[', 1, 1).section(']',0,0).simplified();
|
||||||
|
@ -79,14 +79,14 @@ fontEncoding::fontEncoding(const QString &encName)
|
||||||
for ( QStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) {
|
for ( QStringList::Iterator it = glyphNameList.begin(); (it != glyphNameList.end())&&(i<256); ++it ) {
|
||||||
glyphNameVector[i] = (*it).simplified();
|
glyphNameVector[i] = (*it).simplified();
|
||||||
#ifdef DEBUG_FONTENC
|
#ifdef DEBUG_FONTENC
|
||||||
kdDebug(kvs::dvi) << i << ": " << glyphNameVector[i] << endl;
|
kDebug(kvs::dvi) << i << ": " << glyphNameVector[i] << endl;
|
||||||
#endif
|
#endif
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
for(; i<256; i++)
|
for(; i<256; i++)
|
||||||
glyphNameVector[i] = ".notdef";
|
glyphNameVector[i] = ".notdef";
|
||||||
} else {
|
} else {
|
||||||
kdError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl;
|
kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class fontEncoding {
|
||||||
// The constructor takes the name of an encoding file, such as
|
// The constructor takes the name of an encoding file, such as
|
||||||
// '8r.enc', locate the file on the hard disk using the 'kpsewhich'
|
// '8r.enc', locate the file on the hard disk using the 'kpsewhich'
|
||||||
// command, reads it in and parses it. If the file cannot be
|
// command, reads it in and parses it. If the file cannot be
|
||||||
// located, opened or parsed, errors are printed using the kdError()
|
// located, opened or parsed, errors are printed using the kError()
|
||||||
// channel, and the array glyphNameVector will contain empty
|
// channel, and the array glyphNameVector will contain empty
|
||||||
// strings.
|
// strings.
|
||||||
fontEncoding(const QString &encName);
|
fontEncoding(const QString &encName);
|
||||||
|
|
12
fontMap.cpp
12
fontMap.cpp
|
@ -41,7 +41,7 @@ fontMap::fontMap()
|
||||||
QIODevice::ReadOnly|QIODevice::Text);
|
QIODevice::ReadOnly|QIODevice::Text);
|
||||||
|
|
||||||
if (!kpsewhich.waitForStarted()) {
|
if (!kpsewhich.waitForStarted()) {
|
||||||
kdError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
|
kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ fontMap::fontMap()
|
||||||
QStringList() << "--format=dvips config" << "ps2pk.map",
|
QStringList() << "--format=dvips config" << "ps2pk.map",
|
||||||
QIODevice::ReadOnly|QIODevice::Text);
|
QIODevice::ReadOnly|QIODevice::Text);
|
||||||
if (!kpsewhich.waitForStarted()) {
|
if (!kpsewhich.waitForStarted()) {
|
||||||
kdError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
|
kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ fontMap::fontMap()
|
||||||
map_fileName = QString(kpsewhich.readAll()).trimmed();
|
map_fileName = QString(kpsewhich.readAll()).trimmed();
|
||||||
// If both versions fail, then there is nothing left to do.
|
// If both versions fail, then there is nothing left to do.
|
||||||
if (map_fileName.isEmpty()) {
|
if (map_fileName.isEmpty()) {
|
||||||
kdError(kvs::dvi) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich." << endl;
|
kError(kvs::dvi) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,13 +105,13 @@ fontMap::fontMap()
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
} else
|
} else
|
||||||
kdError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
|
kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
|
||||||
|
|
||||||
#ifdef DEBUG_FONTMAP
|
#ifdef DEBUG_FONTMAP
|
||||||
kdDebug(kvs::dvi) << "FontMap file parsed. Results:" << endl;
|
kDebug(kvs::dvi) << "FontMap file parsed. Results:" << endl;
|
||||||
QMap<QString, fontMapEntry>::Iterator it;
|
QMap<QString, fontMapEntry>::Iterator it;
|
||||||
for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it )
|
for ( it = fontMapEntries.begin(); it != fontMapEntries.end(); ++it )
|
||||||
kdDebug(kvs::dvi) << "TeXName: " << it.key()
|
kDebug(kvs::dvi) << "TeXName: " << it.key()
|
||||||
<< ", FontFileName=" << it.data().fontFileName
|
<< ", FontFileName=" << it.data().fontFileName
|
||||||
<< ", FullName=" << it.data().fullFontName
|
<< ", FullName=" << it.data().fullFontName
|
||||||
<< ", Encoding=" << it.data().fontEncoding
|
<< ", Encoding=" << it.data().fontEncoding
|
||||||
|
|
|
@ -87,7 +87,7 @@ class fontMap {
|
||||||
and read its contents. If the file 'ps2pk.map' cannot be found
|
and read its contents. If the file 'ps2pk.map' cannot be found
|
||||||
using the kpsewhich command, or if it cannot be read, or is
|
using the kpsewhich command, or if it cannot be read, or is
|
||||||
(partially) in an improper format, an error message is printed
|
(partially) in an improper format, an error message is printed
|
||||||
to stderr using the kdDebug() stream. */
|
to stderr using the kDebug() stream. */
|
||||||
fontMap( void );
|
fontMap( void );
|
||||||
|
|
||||||
/** find the name of a font file (e.g. 'ubkd8a.pfb') from a TeX font
|
/** find the name of a font file (e.g. 'ubkd8a.pfb') from a TeX font
|
||||||
|
|
32
fontpool.cpp
32
fontpool.cpp
|
@ -44,7 +44,7 @@ fontPool::fontPool()
|
||||||
0)
|
0)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::fontPool() called" << endl;
|
kDebug(kvs::dvi) << "fontPool::fontPool() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setName("Font Pool");
|
setName("Font Pool");
|
||||||
|
@ -58,7 +58,7 @@ fontPool::fontPool()
|
||||||
#ifdef HAVE_FREETYPE
|
#ifdef HAVE_FREETYPE
|
||||||
// Initialize the Freetype Library
|
// Initialize the Freetype Library
|
||||||
if ( FT_Init_FreeType( &FreeType_library ) != 0 ) {
|
if ( FT_Init_FreeType( &FreeType_library ) != 0 ) {
|
||||||
kdError(kvs::dvi) << "Cannot load the FreeType library. KDVI proceeds without FreeType support." << endl;
|
kError(kvs::dvi) << "Cannot load the FreeType library. KDVI proceeds without FreeType support." << endl;
|
||||||
FreeType_could_be_loaded = false;
|
FreeType_could_be_loaded = false;
|
||||||
} else
|
} else
|
||||||
FreeType_could_be_loaded = true;
|
FreeType_could_be_loaded = true;
|
||||||
|
@ -90,12 +90,12 @@ fontPool::fontPool()
|
||||||
|
|
||||||
if ((result == 0xff) || (result == 0x00)) {
|
if ((result == 0xff) || (result == 0x00)) {
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap does not support the alpha channel" << endl;
|
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap does not support the alpha channel" << endl;
|
||||||
#endif
|
#endif
|
||||||
QPixmapSupportsAlpha = false;
|
QPixmapSupportsAlpha = false;
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap supports the alpha channel" << endl;
|
kDebug(kvs::dvi) << "fontPool::fontPool(): QPixmap supports the alpha channel" << endl;
|
||||||
#endif
|
#endif
|
||||||
QPixmapSupportsAlpha = true;
|
QPixmapSupportsAlpha = true;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ fontPool::fontPool()
|
||||||
fontPool::~fontPool()
|
fontPool::~fontPool()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::~fontPool() called" << endl;
|
kDebug(kvs::dvi) << "fontPool::~fontPool() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FREETYPE
|
#ifdef HAVE_FREETYPE
|
||||||
|
@ -152,7 +152,7 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, quint32 checksum,
|
||||||
|
|
||||||
fontp = new TeXFontDefinition(fontname, displayResolution*enlargement, checksum, scale, this, enlargement);
|
fontp = new TeXFontDefinition(fontname, displayResolution*enlargement, checksum, scale, this, enlargement);
|
||||||
if (fontp == 0) {
|
if (fontp == 0) {
|
||||||
kdError(kvs::dvi) << i18n("Could not allocate memory for a font structure!") << endl;
|
kError(kvs::dvi) << i18n("Could not allocate memory for a font structure!") << endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
fontList.append(fontp);
|
fontList.append(fontp);
|
||||||
|
@ -170,7 +170,7 @@ TeXFontDefinition* fontPool::appendx(const QString& fontname, quint32 checksum,
|
||||||
QString fontPool::status()
|
QString fontPool::status()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::status() called" << endl;
|
kDebug(kvs::dvi) << "fontPool::status() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
|
@ -226,7 +226,7 @@ QString fontPool::status()
|
||||||
bool fontPool::areFontsLocated()
|
bool fontPool::areFontsLocated()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::areFontsLocated() called" << endl;
|
kDebug(kvs::dvi) << "fontPool::areFontsLocated() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Is there a font whose name we did not try to find out yet?
|
// Is there a font whose name we did not try to find out yet?
|
||||||
|
@ -238,7 +238,7 @@ bool fontPool::areFontsLocated()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "... yes, all fonts are located (but not necessarily loaded)." << endl;
|
kDebug(kvs::dvi) << "... yes, all fonts are located (but not necessarily loaded)." << endl;
|
||||||
#endif
|
#endif
|
||||||
return true; // That says that all fonts are located.
|
return true; // That says that all fonts are located.
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
|
||||||
|
|
||||||
if (matchingFiles.isEmpty() != true) {
|
if (matchingFiles.isEmpty() != true) {
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "Associated " << fontp->fontname << " to " << matchingFiles.first() << endl;
|
kDebug(kvs::dvi) << "Associated " << fontp->fontname << " to " << matchingFiles.first() << endl;
|
||||||
#endif
|
#endif
|
||||||
QString fname = matchingFiles.first();
|
QString fname = matchingFiles.first();
|
||||||
fontp->fontNameReceiver(fname);
|
fontp->fontNameReceiver(fname);
|
||||||
|
@ -431,7 +431,7 @@ void fontPool::locateFonts(bool makePK, bool locateTFMonly, bool *virtualFontsFo
|
||||||
void fontPool::setCMperDVIunit( double _CMperDVI )
|
void fontPool::setCMperDVIunit( double _CMperDVI )
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )" << endl;
|
kDebug(kvs::dvi) << "fontPool::setCMperDVIunit( " << _CMperDVI << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (CMperDVIunit == _CMperDVI)
|
if (CMperDVIunit == _CMperDVI)
|
||||||
|
@ -450,7 +450,7 @@ void fontPool::setCMperDVIunit( double _CMperDVI )
|
||||||
void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
|
void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called" << endl;
|
kDebug(kvs::dvi) << "fontPool::setDisplayResolution( displayResolution_in_dpi=" << _displayResolution_in_dpi << " ) called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Ignore minute changes by less than 2 DPI. The difference would
|
// Ignore minute changes by less than 2 DPI. The difference would
|
||||||
|
@ -459,7 +459,7 @@ void fontPool::setDisplayResolution( double _displayResolution_in_dpi )
|
||||||
// changes the window size by 1 pixel all the time.
|
// changes the window size by 1 pixel all the time.
|
||||||
if ( fabs(displayResolution_in_dpi - _displayResolution_in_dpi) <= 2.0 ) {
|
if ( fabs(displayResolution_in_dpi - _displayResolution_in_dpi) <= 2.0 ) {
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting." << endl;
|
kDebug(kvs::dvi) << "fontPool::setDisplayResolution(...): resolution wasn't changed. Aborting." << endl;
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -494,7 +494,7 @@ void fontPool::markFontsAsLocated()
|
||||||
void fontPool::mark_fonts_as_unused()
|
void fontPool::mark_fonts_as_unused()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "fontPool::mark_fonts_as_unused() called" << endl;
|
kDebug(kvs::dvi) << "fontPool::mark_fonts_as_unused() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TeXFontDefinition *fontp = fontList.first();
|
TeXFontDefinition *fontp = fontList.first();
|
||||||
|
@ -508,7 +508,7 @@ void fontPool::mark_fonts_as_unused()
|
||||||
void fontPool::release_fonts()
|
void fontPool::release_fonts()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "Release_fonts" << endl;
|
kDebug(kvs::dvi) << "Release_fonts" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TeXFontDefinition *fontp = fontList.first();
|
TeXFontDefinition *fontp = fontList.first();
|
||||||
|
@ -536,7 +536,7 @@ void fontPool::mf_output_receiver()
|
||||||
while( (numleft = MetafontOutput.find('\n')) != -1) {
|
while( (numleft = MetafontOutput.find('\n')) != -1) {
|
||||||
QString line = MetafontOutput.left(numleft+1);
|
QString line = MetafontOutput.left(numleft+1);
|
||||||
#ifdef DEBUG_FONTPOOL
|
#ifdef DEBUG_FONTPOOL
|
||||||
kdDebug(kvs::dvi) << "MF OUTPUT RECEIVED: " << line;
|
kDebug(kvs::dvi) << "MF OUTPUT RECEIVED: " << line;
|
||||||
#endif
|
#endif
|
||||||
// Search for a line which marks the beginning of a MetaFont run
|
// Search for a line which marks the beginning of a MetaFont run
|
||||||
// and show the progress dialog at the end of this method.
|
// and show the progress dialog at the end of this method.
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
glyph::glyph()
|
glyph::glyph()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_GLYPH
|
#ifdef DEBUG_GLYPH
|
||||||
kdDebug(kvs::dvi) << "glyph::glyph()" << endl;
|
kDebug(kvs::dvi) << "glyph::glyph()" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
addr = 0;
|
addr = 0;
|
||||||
|
|
|
@ -180,7 +180,7 @@ void KDVIMultiPage::preferencesChanged()
|
||||||
// Call method from parent class
|
// Call method from parent class
|
||||||
KMultiPage::preferencesChanged();
|
KMultiPage::preferencesChanged();
|
||||||
#ifdef KDVI_MULTIPAGE_DEBUG
|
#ifdef KDVI_MULTIPAGE_DEBUG
|
||||||
kdDebug(kvs::dvi) << "preferencesChanged" << endl;
|
kDebug(kvs::dvi) << "preferencesChanged" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool showPS = Prefs::showPS();
|
bool showPS = Prefs::showPS();
|
||||||
|
@ -197,7 +197,7 @@ void KDVIMultiPage::print()
|
||||||
KPrinter *printer = getPrinter(false);
|
KPrinter *printer = getPrinter(false);
|
||||||
// Abort with an error message if no KPrinter could be initialized
|
// Abort with an error message if no KPrinter could be initialized
|
||||||
if (printer == 0) {
|
if (printer == 0) {
|
||||||
kdError(kvs::dvi) << "KPrinter not available" << endl;
|
kError(kvs::dvi) << "KPrinter not available" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
void KDVIMultiPage::doExportText()
|
void KDVIMultiPage::doExportText()
|
||||||
{
|
{
|
||||||
#ifdef KDVI_MULTIPAGE_DEBUG
|
#ifdef KDVI_MULTIPAGE_DEBUG
|
||||||
kdDebug(kvs::dvi) << "KDVIMultiPage::doExportText() called" << endl;
|
kDebug(kvs::dvi) << "KDVIMultiPage::doExportText() called" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Paranoid safety checks
|
// Paranoid safety checks
|
||||||
|
|
28
psgs.cpp
28
psgs.cpp
|
@ -64,7 +64,7 @@ ghostscript_interface::~ghostscript_interface() {
|
||||||
|
|
||||||
void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) {
|
void ghostscript_interface::setPostScript(const PageNumber& page, const QString& PostScript) {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::setPostScript( " << page << ", ... )" << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::setPostScript( " << page << ", ... )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pageList.find(page) == 0) {
|
if (pageList.find(page) == 0) {
|
||||||
|
@ -88,7 +88,7 @@ void ghostscript_interface::setIncludePath(const QString &_includePath) {
|
||||||
|
|
||||||
void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) {
|
void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QColor& background_color, bool permanent) {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )" << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::setBackgroundColor( " << page << ", " << background_color << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pageList.find(page) == 0) {
|
if (pageList.find(page) == 0) {
|
||||||
|
@ -110,7 +110,7 @@ void ghostscript_interface::setBackgroundColor(const PageNumber& page, const QCo
|
||||||
void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
|
void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::restoreBackgroundColor( " << page << " )" << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::restoreBackgroundColor( " << page << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
if (pageList.find(page) == 0)
|
if (pageList.find(page) == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -124,7 +124,7 @@ void ghostscript_interface::restoreBackgroundColor(const PageNumber& page)
|
||||||
|
|
||||||
QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const {
|
QColor ghostscript_interface::getBackgroundColor(const PageNumber& page) const {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::getBackgroundColor( " << page << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pageList.find(page) == 0)
|
if (pageList.find(page) == 0)
|
||||||
|
@ -144,11 +144,11 @@ void ghostscript_interface::clear() {
|
||||||
|
|
||||||
void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) {
|
void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, const QString& filename, long magnification) {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )" << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::gs_generate_graphics_file( " << page << ", " << filename << " )" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (knownDevices.isEmpty()) {
|
if (knownDevices.isEmpty()) {
|
||||||
kdError(kvs::dvi) << "No known devices found" << endl;
|
kError(kvs::dvi) << "No known devices found" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
||||||
<< PSfileName;
|
<< PSfileName;
|
||||||
|
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << gs_exe + " " + gs_args.join(" ") << endl;
|
kDebug(kvs::dvi) << gs_exe + " " + gs_args.join(" ") << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QProcess gs;
|
QProcess gs;
|
||||||
|
@ -243,7 +243,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
||||||
if (!gs.waitForStarted()) {
|
if (!gs.waitForStarted()) {
|
||||||
// Starting ghostscript did not work.
|
// Starting ghostscript did not work.
|
||||||
// TODO: Issue error message, switch PS support off.
|
// TODO: Issue error message, switch PS support off.
|
||||||
kdError(kvs::dvi) << "ghostscript could not be started" << endl;
|
kError(kvs::dvi) << "ghostscript could not be started" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,14 +256,14 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
||||||
|
|
||||||
// Check that gs has indeed produced a file.
|
// Check that gs has indeed produced a file.
|
||||||
if (!QFile::exists(filename)) {
|
if (!QFile::exists(filename)) {
|
||||||
kdError(kvs::dvi) << "GS did not generate file " << filename
|
kError(kvs::dvi) << "GS did not generate file " << filename
|
||||||
<< ", gs exit code " << gs.exitCode() << endl;
|
<< ", gs exit code " << gs.exitCode() << endl;
|
||||||
|
|
||||||
// It didn't. Check if the reason is that the device is not compiled into
|
// It didn't. Check if the reason is that the device is not compiled into
|
||||||
// ghostscript. If so, try again with another device.
|
// ghostscript. If so, try again with another device.
|
||||||
const QString gs_output = gs.readAll();
|
const QString gs_output = gs.readAll();
|
||||||
if (gs_output.contains("Unknown device")) {
|
if (gs_output.contains("Unknown device")) {
|
||||||
kdDebug(kvs::dvi) << QString("The version of ghostscript installed on this computer does not support "
|
kDebug(kvs::dvi) << QString("The version of ghostscript installed on this computer does not support "
|
||||||
"the '%1' device driver.").arg(*gsDevice) << endl;
|
"the '%1' device driver.").arg(*gsDevice) << endl;
|
||||||
knownDevices.remove(gsDevice);
|
knownDevices.remove(gsDevice);
|
||||||
gsDevice = knownDevices.begin();
|
gsDevice = knownDevices.begin();
|
||||||
|
@ -290,7 +290,7 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
||||||
"drivers. Note that KDVI needs to be restarted to re-enable PostScript support."
|
"drivers. Note that KDVI needs to be restarted to re-enable PostScript support."
|
||||||
"</p></qt>"));
|
"</p></qt>"));
|
||||||
else {
|
else {
|
||||||
kdDebug(kvs::dvi) << QString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice) << endl;
|
kDebug(kvs::dvi) << QString("KDVI will now try to use the '%1' device driver.").arg(*gsDevice) << endl;
|
||||||
// The function calls itself recursively until there are no
|
// The function calls itself recursively until there are no
|
||||||
// devices left to try.
|
// devices left to try.
|
||||||
gs_generate_graphics_file(page, filename, magnification);
|
gs_generate_graphics_file(page, filename, magnification);
|
||||||
|
@ -305,11 +305,11 @@ void ghostscript_interface::gs_generate_graphics_file(const PageNumber& page, co
|
||||||
|
|
||||||
void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) {
|
void ghostscript_interface::graphics(const PageNumber& page, double dpi, long magnification, QPainter* paint) {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called." << endl;
|
kDebug(kvs::dvi) << "ghostscript_interface::graphics( " << page << ", " << dpi << ", ... ) called." << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (paint == 0) {
|
if (paint == 0) {
|
||||||
kdError(kvs::dvi) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl;
|
kError(kvs::dvi) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ void ghostscript_interface::graphics(const PageNumber& page, double dpi, long ma
|
||||||
// No PostScript? Then return immediately.
|
// No PostScript? Then return immediately.
|
||||||
if ((info == 0) || (info->PostScriptString->isEmpty())) {
|
if ((info == 0) || (info->PostScriptString->isEmpty())) {
|
||||||
#ifdef DEBUG_PSGS
|
#ifdef DEBUG_PSGS
|
||||||
kdDebug(kvs::dvi) << "No PostScript found. Not drawing anything." << endl;
|
kDebug(kvs::dvi) << "No PostScript found. Not drawing anything." << endl;
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
18
special.cpp
18
special.cpp
|
@ -32,10 +32,10 @@ extern QPainter *foreGroundPainter;
|
||||||
void dviRenderer::printErrorMsgForSpecials(const QString& msg)
|
void dviRenderer::printErrorMsgForSpecials(const QString& msg)
|
||||||
{
|
{
|
||||||
if (dviFile->errorCounter < 25) {
|
if (dviFile->errorCounter < 25) {
|
||||||
kdError(kvs::dvi) << msg << endl;
|
kError(kvs::dvi) << msg << endl;
|
||||||
dviFile->errorCounter++;
|
dviFile->errorCounter++;
|
||||||
if (dviFile->errorCounter == 25)
|
if (dviFile->errorCounter == 25)
|
||||||
kdError(kvs::dvi) << i18n("That makes 25 errors. Further error messages will not be printed.") << endl;
|
kError(kvs::dvi) << i18n("That makes 25 errors. Further error messages will not be printed.") << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ void dviRenderer::html_href_special(const QString& _cp)
|
||||||
cp.truncate(cp.find('"'));
|
cp.truncate(cp.find('"'));
|
||||||
|
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "HTML-special, href " << cp.latin1() << endl;
|
kDebug(kvs::dvi) << "HTML-special, href " << cp.latin1() << endl;
|
||||||
#endif
|
#endif
|
||||||
HTML_href = new QString(cp);
|
HTML_href = new QString(cp);
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ void dviRenderer::html_href_special(const QString& _cp)
|
||||||
void dviRenderer::html_anchor_end()
|
void dviRenderer::html_anchor_end()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "HTML-special, anchor-end" << endl;
|
kDebug(kvs::dvi) << "HTML-special, anchor-end" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (HTML_href != NULL) {
|
if (HTML_href != NULL) {
|
||||||
|
@ -301,7 +301,7 @@ void parse_special_argument(const QString& strg, const char* argument_name, int*
|
||||||
*variable = int(tmp_float+0.5);
|
*variable = int(tmp_float+0.5);
|
||||||
else
|
else
|
||||||
// Maybe we should open a dialog here.
|
// Maybe we should open a dialog here.
|
||||||
kdError(kvs::dvi) << i18n("Malformed parameter in the epsf special command.\n"
|
kError(kvs::dvi) << i18n("Malformed parameter in the epsf special command.\n"
|
||||||
"Expected a float to follow %1 in %2")
|
"Expected a float to follow %1 in %2")
|
||||||
.arg(argument_name).arg(strg) << endl;
|
.arg(argument_name).arg(strg) << endl;
|
||||||
}
|
}
|
||||||
|
@ -311,7 +311,7 @@ void parse_special_argument(const QString& strg, const char* argument_name, int*
|
||||||
void dviRenderer::epsf_special(const QString& cp)
|
void dviRenderer::epsf_special(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl;
|
kDebug(kvs::dvi) << "epsf-special: psfile=" << cp <<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString include_command = cp.simplified();
|
QString include_command = cp.simplified();
|
||||||
|
@ -438,7 +438,7 @@ void dviRenderer::epsf_special(const QString& cp)
|
||||||
void dviRenderer::TPIC_flushPath_special()
|
void dviRenderer::TPIC_flushPath_special()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "TPIC special flushPath" << endl;
|
kDebug(kvs::dvi) << "TPIC special flushPath" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (number_of_elements_in_path == 0) {
|
if (number_of_elements_in_path == 0) {
|
||||||
|
@ -456,7 +456,7 @@ void dviRenderer::TPIC_flushPath_special()
|
||||||
void dviRenderer::TPIC_addPath_special(const QString& cp)
|
void dviRenderer::TPIC_addPath_special(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "TPIC special addPath: " << cp << endl;
|
kDebug(kvs::dvi) << "TPIC special addPath: " << cp << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Adds a point to the path list
|
// Adds a point to the path list
|
||||||
|
@ -490,7 +490,7 @@ void dviRenderer::TPIC_addPath_special(const QString& cp)
|
||||||
void dviRenderer::TPIC_setPen_special(const QString& cp)
|
void dviRenderer::TPIC_setPen_special(const QString& cp)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "TPIC special setPen: " << cp << endl;
|
kDebug(kvs::dvi) << "TPIC special setPen: " << cp << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Sets the pen size in milli-inches
|
// Sets the pen size in milli-inches
|
||||||
|
|
2
util.cpp
2
util.cpp
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
void oops(const QString& message)
|
void oops(const QString& message)
|
||||||
{
|
{
|
||||||
kdError(kvs::dvi) << i18n("Fatal Error! ") << message << endl;
|
kError(kvs::dvi) << i18n("Fatal Error! ") << message << endl;
|
||||||
|
|
||||||
KMessageBox::error( NULL,
|
KMessageBox::error( NULL,
|
||||||
i18n("Fatal error.\n\n") +
|
i18n("Fatal error.\n\n") +
|
||||||
|
|
12
vf.cpp
12
vf.cpp
|
@ -68,7 +68,7 @@ extern void oops(const QString& message);
|
||||||
void TeXFontDefinition::read_VF_index()
|
void TeXFontDefinition::read_VF_index()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FONTS
|
#ifdef DEBUG_FONTS
|
||||||
kdDebug(kvs::dvi) << "font::read_VF_index()" << endl;
|
kDebug(kvs::dvi) << "font::read_VF_index()" << endl;
|
||||||
#endif
|
#endif
|
||||||
FILE *VF_file = file;
|
FILE *VF_file = file;
|
||||||
unsigned char cmnd;
|
unsigned char cmnd;
|
||||||
|
@ -78,14 +78,14 @@ void TeXFontDefinition::read_VF_index()
|
||||||
flags |= FONT_VIRTUAL;
|
flags |= FONT_VIRTUAL;
|
||||||
set_char_p = &dviRenderer::set_vf_char;
|
set_char_p = &dviRenderer::set_vf_char;
|
||||||
#ifdef DEBUG_FONTS
|
#ifdef DEBUG_FONTS
|
||||||
kdDebug(kvs::dvi) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename << endl;
|
kDebug(kvs::dvi) << "TeXFontDefinition::read_VF_index: reading VF pixel file " << filename << endl;
|
||||||
#endif
|
#endif
|
||||||
// Read preamble.
|
// Read preamble.
|
||||||
fseek(VF_file, (long) one(VF_file), 1); /* skip comment */
|
fseek(VF_file, (long) one(VF_file), 1); /* skip comment */
|
||||||
quint32 const file_checksum = four(VF_file);
|
quint32 const file_checksum = four(VF_file);
|
||||||
|
|
||||||
if (file_checksum && checksum && file_checksum != checksum)
|
if (file_checksum && checksum && file_checksum != checksum)
|
||||||
kdError(kvs::dvi) << i18n("Checksum mismatch") << "(dvi = " << checksum << "u, vf = " << file_checksum <<
|
kError(kvs::dvi) << i18n("Checksum mismatch") << "(dvi = " << checksum << "u, vf = " << file_checksum <<
|
||||||
"u)" << i18n(" in font file ") << filename << endl;
|
"u)" << i18n(" in font file ") << filename << endl;
|
||||||
(void) four(VF_file); /* skip design size */
|
(void) four(VF_file); /* skip design size */
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ void TeXFontDefinition::read_VF_index()
|
||||||
fontname[len] = '\0';
|
fontname[len] = '\0';
|
||||||
|
|
||||||
#ifdef DEBUG_FONTS
|
#ifdef DEBUG_FONTS
|
||||||
kdDebug(kvs::dvi) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design << endl;
|
kDebug(kvs::dvi) << "Virtual font defines subfont \"" << fontname << "\" scale=" << scale << " design=" << design << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// According to Knuth's documentation found in the web source code
|
// According to Knuth's documentation found in the web source code
|
||||||
|
@ -131,7 +131,7 @@ void TeXFontDefinition::read_VF_index()
|
||||||
// Prepare macro array.
|
// Prepare macro array.
|
||||||
macrotable = new macro[max_num_of_chars_in_font];
|
macrotable = new macro[max_num_of_chars_in_font];
|
||||||
if (macrotable == 0) {
|
if (macrotable == 0) {
|
||||||
kdError(kvs::dvi) << i18n("Could not allocate memory for a macro table.") << endl;
|
kError(kvs::dvi) << i18n("Could not allocate memory for a macro table.") << endl;
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ void TeXFontDefinition::read_VF_index()
|
||||||
cc = four(VF_file);
|
cc = four(VF_file);
|
||||||
width = four(VF_file);
|
width = four(VF_file);
|
||||||
if (cc >= 256) {
|
if (cc >= 256) {
|
||||||
kdError(kvs::dvi) << i18n("Virtual character ") << cc << i18n(" in font ")
|
kError(kvs::dvi) << i18n("Virtual character ") << cc << i18n(" in font ")
|
||||||
<< fontname << i18n(" ignored.") << endl;
|
<< fontname << i18n(" ignored.") << endl;
|
||||||
fseek(VF_file, (long) len, 1);
|
fseek(VF_file, (long) len, 1);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue