Xojo best practice -handling of fonts on different platforms

So my MacOS app is about to get spun up on Windows unexpectedly. Because the app deals mostly with ASCII data and the UX benefits from visually lining up values to be compared, I make broad use of the PT Mono font on MacOS. It looks like PT Mono is a TrueType font so I can download it to the Windows machine. This is an acceptable solution because the app will be deployed on 1 Windows Server for 2 users and eventually maybe on 3 or 4 machines in-house – it is not an onerous requirement that this font be installed and indeed for all I know it already is (haven’t checked yet).

But I wonder, IF this were a commercial app or in some kind of wider distribution, would I be reduced to either making the font install part of the installation package or else iterating through all the controls in a window to change PT Mono to some standard acceptable substitute on the target machine? How are these things normally best handled, apart from sticking to “System” and “System Small”?

The entire Problem with Fonts is: they are not consistently available on all machines and even if: hey they can differ. This problem I learned to accept when programming with QT, with Xojo, with C#. Only Java has own Fonts so I had not to deal with the System fonts in Java Swing Applications on different platforms. But there I had and have to deal with not native stuffs what is also sometimes a crap. Means: best way is: distribute the needed fonts with your App, search for Fonts what you are allowed to distribute on the platforms and deal with them so you have the best situation: the licensing of the fonts is no problem and there is no substitution of fonts. It is a pain in the …ss to do that but there is no way around.

I have a Set f Fonts I am using mostly and distributing them and installing them when installing the Software Package. In my eyes the best situation like with all needed dependencies. There is no tother way except substitution of fonts what makes it anyhow also complex while the substitution is leading in optical totally different placements and situations.

Control you may and will have with the exact same font and even then you may see and evaluate that the find rendering will make you enough fun that it looks different on different platforms. But at least it looks similar.

1 Like

Thanks … that is kind of what I figured. I have never had to commercially distribute a desktop app I’ve built and until now I have never had to concern myself with cross-platform as it has always been some internal tool, so just wanted a reality check.

No problem, I had to suffer that in all types of consequences in my programmers life. And that makes it sometimes really complex especially while the copyrights for the fonts have to be available to install on the platforms or you have no chance against substitution. That was the fundamental point for Sun when building up Swing, LWTUI and also JavaFX for their own System Fonts as Cross Platform fonts. Like Microsoft also Apple had an own Idea of distribution rights for their Truetype Fonts and nobody really knows when getting some font from somewhere under which license it is. And I have a colleague which got also nice and expensive letters from lawyers while distributed some fonts without knowledge that there may be a problem. Therefore it would be needed for a cross platform Library to have that kind of portable fonts but Xojo was not evaluating that problem, they rely that on the customers and on the Systems itself. When it comes to the need that the font has to be exact the same you are at the place you are now thinking about. That kind of evaluation is deep problematic when forgetting about it.

You could also embed an own/custom font in your application.
Example project: GitHub: jo-tools/customappfonts

Be aware of License(s) that might be required or respected for the Font(s).

Yes. Even with the very same font (file).
The rendering depends on the OS, or even the “drawing library” that’s being used.
For example on Windows: GDI and Direct2D doesn’t draw exactly the same.

1 Like

Exactly. That is the unnice Point of it. But it looks at least “similar”. Substituting fonts looks not even like that and often not even near to it.