@Carlo Rubini After verification I'll add, if requested, a file showing the issue.
I suspect that it's broken again. 2018r3 introduced the possibility to use GDI Text Rendering again (default in e.g. ListBox).
I've added an example project that shows this issue.
But please add your example, too… That allows Xojo to check a fix against the issue you're seeing.
I don't know if the example I provided has the same underlying issue as yours (since my example project just closes, and doesn't even fall back to the System Font when trying to
.DrawString in a Canvas).
In a canvas I put the following code, but no text is shown.
Replacing self.BitmapForCaching with new Picture too shows no text, but the app does not crash.
Dim p As Picture = self.BitmapForCaching(g.Width, g.Height)
p.Graphics.TextSize = 18
p.Graphics.TextFont = mFont//a temporally installed font
p.Graphics.ForeColor = &c000000
p.Graphics.bold = true
p.Graphics.DrawString "আমার" + EndOfLine + "তোমার" + EndOfLine + "তাদের",0,0
Then it seems that there are at least two issues with custom Fonts in the current Xojo releases.
Either they are "closing" the app, or the fonts just don't display any longer. And there is a workaround that only seems to work for certain fonts/types (maybe).
So it's good that Xojo has both examples to look at, investigate and fix.
last December fix actually did not work, so a few months ago I opened a new case Feedback Case #55423.
Issue: temporarily installed fonts (Windows platform) work OK for all objects, except listboxes and canvases, where the system font takes over.
A few days ago I found that the issue happens only with .ttc fonts, that is fonts-family/collection.
Instead, using .ttf fonts, listbox and canvas both behave properly.
Of course, using .ttf one loses the ability to code something like listbox1.bold = true, since .ttf fonts do not behave as a family/collection. Unless someone teaches me the trick to make four .ttf fonts behave as if they were a .ttc font. It would be great.
If anybody intends to apply this temporary workaround, then one should keep in mind that the .ttf files for bold, italic and bolditalic must all be created as plain/regular with their own particular name (myTTFreg.ttf, myTTFbld.ttf etc) and applied to a listbox or canvas by its name. For instance g.textfont = myTTFbld. And so on and so forth.
Therefore I updated the case above, hoping the new piece of info may help fix the issue.
@Carlo R Of course, using .ttf one loses the ability to code something like listbox1.bold = true, since .ttf fonts do not behave as a family/collection. Unless someone teaches me the trick to make four .ttf fonts behave as if they were a .ttc font. It would be great.
Actually, Windows treats same family font files with different style attributes automatically as a family. If I create four fonts, say MyFont style Plain, myFont Style Bold, MyFont style Italic and MyFont style BoldItalic in Fontographer or FontLab Studio, and install them all, The will show as one font with attributes in Wordpad, Word and other apps. That should solve your issue temporarily.