File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -255,4 +255,14 @@ int Font::width(const Utf8View& utf8) const
255
255
return width;
256
256
}
257
257
258
+ int Font::width (const u32 * codepoints, size_t length) const
259
+ {
260
+ if (length == 0 )
261
+ return 0 ;
262
+ int width = (length - 1 ) * glyph_spacing ();
263
+ for (size_t i = 0 ; i < length; ++i)
264
+ width += glyph_or_emoji_width (codepoints[i]);
265
+ return width;
266
+ }
267
+
258
268
}
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ class Font : public RefCounted<Font> {
95
95
96
96
int width (const StringView&) const ;
97
97
int width (const Utf8View&) const ;
98
+ int width (const u32 * codepoints, size_t ) const ;
98
99
99
100
String name () const { return m_name; }
100
101
void set_name (const StringView& name) { m_name = name; }
You can’t perform that action at this time.
0 commit comments