summaryrefslogtreecommitdiff
path: root/src/ui/text.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/text.h')
-rw-r--r--src/ui/text.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/text.h b/src/ui/text.h
index 09d92ce0..d779dd96 100644
--- a/src/ui/text.h
+++ b/src/ui/text.h
@@ -159,6 +159,10 @@ struct Impl_TextMetrics {
159 iInt2 advance; /* cursor offset */ 159 iInt2 advance; /* cursor offset */
160}; 160};
161 161
162iLocalDef int maxWidth_TextMetrics(const iTextMetrics d) {
163 return iMax(width_Rect(d.bounds), d.advance.x);
164}
165
162iTextMetrics measureRange_Text (int fontId, iRangecc text); 166iTextMetrics measureRange_Text (int fontId, iRangecc text);
163iTextMetrics measureWrapRange_Text (int fontId, int maxWidth, iRangecc text); 167iTextMetrics measureWrapRange_Text (int fontId, int maxWidth, iRangecc text);
164iTextMetrics measureN_Text (int fontId, const char *text, size_t n); /* `n` in characters */ 168iTextMetrics measureN_Text (int fontId, const char *text, size_t n); /* `n` in characters */