This is with JUCE 8, but it’s an older bug. For some characters, the string width I’m getting is too short and the text does not fit in.
Here are the characters I have used for testing: サンプル名
Font: Roboto - Google Fonts
font.getStringWidth(directory.getFileName())
Here is how it looks. The box is too short and the text does not fit in:

