qt3support--

svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=554697
remotes/origin/kdvi
Wilfried Huss 20 years ago
parent 3ff70516f8
commit 227296e610
  1. 9
      TeXFont_PK.cpp
  2. 8
      special.cpp

@ -203,7 +203,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
int shrunk_height = (int)ceil( (characterBitmaps[ch]->h - srcYTrans)/shrinkFactor );
// Turn the image into 8 bit
QByteArray translated(characterBitmaps[ch]->w * characterBitmaps[ch]->h);
QByteArray translated(characterBitmaps[ch]->w * characterBitmaps[ch]->h, '\0');
quint8 *data = (quint8 *)translated.data();
for(int x=0; x<characterBitmaps[ch]->w; x++)
for(int y=0; y<characterBitmaps[ch]->h; y++) {
@ -214,7 +214,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
}
// Now shrink the image. We shrink the X-direction first
QByteArray xshrunk(shrunk_width*characterBitmaps[ch]->h);
QByteArray xshrunk(shrunk_width*characterBitmaps[ch]->h, '\0');
quint8 *xdata = (quint8 *)xshrunk.data();
// Do the shrinking. The pixel (x,y) that we want to calculate
@ -242,7 +242,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
}
// Now shrink the Y-direction
QByteArray xyshrunk(shrunk_width*shrunk_height);
QByteArray xyshrunk(shrunk_width*shrunk_height, '\0');
quint8 *xydata = (quint8 *)xyshrunk.data();
for(int x=0; x<shrunk_width; x++)
for(int y=0; y<shrunk_height; y++) {
@ -261,8 +261,7 @@ glyph* TeXFont_PK::getGlyph(quint16 ch, bool generateCharacterPixmap, const QCol
xydata[shrunk_width*y + x] = (int)(value/shrinkFactor);
}
QImage im32(shrunk_width, shrunk_height, 32);
im32.setAlphaBuffer(true);
QImage im32(shrunk_width, shrunk_height, QImage::Format_ARGB32);
// Do QPixmaps fully support the alpha channel? If yes, we use
// that. Otherwise, use other routines as a fallback
if (parent->font_pool->QPixmapSupportsAlpha) {

@ -152,7 +152,7 @@ QColor dviRenderer::parseColorSpecification(const QString& colorSpec)
if ((ok == false) || (b < 0.0) || (b > 1.0))
return QColor();
return QColor((int)(h*359.0+0.5), (int)(s*255.0+0.5), (int)(b*255.0+0.5), QColor::Hsv);
return QColor::fromHsv((int)(h*359.0+0.5), (int)(s*255.0+0.5), (int)(b*255.0+0.5));
}
if (specType.indexOf("cmyk", 0, Qt::CaseInsensitive) == 0) {
@ -424,10 +424,10 @@ void dviRenderer::epsf_special(const QString& cp)
f.setPointSize(8);
foreGroundPainter->setFont(f);
if (QFile::exists(EPSfilename))
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename, -1);
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter), EPSfilename);
else
foreGroundPainter->drawText (bbox, (int)(Qt::AlignCenter),
i18n("File not found: \n %1", EPSfilename_orig), -1);
i18n("File not found: \n %1", EPSfilename_orig));
foreGroundPainter->restore();
}
@ -448,7 +448,7 @@ void dviRenderer::TPIC_flushPath_special()
QPen pen(Qt::black, (int)(penWidth_in_mInch*resolutionInDPI/1000.0 + 0.5)); // Sets the pen size in milli-inches
foreGroundPainter->setPen(pen);
foreGroundPainter->drawPolyline(TPIC_path, 0, number_of_elements_in_path);
foreGroundPainter->drawPolyline(TPIC_path.constData(), number_of_elements_in_path);
number_of_elements_in_path = 0;
}

Loading…
Cancel
Save