2 * \file src/FontIterator.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alfredo Braunstein
8 * Full author contact details are available in file CREDITS.
15 #include "FontIterator.h"
17 #include "TextMetrics.h"
18 #include "Paragraph.h"
24 FontIterator::FontIterator(TextMetrics
const & tm
,
25 Paragraph
const & par
, pit_type pit
, pos_type pos
)
26 : tm_(tm
), par_(par
), pit_(pit
), pos_(pos
),
27 font_(tm
.getDisplayFont(pit
, pos
)),
28 endspan_(par
.fontSpan(pos
).last
),
29 bodypos_(par
.beginOfBody())
33 Font
const & FontIterator::operator*() const
39 Font
* FontIterator::operator->()
45 FontIterator
& FontIterator::operator++()
48 if (pos_
> endspan_
|| pos_
== bodypos_
) {
49 font_
= tm_
.getDisplayFont(pit_
, pos_
);
50 endspan_
= par_
.fontSpan(pos_
).last
;