You are passing your text and your font by value... which makes them copies. Therefore any changes made to them in the function will not change the objects that you passed in.
1 2 3 4 5 6 7 8 9 10 11 12 13
void func(int v) // <- v is its own variable
{
v = 5; // <- this changes v... it does not change any other var
}
int main()
{
int q = 10; // <- q is not v
func( q ); // <- passes q by value as 'v'. So this is like saying v = q
// changes made to 'v' will not change 'q' because v is not q
cout << q; // <- will output 10 because q has not changed.
}
Your function has the same problem as this illustrates. Only instead of your function doing 'v = 5', it's setting the font/size/etc.
If you want to change the object you're passing in... you can't pass by value... you can instead pass by reference: