pub fn count_text_length(doc: &Doc<'_>, printer: &Printer) -> usize