Problems with the kerning field in the GUI editor


#1

When changing the kerning value on labels, the value gets lost every time a file is reopened and using copy/paste on labels also resets the kerning to 0. It’s a nice feature to have, but these bugs make it currently cumbersome to use as settings keep getting lost.

This is with Projucer 5.2.1 and to reproduce it, just change the kerning on a label, and the copy/paste the label or switch to another file and back.


#2

This has annoyed me so much (I have to reenter my values many times a day while I’m editing tooltips…) - I created a pull request, but unfortunatley I messed up and now it contains all changes on develop… oops! Huge apologies.
So please disregard pull request #357, I hope you are able to delete it. In any case the problem is limited to default fonts and the fix would a few changes to this method in jucer_FontPropertyComponent that would retain the kerning value:

static Font applyNameToFont (const String& typefaceName, const Font& font)
{
    auto extraKerning = font.getExtraKerningFactor();
    if (typefaceName == getDefaultFont())  return Font (font.getHeight(), font.getStyleFlags()).withExtraKerningFactor(extraKerning);
    if (typefaceName == getDefaultSans())  return Font (Font::getDefaultSansSerifFontName(), font.getHeight(), font.getStyleFlags()).withExtraKerningFactor(extraKerning);
    if (typefaceName == getDefaultSerif()) return Font (Font::getDefaultSerifFontName(), font.getHeight(), font.getStyleFlags()).withExtraKerningFactor(extraKerning);
    if (typefaceName == getDefaultMono())  return Font (Font::getDefaultMonospacedFontName(), font.getHeight(), font.getStyleFlags()).withExtraKerningFactor(extraKerning);

    auto f = Font (typefaceName, font.getHeight(), font.getStyleFlags()).withExtraKerningFactor(extraKerning);
    if (f.getAvailableStyles().contains (font.getTypefaceStyle()))
    {
        f.setTypefaceStyle (font.getTypefaceStyle());
    }
    return f;
}

#3

(bump) anyone reading this?


#4

Thanks! Just saw this, seems sensible, will add it!


#5

Thanks heaps!