Text leading is wrong in Bob builds

Hi! I’m getting different results in Bob builds for the font’s leading when building for Windows. Both builds were made on macOS:

With bob.jar:

With the Editor:

Here’s the font:

cooper_hewitt.zip (44.9 KB)

Hmm, I believe Jhonny did some font changes recently. Is this a new problem @dapetcu21?

Not really a new problem. Pretty old, but we didn’t know why we couldn’t reproduce until now. I should add that there might have been one or two defold updates between the bob build and the editor build I did today. (It’s pretty time consuming to reproduce this, since it requires two builds and two computers/a VM)

Do you mean that it works from both editor/bob when running the game on macOS?

1 Like

I mean that building for Windows from the macOS editor is correct, whilst building for Windows with bob.jar running on macOS has the wrong font leading.

@Mathias_Westerdahl Here’s a simple test-case project. I could reproduce with 1.2.159 (bob.jar is f7d0a1ba6940e42c7f7e1c208ba484c3c34a135d and the editor is cfbffb027ee260385ee7c9ef22de16b2e729d1db):

leading-test.zip (47.7 KB)

This is the correct result:

Building with bob:

java -jar ~/Tools/bob.jar --platform x86_64-win32 -bo /Volumes/WD2/bob_build --archive distclean build bundle

Hmmm, it seems like our old issue with otf fonts. Could you please convert otf->ttf and try again?

I remember doing that yields subtly worse font rendering, which is quite important for readability in our game. Let me try.

1 Like

Note that when bundling in the editor, all it does is call bob.jar (internally), so it’s just mildly confusing to talk about the editor in this context.

Anyways, it’s intriguing that java + reading fonts works differently on macOS and Windows.

@Mathias_Westerdahl You (probably) understood me wrong. Both builds were made on macOS, but targeting Windows. One was made with the editor and one was made with bob.jar. The editor one works, the bob one doesn’t.

EDIT: Or what you mean is that building on Windows for Windows behaves differently than building on macOS for Windows?

Maybe there’s different versions of Java? I’m running bob.jar with this Java:

Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

The editor calls bob.jar, so it’s the same as using bob.jar standalone.

Yes, the java version might very well be involved. Iirc, the editor uses Open Jdk 11?
@vlaaad knows more

2 Likes

Converting them to TTF still introduces differences. It’s now smaller instead of larger with bob.jar vs. the editor.

I can confirm the Java version is at fault. Using OpenJDK 11 made the inconsistencies go away

3 Likes

Now that I think about it, what’s odd is that I built both Windows and macOS builds with Java SE 1.8 running on macOS and the macOS-targeted build seems fine, but the Windows-targeted one is not. Same machine, same OS, same Java version, same bob.jar version. Shouldn’t there be the same codepath for compiling fonts no matter what platform you’re targeting? And why is this difference only happening on Java 1.8?

As you say, it should be the same code path, except for the bundling step, so I can’t really say why it behaves like that. The fact that it misbehaves at all in 1.8 is probably the main reason.

1 Like