+
+FontSize FontList::highestInRange
+ (pos_type startpos, pos_type endpos, FontSize def_size) const
+{
+ if (list_.empty())
+ return def_size;
+
+ const_iterator end_it = list_.begin();
+ const_iterator const end = list_.end();
+ for (; end_it != end; ++end_it) {
+ if (end_it->pos() >= endpos)
+ break;
+ }
+
+ if (end_it != end)
+ ++end_it;
+
+ FontList::const_iterator cit = list_.begin();
+ for (; cit != end; ++cit) {
+ if (cit->pos() >= startpos)
+ break;
+ }
+
+ FontSize maxsize = FONT_SIZE_TINY;
+ for (; cit != end_it; ++cit) {
+ FontSize size = cit->font().fontInfo().size();
+ if (size == FONT_SIZE_INHERIT)
+ size = def_size;
+ if (size > maxsize && size <= FONT_SIZE_HUGER)
+ maxsize = size;
+ }
+ return maxsize;
+}
+
+
+bool FontList::hasChangeInRange(pos_type pos, int len) const
+{
+ // FIXME: can't we use fontIterator(pos) instead?
+ const_iterator cit = list_.begin();
+ const_iterator end = list_.end();
+ for (; cit != end; ++cit) {
+ if (cit->pos() >= pos)
+ break;
+ }
+ if (cit != end && pos + len - 1 > cit->pos())
+ return false;
+
+ return true;
+}
+
+
+void FontList::validate(LaTeXFeatures & features) const
+{
+ const_iterator fcit = list_.begin();
+ const_iterator fend = list_.end();
+ for (; fcit != fend; ++fcit)
+ fcit->font().validate(features);
+}
+