There is a button. On different screens, it has a different size, depending on the width of the screen. It is necessary to calculate the maximum possible font size for this button. Ideally, the task is a bit more complicated. Many buttons on the screen with different lengths of text. Find the smallest maximum size for all buttons and apply. To everywhere was the same size font.

  • You can take a screenshot, it is not clear what you mean by the size of the font. - Alexey Malchenko
  • The question is, what is the maximum? If this is a font in which any record on the button fits in one row, then the meaning of maximality is lost, as is convenience for the user. After all, the screen can be relatively small, then the font will be small and inconvenient for the user. Is not it better to get away from the single row of the inscription? Then where is the redistribution of maximum font? In practice, I focus on a convenient font size in sp (dp), and only then I strive for the markup to retain its main ideas at different lettering lengths. - St-st

0