Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2280 → Rev 2283

/trunk/Scribus/scribus/util.cpp
125,6 → 125,8
bool loadText(QString nam, QString *Buffer);
double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
double RealCWidth(ScribusDoc *doc, QString name, QString ch, int Siz);
double RealCHeight(ScribusDoc *currentDoc, QString name, QString ch, int Size);
double RealCAscent(ScribusDoc *currentDoc, QString name, QString ch, int Size);
double QStodouble(QString in);
int QStoInt(QString in);
QString GetAttr(QDomElement *el, QString at, QString def="0");
1045,6 → 1047,42
return static_cast<double>(Siz / 10.0);
}
 
double RealCHeight(ScribusDoc *currentDoc, QString name, QString ch, int Size)
{
double w;
uint c1 = ch.at(0).unicode();
FT_Face face;
Foi* fo = (*currentDoc->AllFonts)[name];
if (fo->CharWidth.contains(c1))
{
face = currentDoc->FFonts[name];
uint cl = FT_Get_Char_Index(face, c1);
FT_Load_Glyph(face, cl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
w = face->glyph->metrics.height / fo->uniEM * (Size / 10.0);
return w;
}
else
return static_cast<double>(Size / 10.0);
}
 
double RealCAscent(ScribusDoc *currentDoc, QString name, QString ch, int Size)
{
double w;
uint c1 = ch.at(0).unicode();
FT_Face face;
Foi* fo = (*currentDoc->AllFonts)[name];
if (fo->CharWidth.contains(c1))
{
face = currentDoc->FFonts[name];
uint cl = FT_Get_Char_Index(face, c1);
FT_Load_Glyph(face, cl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
w = face->glyph->metrics.horiBearingY / fo->uniEM * (Size / 10.0);
return w;
}
else
return static_cast<double>(Size / 10.0);
}
 
QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx = star ? c * 2 : c;
/trunk/Scribus/scribus/pageitem.cpp
44,6 → 44,8
 
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double RealCWidth(ScribusDoc *doc, QString name, QString ch, int Siz);
extern double RealCHeight(ScribusDoc *currentDoc, QString name, QString ch, int Size);
extern double RealCAscent(ScribusDoc *currentDoc, QString name, QString ch, int Size);
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern double xy2Deg(double x, double y);
extern void BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
872,13 → 874,17
{
if (Doc->Vorlagen[hl->cab].BaseAdj)
{
chsd = qRound(10 * ((Doc->BaseGrid * DropLines) / ((*Doc->AllFonts)[hl->cfont]->numAscent+(*Doc->AllFonts)[hl->cfont]->numDescender)));
chs = qRound(10 * ((Doc->BaseGrid * DropLines) / (*Doc->AllFonts)[hl->cfont]->numAscent));
chsd = qRound(10 * ((Doc->BaseGrid * DropLines) / (RealCHeight(Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((Doc->BaseGrid * DropLines) / RealCAscent(Doc, hl->cfont, chx, 10)));
// chsd = qRound(10 * ((Doc->BaseGrid * DropLines) / ((*Doc->AllFonts)[hl->cfont]->numAscent+(*Doc->AllFonts)[hl->cfont]->numDescender)));
// chs = qRound(10 * ((Doc->BaseGrid * DropLines) / (*Doc->AllFonts)[hl->cfont]->numAscent));
}
else
{
chsd = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / ((*Doc->AllFonts)[hl->cfont]->numAscent+(*Doc->AllFonts)[hl->cfont]->numDescender)));
chs = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / (*Doc->AllFonts)[hl->cfont]->numAscent));
chsd = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / (RealCHeight(Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / RealCAscent(Doc, hl->cfont, chx, 10)));
// chsd = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / ((*Doc->AllFonts)[hl->cfont]->numAscent+(*Doc->AllFonts)[hl->cfont]->numDescender)));
// chs = qRound(10 * ((Doc->Vorlagen[absa].LineSpa * DropLines) / (*Doc->AllFonts)[hl->cfont]->numAscent));
}
hl->csize = chsd;
}
904,7 → 910,8
wide = RealCWidth(Doc, hl->cfont, chx2, chsd);
desc2 = 0;
desc = 0;
asce = (*Doc->AllFonts)[hl->cfont]->numAscent * (hl->csize / 10.0);
asce = RealCHeight(Doc, hl->cfont, chx2, chsd);
// asce = (*Doc->AllFonts)[hl->cfont]->numAscent * (hl->csize / 10.0);
}
else
{
1021,7 → 1028,8
CurX += Doc->Vorlagen[hl->cab].First;
}
}
CurX += Doc->Vorlagen[hl->cab].Indent;
if (!AbsHasDrop)
CurX += Doc->Vorlagen[hl->cab].Indent;
fBorder = false;
}
StartOfCol = false;
1088,6 → 1096,8
}
}
hl->yp = CurY + oldCurY;
if (DropCmode)
hl->yp -= RealCHeight(Doc, hl->cfont, chx2, chsd) - RealCAscent(Doc, hl->cfont, chx2, chsd);
if (LiList.count() == 0)
{
Ptext.at(a)->cstyle |= 1024;
1387,7 → 1397,7
}
if (AbsHasDrop)
{
if (CurY > maxDY)
if ((CurY > maxDY) && (CurY - asce > maxDY))
{
AbsHasDrop = false;
CurX = ColBound.x();
1431,7 → 1441,7
CurY += Doc->Vorlagen[hl->cab].LineSpa;
if (AbsHasDrop)
{
if (CurY > maxDY)
if ((CurY > maxDY) && (CurY - asce > maxDY))
{
AbsHasDrop = false;
CurX = ColBound.x();
/trunk/Scribus/scribus/libabout/about.cpp
58,7 → 58,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1 %2 %3 ").arg("27").arg("May").arg("2005");
QString bu = tr("%1 %2 %3 ").arg("29").arg("May").arg("2005");
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus.kdevses
15,7 → 15,7
<mark line="3949" />
</bookmark>
<bookmark url="/home/franz/Entwicklung/AnonCVS/Scribus2/Scribus/scribus/util.cpp" >
<mark line="304" />
<mark line="306" />
</bookmark>
</bookmarks>
</kdevbookmarks>