fix footnote detection
This commit is contained in:
@@ -318,10 +318,14 @@ fn calculate_font_stats(lines: &[TextLine]) -> FontStats {
|
|||||||
|
|
||||||
for line in lines {
|
for line in lines {
|
||||||
for item in &line.items {
|
for item in &line.items {
|
||||||
|
// Only count fonts >= 9pt as potential body text
|
||||||
|
// Smaller fonts are typically table cells, footnotes, or captions
|
||||||
|
if item.font_size >= 9.0 {
|
||||||
let size_key = (item.font_size * 10.0) as i32; // Round to 0.1
|
let size_key = (item.font_size * 10.0) as i32; // Round to 0.1
|
||||||
*size_counts.entry(size_key).or_insert(0) += 1;
|
*size_counts.entry(size_key).or_insert(0) += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let most_common_size = size_counts
|
let most_common_size = size_counts
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user