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.
14 #include "FontIterator.h"
16 #include "TextMetrics.h"
17 #include "Paragraph.h"
23 FontIterator::FontIterator(TextMetrics const & tm,
24 Paragraph const & par, pit_type pit, pos_type pos)
25 : tm_(tm), par_(par), pit_(pit), pos_(pos),
26 font_(tm.displayFont(pit, pos)),
27 endspan_(par.fontSpan(pos).last),
28 bodypos_(par.beginOfBody())
32 Font const & FontIterator::operator*() const
38 Font * FontIterator::operator->()
44 FontIterator & FontIterator::operator++()
47 if (pos_ > endspan_ || pos_ == bodypos_) {
48 font_ = tm_.displayFont(pit_, pos_);
49 endspan_ = par_.fontSpan(pos_).last;