The Dink Network

Reply to Re: Dink and the search for the missing TTF

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
January 29th, 10:48 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
As an example, I have Liberation Sans installed properly in the font database. If it's not installed in the system font database, nothing happens. If I were to run initfont("Liberation Sans") on GNU/Linux or macOS it will search for it using Fontconfig and load it through its database. If it can't find Liberation Sans, it may substitute Open Sans, or another sans serif typeface. The same invocation would fail on Windows as the filename of it that I have here is LiberationSans-Regular.ttf in which case initfont("LiberationSans-Regular") would have to be used to achieve the same effect there, and won't ever perform substitution. This invocation would probably also work on GNU/Linux and macOS as Fontconfig is fairly smart. If someone had a different release of Liberation Sans that they'd installed on Windows which had a different filename such as "Liberation-Sans.ttf", it would fail completely, but might be substituted on GNU/Linux or macOS.

I have no idea what 1.08 would do in regards to name vs file and haven't touched it in years, but the reference suggests name instead of file suggesting the first invocation would be suitable there. Ultimately you're going to have to test it out and see what works and what doesn't, check debug.txt etc. Do keep in mind that only TTFs will work, no OTFs, and that bold will be automatically applied to anything you load.

As you can see, there's a reason why nobody uses initfont as anything more than a minor optional graphical enhancement, such as in Slipdink's Crowns of Stone.