getTextExtent
Version 1.0.0 (2.11 KB) by
Eivind Hennestad
Get the pixel extent of a text string with specified font properties.
Description
This function gets the text extent of a text string. Useful if the exact extent of text in GUIs is needed.
Example
>> getTextExtent('Hello World', ...
'Name', 'Avenir Next', ...
'Size', 14, ...
'Weight', 'bold')
ans =
82.0000 19.5000
Cite As
Eivind Hennestad (2026). getTextExtent (https://uk.mathworks.com/matlabcentral/fileexchange/168156-gettextextent), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2024a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
