24 July 2021, 09:18 | #1 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Can I get text width (pixels) from font?
I am writing an application in Intuition. I need to know the width of the text being printed in a TEXT_KIND to see if this is more than the width of the gadget (and then act upon this if so).
For example, given the text "Hello World", is there a way how to know the width that this text will have in pixels for a particular font used? |
24 July 2021, 09:29 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
graphics.library/TextLength
intuition.library/IntuiTextLength There are also graphics.library/TextExtent graphics.library/TextFit The former tells you more details about the space your text neeeds and the latter tells you how many characters of your text fit into the area. |
24 July 2021, 13:33 | #3 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Wow! Many thanks. Let me google about them.
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
QBlit Unqueue width | Nightshft | Coders. Blitz Basic | 4 | 18 June 2020 00:08 |
Bob width >16 pixels | DanielAllsopp | Coders. Asm / Hardware | 10 | 22 May 2020 18:02 |
ListBrowser column width | mritter0 | Coders. C/C++ | 1 | 08 August 2017 07:03 |
Object width | mritter0 | Coders. C/C++ | 2 | 19 September 2014 23:06 |
Get Gadget Width | mritter0 | Coders. C/C++ | 2 | 11 June 2014 02:27 |
|
|