textspan_lut.h 570 B

1234567891011121314151617
  1. /// \file
  2. /// \brief lookup table for textspan
  3. /// \ingroup common_render
  4. #pragma once
  5. #include <stdbool.h>
  6. // LUT is short for lookup table.
  7. /// \param text a single line of ASCII text which should contain no control
  8. /// characters.
  9. /// \return The estimated width of `text` in 1 point. A value is always
  10. /// returned, falling back to Times-Roman metrics if there is no hard-coded
  11. /// lookup table for the given `font_name`.
  12. double estimate_text_width_1pt(const char *font_name, const char *text,
  13. bool bold, bool italic);