use super::layout::LayoutBox;
const BANDS: [[u32; 3]; 15] = [
[600, 90, 90],
[700, 103, 101],
[800, 114, 116],
[900, 135, 135],
[1000, 148, 146],
[1100, 156, 158],
[1200, 180, 180],
[1300, 193, 191],
[1400, 198, 200],
[1500, 225, 225],
[1600, 238, 236],
[1800, 270, 270],
[2000, 282, 284],
[2200, 328, 326],
[2400, 360, 360],
];
pub(super) fn top_band(body: &LayoutBox, fs: f64, dpi: f64) -> Option<f64> {
let extension = super::fraction_sup_frame::line_extension(body, fs, dpi)?;
let unit = super::font_frame_metrics::base_unit_at_dpi(fs, dpi);
let row = BANDS.iter().find(|row| row[0] == unit)?;
let index = if extension > 0.0 { 2 } else { 1 };
Some(crate::renderer::hwpunit_to_px(row[index] as i32, dpi))
}