Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

`ofTrueTypeFont.stringWidth(str)` returns `-Inf`

$
0
0

@mrmsdbdl wrote:

I’m trying to get the width of each word when I draw a sentence using a monotype font. So, I declared a ofTrueTypeFont, and load the font I want, then I use the stringWidth("Hello") to get the width but I only get -Inf back. I’ve also tried to use getStringBoundingBox() as well but I get (-Inf, -Inf). I’m wondering what I do wrong here, and what else can I use to get the width correctly?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles