Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

ofTrueTypeFont setLetterSpacing setSpaceSize problem

$
0
0

@Caroline_Record wrote:

I’m doing some basic text formatting and I think there is an issue with setLetterSpacing and setSpaceSize (OF 10.1).

font.load("verdana.ttf", 20);
font.setSpaceSize(100.0);

52%20PM

font.load("verdana.ttf", 20);
font.setSpaceSize(1.0);

23%20PM

I think the spacing isn’t changing because of line 1071 in ofTrueTypeFont.cpp
pos.x += getGlyphProperties(' ').advance * spaceSize * (letterSpacing - 1.f) * directionX;

When letter spacing is at its default value of 1 this makes it all equal zero and spaceSize has no effect.

When letter spacing isn’t at default letterSpacing and spaceSize are correlated in a way that doesn’t feel intentional.

font.load("verdana.ttf", 20);
font.setLetterSpacing(1.3);

26%20PM

font.load("verdana.ttf", 20);
font.setLetterSpacing(1.3);
font.setSpaceSize(10.0);

font.load("verdana.ttf", 20);
font.setLetterSpacing(1.3);
font.setSpaceSize(100.0);

Shouldn’t setSpaceSize adjust just the space character and not have such a dramatic effect on the overall letter spacing?

Is setSpaceSizing() just legacy (mentioned here) and shouldn’t be used?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles