FontOptions::withKerningFactor

Documentation could use a little love. Like what sort of values might you want to use etc. Is it in some kind of units, percetage etc…

1 Like

The file itself could use some love wrt docs… It’s not entirely clear what

Constructs the default set of options.

even means for the constructor, for example: what are the default options, why are they the default, etc. Then, we have int styleFlags but then we have withStyle which takes a String: so, what are the options for int (apparently we have to use Font::FontStyleFlags which seems a bit of a circular dependency) and what are the options for the String, and are they different?

Unfortunately you’re stuck digging into the code instead of just glancing at a quick description outlining expectations.

It also doesn’t help you if you specify something wrong or unavailable: what happens if the font style doesn’t exist, or the font with a given name? Or is there a min/max/expected range for a kerning factor?

(Sorry for hijacking your thread - I simply wanted to expand on your thought…)

1 Like

Here’s what the file could look like (hand-wavy, somewhat, loosely speaking):

juce_FontOptions.h (28.9 KB)

Note that I used Cursor for just whipping up an idea so its accuracy may be questionable - please take it with a grain of salt.

2 Likes

That, but fact checked, would be great :slight_smile:

If it’s any consolation I gave it a quick glance and edited a couple parts of the docs I didn’t agree with before posting the file here. Still, it’s surely not enough human effort for something production ready.

We need an AI that tests documentation :slight_smile:

2 Likes